:root {
  --blue: #2c91c9;
  --blue-dark: #2178ad;
  --blue-pale: #edf7fc;
  --ink: #354754;
  --muted: #7f8d96;
  --line: #dce4e8;
  --green: #1fa777;
  --red: #df3737;
  --navy: #1f3447;
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { color: var(--ink); background: #eef2f4; font-size: 14px; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.admin-shell { min-height: 100vh; padding: 22px 28px 36px; }
.workspace { width: 100%; max-width: 1360px; min-height: calc(100vh - 52px); margin: 0 auto; overflow: hidden; background: #edf1f4; border-radius: 4px; box-shadow: 0 7px 24px rgba(33,57,72,.1); }
.app-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 30px;
  color: white;
  background: linear-gradient(100deg, #2279af, #2c96ca);
  box-shadow: 0 2px 7px rgba(17, 61, 84, .18);
}
.title-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.title-block h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: .04em; }
.title-block p { margin: 4px 0 0; color: rgba(255,255,255,.7); font-size: 9px; letter-spacing: .28em; }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 auto; padding: 7px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); border-radius: 5px;
}
.brand-mark i { display: block; background: white; border-radius: 1px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.sync-meta {
  min-height: 42px; padding: 0 14px; display: flex; align-items: center; gap: 8px;
  color: #e7f5fc; background: rgba(19,77,108,.24); border: 1px solid rgba(255,255,255,.16); border-radius: 3px;
  font-size: 11px; white-space: nowrap;
}
.source-dot { width: 8px; height: 8px; border-radius: 50%; background: #58e1ae; box-shadow: 0 0 0 4px rgba(88,225,174,.13); }
.source-dot.source-error { background: #ff7676; box-shadow: 0 0 0 4px rgba(255,118,118,.14); }
.sync-divider { width: 1px; height: 16px; margin: 0 3px; background: rgba(255,255,255,.25); }
.refresh-button {
  min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px;
  color: #226e98; background: white; border: 0; border-radius: 3px; cursor: pointer; font-weight: 650;
}
.refresh-button:hover { background: #eff9fe; }
.refresh-button:disabled { cursor: wait; opacity: .8; }
.refresh-icon { font-size: 19px; line-height: 1; }
.refresh-icon.is-spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.breadcrumb { height: 44px; padding: 0 30px; display: flex; align-items: center; gap: 9px; color: #87949c; background: white; border-bottom: 1px solid var(--line); font-size: 11px; }
.breadcrumb strong { color: #53636d; font-weight: 650; }
.workspace-body { padding: 24px 30px 36px; }
.account-panel { overflow: hidden; background: white; border: 1px solid #d8e1e5; border-radius: 3px; box-shadow: 0 2px 12px rgba(45,68,82,.06); }
.panel-heading { min-height: 80px; padding: 18px 22px; display: flex; align-items: center; background: #f7f9fa; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; color: #334752; font-size: 17px; font-weight: 650; }
.panel-heading p { margin: 7px 0 0; color: #8a969d; font-size: 11px; line-height: 1.55; }
.toolbar { min-height: 68px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.search-field { position: relative; width: min(370px, 42vw); }
.search-field input { width: 100%; height: 38px; padding: 0 13px 0 38px; color: #43545e; background: #fbfcfd; border: 1px solid #d4dfe4; border-radius: 3px; outline: none; }
.search-field input:focus { border-color: #62acd2; box-shadow: 0 0 0 3px rgba(44,145,201,.1); }
.search-icon { position: absolute; top: 11px; left: 14px; width: 14px; height: 14px; border: 2px solid #8ca0ab; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; background: #8ca0ab; transform: rotate(45deg); }
.vpn-quick-info { min-width: 0; min-height: 36px; padding: 5px 11px; display: flex; flex: 1 1 360px; align-items: center; justify-content: center; gap: 10px; color: #526671; background: #eef7fb; border: 1px solid #d2e8f2; border-radius: 3px; font-size: 11px; white-space: nowrap; }
.vpn-quick-title { color: #287ca8; font-weight: 750; }
.vpn-quick-detail strong { color: #2f4552; }
.vpn-server-copy { min-height: 26px; padding: 0 7px; display: inline-flex; align-items: center; gap: 6px; color: #157eb5; background: white; border: 1px solid #baddeb; border-radius: 3px; cursor: pointer; font-family: Consolas, "Liberation Mono", monospace; font-weight: 750; }
.vpn-server-copy:hover { background: #e2f3fa; border-color: #86c7df; }
.vpn-server-copy small { color: #718791; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 9px; font-weight: 650; }
.vpn-server-copy:focus-visible { outline: 3px solid rgba(52,153,206,.23); outline-offset: 2px; }
.filter-tabs { display: flex; align-items: center; gap: 5px; }
.filter-tab { height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; color: #62727c; background: white; border: 1px solid #d7e0e4; border-radius: 3px; cursor: pointer; font-size: 11px; }
.filter-tab span { min-width: 20px; padding: 2px 5px; background: #edf1f3; border-radius: 10px; text-align: center; font-size: 10px; }
.filter-tab.is-active { color: white; background: var(--blue); border-color: var(--blue); }
.filter-tab.is-active span { background: rgba(255,255,255,.22); }

.error-banner { margin: 14px 20px 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px; color: #8f3737; background: #fff0f0; border: 1px solid #f2c7c7; border-radius: 3px; }
.error-mark { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: #c94d4d; border-radius: 50%; font-size: 18px; font-weight: 800; }
.error-banner div { flex: 1; }
.error-banner strong { font-size: 12px; }
.error-banner p { margin: 3px 0 0; font-size: 11px; }
.error-banner button { padding: 7px 13px; color: #9a3838; background: white; border: 1px solid #e7b6b6; border-radius: 3px; cursor: pointer; }

.table-wrap { overflow-x: auto; scrollbar-color: #bdcbd2 #f5f7f8; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { height: 52px; padding: 0 16px; color: #75858e; background: #f8fafb; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
th:nth-child(1) { width: 7.5%; } th:nth-child(2) { width: 9.5%; } th:nth-child(3) { width: 10.5%; } th:nth-child(4) { width: 15%; } th:nth-child(5) { width: 21%; } th:nth-child(6) { width: 12%; } th:nth-child(7) { width: 24.5%; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
td { height: 72px; padding: 13px 16px; border-bottom: 1px solid #e5ebee; color: #56656e; vertical-align: middle; line-height: 1.5; }
tbody tr { transition: background-color .16s ease; }
tbody tr:nth-child(even) { background: #fcfdfe; }
tbody tr:hover { background: #f5fafc; }
.account-name { color: #263a46; font-family: Consolas, "Liberation Mono", monospace; font-size: 13px; font-weight: 750; letter-spacing: .02em; }
.status-pill { min-width: 78px; min-height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border-radius: 16px; font-size: 11px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-online { color: #087b56; background: #e5f6ef; }
.status-offline { color: #d62626; background: #ffebeb; }
.status-never { color: #986c18; background: #fff5d9; }
.status-missing { color: #77838a; background: #eef1f3; }
.management-link { min-height: 34px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; color: white; background: var(--blue); border: 1px solid var(--blue); border-radius: 3px; cursor: pointer; font-size: 11px; font-weight: 700; line-height: 1; text-align: center; }
.management-link:hover { color: white; background: #247eae; border-color: #247eae; text-decoration: none; }
.management-link:disabled, .management-link:disabled:hover { color: #8c989f; background: #e8ecef; border-color: #d3dade; cursor: not-allowed; opacity: 1; text-decoration: none; }
.duration-cell { color: #3c4c56; font-weight: 700; }
.duration-prefix { margin-right: 8px; color: #87949c; font-size: 10px; font-weight: 650; }
.duration-offline, .duration-offline .duration-prefix { color: var(--red) !important; font-weight: 800 !important; }
.muted-value { color: #9ca7ad !important; font-weight: 500 !important; }
.comment-view { min-width: 0; min-height: 36px; display: flex; align-items: center; gap: 10px; }
.comment-text { min-width: 0; overflow: hidden; color: #283842; font-weight: 800; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.comment-edit-button, .comment-save-button, .comment-cancel-button { min-height: 32px; padding: 0 10px; border-radius: 3px; cursor: pointer; font-size: 10px; font-weight: 650; line-height: 1; }
.comment-edit-button { flex: 0 0 auto; color: #2a83b3; background: #eff8fc; border: 1px solid #c9e4f0; }
.comment-editor { display: grid; grid-template-columns: minmax(130px, 1fr) auto; align-items: center; gap: 7px; }
.comment-input-wrap { position: relative; min-width: 0; }
.comment-input { width: 100%; height: 34px; padding: 0 46px 0 9px; border: 1px solid #a8cfdf; border-radius: 3px; outline: none; }
.comment-input:focus { border-color: #419cc8; box-shadow: 0 0 0 3px rgba(44,145,201,.1); }
.comment-length { position: absolute; right: 7px; top: 10px; color: #9aa6ad; font-size: 9px; }
.comment-actions { display: flex; gap: 5px; }
.comment-save-button { color: white; background: var(--blue); border: 1px solid var(--blue); }
.comment-cancel-button { color: #65747d; background: white; border: 1px solid #d3dde2; }
.comment-error { grid-column: 1/-1; color: #cf3030; font-size: 10px; }
.comment-editor button:disabled { cursor: wait; opacity: .65; }
.router-version-cell { color: #344954; font-variant-numeric: tabular-nums; }
.router-version { display: inline-block; max-width: 100%; overflow: hidden; color: #294858; font-family: Consolas, "Liberation Mono", monospace; font-size: 11px; font-weight: 750; line-height: 1.5; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.router-version.is-stale { opacity: .7; }
.router-version-stale { margin-left: 5px; color: #8b989f; font-size: 9px; font-weight: 600; }
.router-version-pending, .router-version-unavailable { color: #98a4aa; font-size: 10px; font-weight: 600; }
.l2tp-cell { color: #3c4c56; font-variant-numeric: tabular-nums; }
.l2tp-control { min-width: 0; min-height: 36px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; }
.l2tp-counts { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 11px; font-weight: 700; }
.l2tp-count strong { font-family: Consolas, "Liberation Mono", monospace; font-size: 12px; }
.l2tp-online { color: #087b56; }
.l2tp-offline { color: var(--red); }
.l2tp-separator { color: #a5b0b6; font-weight: 500; }
.l2tp-counts.is-stale { opacity: .6; }
.l2tp-stale-label { color: #8b989f; font-size: 9px; font-weight: 600; }
.l2tp-pending, .l2tp-unavailable { color: #98a4aa; font-size: 10px; font-weight: 600; }
.l2tp-edit-button { min-height: 32px; flex: 0 0 auto; padding: 0 10px; color: #247aa7; background: #f2f9fc; border: 1px solid #bcddec; border-radius: 3px; cursor: pointer; font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap; }
.l2tp-edit-button:hover:not(:disabled) { color: white; background: var(--blue); border-color: var(--blue); }
.l2tp-edit-button:disabled, .l2tp-edit-button:disabled:hover { color: #8c989f; background: #e8ecef; border-color: #d3dade; cursor: not-allowed; opacity: 1; }
.l2tp-edit-button:focus-visible { outline: 3px solid rgba(52,153,206,.23); outline-offset: 2px; }

body.has-modal { overflow: hidden; }
.l2tp-modal { position: fixed; inset: 0; z-index: 2200; display: grid; place-items: center; padding: 24px; }
.l2tp-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(15,35,48,.58); border: 0; cursor: default; backdrop-filter: blur(3px); }
.l2tp-modal-panel { position: relative; width: min(1220px, 100%); max-height: min(860px, calc(100vh - 48px)); max-height: min(860px, calc(100dvh - 48px)); overflow: hidden; display: flex; flex-direction: column; background: #f4f6f8; border: 1px solid rgba(255,255,255,.65); border-radius: 5px; box-shadow: 0 28px 80px rgba(13,37,51,.3); }
.l2tp-modal-header { min-height: 58px; padding: 0 18px 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: white; background: linear-gradient(180deg,#637185,#536175); }
.l2tp-modal-header p { margin: 0 0 4px; color: rgba(255,255,255,.68); font-size: 9px; font-weight: 750; letter-spacing: .2em; }
.l2tp-modal-header h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .01em; }
.l2tp-modal-header span { display: block; margin-top: 5px; color: rgba(255,255,255,.78); font-size: 11px; }
.l2tp-modal-close { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: transparent; border: 0; border-radius: 2px; cursor: pointer; font-size: 24px; line-height: 1; }
.l2tp-modal-close:hover { background: rgba(255,255,255,.22); }
.l2tp-modal-close:disabled { cursor: wait; opacity: .55; }
.l2tp-editor-notice { margin: 14px 18px 0; padding: 10px 12px; border-radius: 4px; font-size: 11px; font-weight: 650; }
.l2tp-editor-notice.is-error { color: #a43131; background: #fff0f0; border: 1px solid #f0c5c5; }
.l2tp-editor-notice.is-success { color: #087452; background: #e8f7f1; border: 1px solid #bce5d5; }
.l2tp-modal-content { min-height: 240px; padding: 18px; overflow: auto; overscroll-behavior: contain; }
.l2tp-modal-summary { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #73838c; font-size: 10px; }
.l2tp-dial-list { display: grid; gap: 14px; }
.l2tp-dial-card { overflow: hidden; background: white; border: 1px solid #d5e0e5; border-radius: 5px; box-shadow: 0 3px 12px rgba(35,61,76,.06); }
.l2tp-dial-heading { min-height: 54px; padding: 10px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #f8fafb; border-bottom: 1px solid #e1e8eb; }
.l2tp-dial-heading > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.l2tp-dial-name { overflow: hidden; color: #2b414d; font-family: Consolas,"Liberation Mono",monospace; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.l2tp-dial-id { padding: 2px 6px; color: #829199; background: #edf1f3; border-radius: 9px; font-size: 9px; }
.l2tp-dial-state { min-width: 50px; padding: 4px 8px; border-radius: 11px; text-align: center; font-size: 9px; font-weight: 750; }
.l2tp-dial-state.is-online { color: #087b56; background: #e5f6ef; }
.l2tp-dial-state.is-offline { color: #c63131; background: #ffebeb; }
.l2tp-form-grid { padding: 15px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.l2tp-form-field { min-width: 0; display: grid; gap: 5px; color: #6f7f88; font-size: 10px; font-weight: 650; }
.l2tp-form-field.is-wide { grid-column: span 2; }
.l2tp-form-field input, .l2tp-form-field select { width: 100%; min-width: 0; height: 36px; padding: 0 9px; color: #334852; background: white; border: 1px solid #cbd8de; border-radius: 3px; outline: none; font-size: 11px; font-weight: 500; }
.l2tp-form-field input:focus, .l2tp-form-field select:focus { border-color: #4a9ec7; box-shadow: 0 0 0 3px rgba(44,145,201,.1); }
.l2tp-form-field input:disabled, .l2tp-form-field select:disabled { color: #849198; background: #f1f4f5; }
.l2tp-readonly-field strong { min-height: 36px; padding: 0 9px; display: flex; align-items: center; color: #53646d; background: #f1f4f5; border: 1px solid #d8e1e5; border-radius: 3px; font-family: Consolas,"Liberation Mono",monospace; font-size: 11px; font-weight: 650; }
.l2tp-dial-actions { min-height: 54px; padding: 10px 15px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; background: #fbfcfc; border-top: 1px solid #e6ecef; }
.l2tp-dial-actions span { color: #929da3; font-size: 9px; }
.l2tp-dial-save, .l2tp-dial-retry { min-height: 34px; padding: 0 15px; color: white; background: var(--blue); border: 1px solid var(--blue); border-radius: 3px; cursor: pointer; font-size: 11px; font-weight: 700; }
.l2tp-dial-save:hover, .l2tp-dial-retry:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.l2tp-dial-save:disabled { cursor: wait; opacity: .68; }
.l2tp-modal-footer { padding: 11px 18px; color: #7d8b93; background: white; border-top: 1px solid #dae3e7; font-size: 10px; line-height: 1.6; }
.l2tp-modal-state { min-height: 260px; padding: 30px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #77878f; text-align: center; }
.l2tp-modal-state strong { margin-top: 13px; color: #3d515d; font-size: 15px; }
.l2tp-modal-state p { max-width: 430px; margin: 7px 0 18px; line-height: 1.7; font-size: 11px; }
.l2tp-modal-spinner { width: 31px; height: 31px; border: 3px solid #d4e8f2; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.l2tp-modal-error-mark { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: #cf4b4b; border-radius: 50%; font-size: 20px; font-weight: 800; }

.l2tp-table-toolbar { min-height: 46px; padding: 0 18px; display: flex; align-items: center; gap: 12px; color: #3f4c59; background: #eef1f4; border: 1px solid #d5dce2; border-bottom: 0; font-size: 13px; font-weight: 650; }
.l2tp-table-toolbar small { color: #8b969f; font-size: 10px; font-weight: 500; }
.l2tp-config-table-wrap { width: 100%; overflow-x: auto; background: white; border: 1px solid #d5dce2; -webkit-overflow-scrolling: touch; }
.l2tp-config-table { width: 100%; min-width: 1120px; table-layout: fixed; border-collapse: collapse; }
.l2tp-config-table th { width: auto !important; height: 42px; padding: 0 12px; color: #f5f7f9; background: #697487; border: 0; border-right: 1px solid rgba(255,255,255,.12); text-align: left; font-size: 11px; font-weight: 600; white-space: nowrap; }
.l2tp-config-table th:nth-child(1) { width: 11% !important; }
.l2tp-config-table th:nth-child(2) { width: 16% !important; }
.l2tp-config-table th:nth-child(3) { width: 12% !important; }
.l2tp-config-table th:nth-child(4) { width: 8% !important; }
.l2tp-config-table th:nth-child(5) { width: 10% !important; }
.l2tp-config-table th:nth-child(6) { width: 11% !important; }
.l2tp-config-table th:nth-child(7) { width: 15% !important; }
.l2tp-config-table th:nth-child(8) { width: 9% !important; }
.l2tp-config-table th:nth-child(9) { width: 8% !important; }
.l2tp-config-table td { height: 48px; padding: 8px 12px; overflow: hidden; color: #505c66; background: white; border-bottom: 1px solid #e1e6ea; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; }
.l2tp-config-table tbody tr:nth-child(even) td { background: #fafbfc; }
.l2tp-config-table tbody tr:hover td { background: #eef6fb; }
.l2tp-name-column { color: #2e4553 !important; font-family: Consolas,"Liberation Mono",monospace; font-weight: 700 !important; }
.l2tp-comment-column { max-width: 0; }
.l2tp-password-mask { color: #596875; letter-spacing: .13em; }
.l2tp-enabled-state { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 650; }
.l2tp-enabled-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.l2tp-enabled-state.is-enabled { color: #13a16f; }
.l2tp-enabled-state.is-disabled { color: #8a969d; }
.l2tp-row-edit { padding: 0; color: #1494d2; background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 650; }
.l2tp-row-edit:hover { color: #0878b1; text-decoration: underline; }
.l2tp-table-pagination { min-height: 50px; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #7d8991; background: #f7f9fa; border: 1px solid #d5dce2; border-top: 0; font-size: 10px; }
.l2tp-table-pagination > div { display: flex; align-items: center; gap: 12px; }
.l2tp-table-pagination button { min-height: 30px; padding: 0 11px; color: #4d6472; background: white; border: 1px solid #cad5db; border-radius: 2px; cursor: pointer; font-size: 10px; }
.l2tp-table-pagination button:hover:not(:disabled) { color: #168cc6; border-color: #86bfdc; }
.l2tp-table-pagination button:disabled { color: #adb6bb; background: #f0f2f3; cursor: default; }
.l2tp-edit-toolbar { min-height: 50px; padding: 0 18px; display: flex; align-items: center; gap: 14px; color: #4a5660; background: #eef1f4; border: 1px solid #d5dce2; }
.l2tp-edit-toolbar button { min-height: 30px; padding: 0 10px; color: #188bc2; background: white; border: 1px solid #bfd1da; border-radius: 2px; cursor: pointer; font-size: 10px; }
.l2tp-edit-toolbar > div { display: flex; align-items: baseline; gap: 10px; }
.l2tp-edit-toolbar strong { font-size: 13px; }
.l2tp-edit-toolbar span { color: #86939b; font-family: Consolas,"Liberation Mono",monospace; font-size: 10px; }
.l2tp-edit-panel { background: white; border: 1px solid #d5dce2; border-top: 0; }
.l2tp-edit-panel .l2tp-form-grid { max-width: 820px; margin: 0 auto; padding: 28px 24px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px 24px; }
.l2tp-edit-actions { min-height: 58px; padding: 10px 22px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #f7f9fa; border-top: 1px solid #e0e6ea; }
.l2tp-edit-actions button { min-width: 82px; min-height: 34px; padding: 0 16px; border-radius: 2px; cursor: pointer; font-size: 11px; font-weight: 650; }
.l2tp-edit-cancel { color: #586a75; background: white; border: 1px solid #cbd6dc; }
.l2tp-edit-actions .l2tp-dial-save { color: white; background: #2d95cd; border: 1px solid #2d95cd; }

.loading-row td { height: 72px; }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#edf1f3 25%,#f7f9fa 45%,#edf1f3 65%); background-size: 200% 100%; animation: shimmer 1.1s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { padding: 56px 20px; color: #7f8c94; text-align: center; }
.empty-state strong { color: #52636d; }
.empty-state p { margin: 7px 0 0; font-size: 11px; }
.mobile-account-list { display: none; }
.panel-footer { min-height: 58px; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #87939a; background: #fafbfc; border-top: 1px solid var(--line); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 12px; color: #596a74; }
.pagination button { min-height: 32px; padding: 0 12px; color: #4f6876; background: white; border: 1px solid #d4dee3; border-radius: 3px; cursor: pointer; }
.pagination button:disabled { color: #abb4b9; background: #f4f6f7; cursor: default; }
.panel-privacy { text-align: right; }

.router-fullscreen { position: fixed; inset: 0; z-index: 1000; display: block; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; background: white; }
.router-controls { position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); z-index: 20; }
.router-back-button { min-height: 42px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; color: #226f98; background: rgba(255,255,255,.94); border: 1px solid rgba(175,198,211,.94); border-radius: 3px; box-shadow: 0 4px 14px rgba(31,57,73,.2); backdrop-filter: blur(8px); cursor: pointer; font-weight: 700; }
.router-back-button > span:first-child { font-size: 21px; font-weight: 400; }
.router-frame { position: relative; z-index: 0; width: 100%; height: 100%; min-height: 0; display: block; background: white; border: 0; }
.frame-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: #7d8d96; background: #e9eef2; }
.noscript { margin: 20px; padding: 15px; background: #fff0f0; border: 1px solid #f2c7c7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .admin-shell { padding: 0; }
  .workspace { min-height: 100vh; border-radius: 0; box-shadow: none; }
  .app-header { min-height: auto; padding: 14px; align-items: stretch; flex-direction: column; }
  .title-block h1 { font-size: 18px; }
  .header-actions { align-items: stretch; flex-direction: column; }
  .sync-meta { justify-content: center; }
  .refresh-button { justify-content: center; }
  .breadcrumb { padding: 0 14px; }
  .workspace-body { padding: 10px; }
  .panel-heading { min-height: 70px; padding: 15px; }
  .toolbar { padding: 12px 15px 15px; align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .vpn-quick-info { width: 100%; align-items: flex-start; flex-basis: auto; flex-direction: column; gap: 6px; white-space: normal; }
  .filter-tabs { width: 100%; overflow-x: auto; }
  .filter-tab { min-height: 40px; flex: 1 0 auto; justify-content: center; }
  .table-wrap { display: none; }
  .mobile-account-list { display: grid; gap: 12px; padding: 14px; background: #f4f7f9; }
  .account-card { padding: 16px; background: white; border: 1px solid #dbe3e7; border-left: 3px solid var(--blue); border-radius: 5px; box-shadow: 0 2px 8px rgba(42,67,82,.04); }
  .account-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .account-card-detail { min-height: 38px; padding-top: 10px; display: grid; grid-template-columns: 108px minmax(0,1fr); align-items: center; gap: 12px; border-top: 1px solid #e8edef; font-size: 11px; line-height: 1.55; }
  .account-card-detail + .account-card-detail { margin-top: 10px; }
  .account-card-detail > span { color: #89959c; }
  .account-card-detail strong { min-width: 0; overflow-wrap: anywhere; color: #4a5963; }
  .account-card .comment-view { justify-content: space-between; }
  .account-card .comment-text { white-space: normal; overflow-wrap: anywhere; }
  .account-card .comment-editor { grid-template-columns: minmax(0,1fr); }
  .account-card .comment-actions { justify-content: flex-end; }
  .account-card .router-version-card-value { overflow: hidden; text-align: right; }
  .account-card .l2tp-card-value { overflow: visible; }
  .account-card .l2tp-control { justify-content: flex-end; }
  .account-card .l2tp-edit-button { min-height: 34px; }
  .l2tp-modal { padding: 0; place-items: stretch; }
  .l2tp-modal-panel { width: 100%; max-height: 100vh; max-height: 100dvh; border: 0; border-radius: 0; }
  .l2tp-modal-header { min-height: 82px; padding: max(14px,env(safe-area-inset-top)) 15px 14px; }
  .l2tp-modal-header h2 { font-size: 18px; }
  .l2tp-modal-content { padding: 11px; }
  .l2tp-modal-summary { align-items: flex-start; flex-direction: column; }
  .l2tp-form-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; padding: 12px; }
  .l2tp-form-field.is-wide { grid-column: span 2; }
  .l2tp-dial-actions { align-items: flex-end; flex-direction: column; }
  .l2tp-dial-save { width: 100%; min-height: 42px; }
  .l2tp-modal-header { min-height: 56px; padding: max(10px,env(safe-area-inset-top)) 13px 10px; }
  .l2tp-modal-header h2 { font-size: 15px; }
  .l2tp-table-toolbar { align-items: flex-start; flex-direction: column; gap: 3px; padding: 10px 12px; }
  .l2tp-config-table-wrap { overflow-x: auto; }
  .l2tp-config-table { min-width: 1040px; }
  .l2tp-table-pagination { align-items: flex-start; flex-direction: column; }
  .l2tp-table-pagination > div:last-child { width: 100%; justify-content: space-between; }
  .l2tp-table-pagination button { min-height: 38px; }
  .l2tp-edit-toolbar { padding: 8px 11px; }
  .l2tp-edit-panel .l2tp-form-grid { padding: 16px 12px; grid-template-columns: minmax(0,1fr); }
  .l2tp-form-field.is-wide { grid-column: span 1; }
  .l2tp-edit-actions { justify-content: stretch; padding: 10px 12px; }
  .l2tp-edit-actions button { flex: 1; min-height: 42px; }
  .panel-footer { padding: 13px 15px; align-items: flex-start; flex-direction: column; }
  .pagination { width: 100%; justify-content: space-between; }
  .pagination button { min-height: 44px; padding: 0 16px; }
  .panel-privacy { text-align: left; }
  .router-back-button { min-height: 42px; padding: 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
