:root {
  --ink:#24272b; --muted:#7c8188; --line:#e8e9eb; --surface-solid:#fff; --backdrop:#f4f5f6;
  --accent:#347e6c; --app-accent:var(--accent); --accent-soft:#347e6c12; --field:#f8f9f9; --danger:#a34343;
}
:root[data-theme="dark"] {
  --ink:#eeeff0; --muted:#919499; --line:#ffffff12; --surface-solid:#1d1e20; --backdrop:#151618;
  --accent:#8bc9b4; --accent-soft:#8bc9b412; --field:#232426; --danger:#f0aaaa;
  color-scheme:dark;
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; color:var(--ink); background:var(--ui-page-surface); font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif; -webkit-font-smoothing:antialiased; }
button,input,select { font:inherit; }
button { cursor:pointer; color:inherit; }
button:disabled { opacity:.45; cursor:not-allowed; }
a { color:inherit; text-decoration:none; }
svg { display:block; width:20px; height:20px; flex-shrink:0; }
h1,h2,p { margin:0; }
h1 { font-size:28px; font-weight:620; letter-spacing:-.045em; }
h2 { font-size:17px; font-weight:580; letter-spacing:-.02em; }
.muted { color:var(--muted); font-size:12px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.wordmark { display:flex; align-items:center; gap:10px; font-size:17px; font-weight:600; letter-spacing:-.04em; }
.brand-mark,.auth-symbol,.rail-brand { display:grid; place-items:center; color:var(--accent); }
.brand-mark { width:29px; height:29px; border:1px solid var(--line); border-radius:9px; background:var(--accent-soft); }
.auth-top { display:flex; align-items:center; justify-content:space-between; padding:28px clamp(20px,5vw,64px); }
.auth-page { min-height:100dvh; display:grid; grid-template-rows:auto 1fr auto; background:radial-gradient(ellipse at 50% 40%,var(--accent-soft),transparent 58%),var(--ui-page-surface); }
.auth-layout { display:grid; place-items:center; padding:32px 20px 48px; }
.auth-card { width:min(100%,390px); padding:36px 32px 24px; background:var(--surface-solid); border:1px solid var(--line); border-radius:var(--radius-dialog); box-shadow:0 18px 60px #00000006,0 2px 8px #00000003; }
:root[data-theme="dark"] .auth-card { box-shadow:0 22px 80px #00000022,inset 0 1px 0 #ffffff03; }
.auth-symbol { width:46px; height:46px; border:1px solid var(--line); border-radius:14px; background:var(--accent-soft); margin-bottom:24px; }
.auth-symbol svg { width:29px; height:29px; }
.auth-card h1 { font-size:27px; }
.auth-subtitle { margin:9px 0 28px; color:var(--muted); font-size:13px; }
.account-field { display:block; margin:0 0 18px; min-width:0; }
.account-field > span { display:block; margin:0 4px 9px; font-size:12px; color:var(--muted); font-weight:500; }
.field-box { display:flex; align-items:center; min-width:0; height:46px; border:1px solid var(--line); border-radius:var(--radius-control); overflow:hidden; background:var(--field); transition:border-color .15s,box-shadow .15s; }
.field-box:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.field-box input,.field-box select { background:transparent; color:var(--ink); border:0; outline:none; width:100%; min-width:0; height:100%; padding:0 16px; font-size:13px; }
.field-box select { cursor:pointer; }
.field-box input:focus-visible,.field-box select:focus-visible { outline:none; }
.field-box input::placeholder { color:var(--muted); opacity:.7; }
.field-addon { display:grid; place-items:center; align-self:stretch; width:46px; flex:0 0 46px; background:transparent; border:0; color:var(--muted); position:relative; }
.field-addon::before { content:""; position:absolute; left:0; top:12px; bottom:12px; width:1px; background:var(--line); }
.field-addon:hover { color:var(--ink); }
.field-addon svg { width:17px; height:17px; }
.primary-button,.secondary-button { border-radius:var(--radius-control); padding:12px 22px; min-height:42px; border:1px solid transparent; display:inline-flex; align-items:center; justify-content:center; gap:12px; font-size:13px; font-weight:550; white-space:nowrap; }
.primary-button { color:white; background:var(--accent); box-shadow:0 3px 9px #00000006; }
:root[data-theme="dark"] .primary-button { color:#172a23; }
.primary-button:hover { filter:brightness(.96); }
.secondary-button { background:var(--backdrop); border-color:var(--line); }
.secondary-button:hover { background:var(--accent-soft); }
#loginSubmit { position:relative; width:100%; margin-top:7px; min-height:46px; }
#loginSubmit > span { position:absolute; right:16px; }
#loginSubmit svg { width:17px; height:17px; }
.account-footnote { color:var(--muted); font-size:11px; text-align:center; margin-top:20px; }
.local-preview { margin-top:24px; padding-top:18px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.preview-label { display:inline-flex; align-items:center; gap:6px; color:var(--accent); background:var(--accent-soft); border-radius:999px; padding:5px 9px; font-size:10px; font-weight:500; white-space:nowrap; }
.preview-label::before { content:""; width:4px; height:4px; background:currentColor; border-radius:50%; }
.text-button { display:inline-flex; align-items:center; gap:8px; padding:2px 0; border:0; background:none; font-size:12px; color:var(--muted); }
.text-button:hover { color:var(--accent); }
.text-button svg { width:15px; height:15px; }
.auth-footer { display:flex; justify-content:center; gap:12px; padding:20px; color:var(--muted); font-size:10px; }
.auth-footer span { opacity:.7; padding-left:12px; border-left:1px solid var(--line); }
.header-control-capsule,.admin-tabs { display:inline-flex; align-items:center; width:max-content; max-width:100%; gap:var(--ui-control-gap); padding:var(--ui-capsule-padding); height:var(--ui-capsule-height); border:1px solid var(--line); border-radius:999px; background:var(--capsule-tray); }
.icon-button { display:grid; place-items:center; flex-shrink:0; width:var(--ui-control-height); height:var(--ui-control-height); border:0; background:transparent; border-radius:50%; color:var(--muted); padding:0; }
.icon-button:hover { color:var(--ink); background:var(--accent-soft); }
.icon-button svg { width:var(--ui-icon-size); height:var(--ui-icon-size); }
.admin-tabs .seg-btn { display:flex; align-items:center; justify-content:center; border:0; padding:0 18px; min-height:var(--ui-control-height); border-radius:999px; background:transparent; font-size:var(--ui-label-size); color:var(--muted); }
.admin-tabs .seg-btn.active { background:var(--surface-solid); color:var(--ink); box-shadow:0 1px 5px #00000008; font-weight:600; }
:root[data-theme="dark"] .admin-tabs .seg-btn.active { background:#323337; box-shadow:0 1px 5px #00000025; }
.admin-rail { position:fixed; left:10px; top:22px; width:36px; display:flex; flex-direction:column; align-items:center; gap:15px; }
.rail-brand { width:34px; height:34px; border:1px solid var(--line); background:var(--accent-soft); border-radius:12px; }
.rail-line { width:15px; border-top:1px solid var(--line); }
.rail-current { color:var(--muted); }
.rail-current svg { width:17px; height:17px; }
.admin-header { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.admin-header .header-right { display:flex; align-items:center; gap:10px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:35px 0 28px; }
.eyebrow { display:block; margin-bottom:7px; color:var(--muted); font-size:10px; letter-spacing:.06em; font-weight:450; }
.operator-chip { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); }
.avatar { display:grid; place-items:center; width:35px; height:35px; border-radius:12px; background:var(--accent-soft); color:var(--accent); font-size:13px; font-weight:550; flex-shrink:0; }
.avatar.small { width:27px; height:27px; border-radius:9px; font-size:11px; }
.account-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin-bottom:40px; padding:0 0 27px; border-bottom:1px solid var(--line); }
.account-stats > div { display:flex; flex-direction:column; gap:9px; }
.account-stats strong { font-size:30px; font-weight:500; letter-spacing:-.05em; line-height:1.15; font-variant-numeric:tabular-nums; }
.account-stats span { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:11px; }
.status-dot { width:5px; height:5px; border-radius:50%; background:var(--accent); display:inline-block; }
.list-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; }
.list-toolbar h2 { font-size:13px; }
#listCount { font-weight:400; font-size:11px; color:var(--muted); margin-left:4px; }
.search-field { display:flex; align-items:center; gap:8px; width:190px; padding:9px 12px; border:1px solid var(--line); background:var(--field); border-radius:999px; }
.search-field svg { width:14px; height:14px; color:var(--muted); }
.search-field input { min-width:0; width:100%; background:transparent; border:0; outline:none; font-size:11px; color:var(--ink); }
.search-field:focus-within { border-color:var(--accent); }
.users-surface { border:1px solid var(--line); border-radius:var(--radius-card); overflow:hidden; background:var(--surface-solid); }
.users-table { width:100%; border-collapse:collapse; text-align:left; table-layout:fixed; }
.users-table th { font-weight:450; font-size:10px; color:var(--muted); padding:15px 20px; border-bottom:1px solid var(--line); }
.users-table th:first-child { width:25%; }
.users-table th:nth-child(2) { width:17%; }
.users-table th:nth-child(3) { width:25%; }
.users-table th:nth-child(4) { width:20%; }
.users-table th:last-child { width:13%; }
.users-table td { padding:19px 20px; border-bottom:1px solid var(--line); vertical-align:middle; font-size:12px; }
.users-table tr:last-child td { border-bottom:0; }
.users-table tbody tr { transition:background .15s; }
.users-table tbody tr:hover { background:var(--accent-soft); }
.user-identity { display:flex; align-items:center; gap:11px; min-width:0; }
.user-name { min-width:0; overflow-wrap:anywhere; }
.user-name strong { display:block; font-size:13px; font-weight:550; }
.user-name small { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.user-status { display:inline-flex; align-items:center; gap:6px; font-size:11px; color:var(--muted); }
.user-status.active { color:var(--accent); }
.user-status::before { content:""; display:block; height:5px; width:5px; border-radius:50%; background:currentColor; }
.module-summary { font-size:11px; color:var(--muted); }
.joined-date { font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; }
.manage-button { font-size:11px; color:var(--muted); border:1px solid var(--line); background:transparent; padding:7px 12px; border-radius:999px; }
.manage-button:hover { background:var(--accent-soft); color:var(--accent); border-color:var(--accent); }
.admin-locked { display:inline-flex; align-items:center; gap:5px; color:var(--muted); font-size:10px; }
.admin-locked svg { width:12px; height:12px; }
.empty-state { padding:45px 20px; text-align:center; font-size:12px; color:var(--muted); }
.demo-note { font-size:10px; color:var(--muted); margin-top:17px; }
.module-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; }
.module-card { padding:20px; border:1px solid var(--line); background:var(--surface-solid); border-radius:var(--radius-card); }
.module-card-top { display:flex; align-items:center; gap:11px; margin-bottom:23px; }
.module-card-icon { display:grid; place-items:center; width:30px; height:30px; border-radius:9px; color:var(--accent); background:var(--accent-soft); }
.module-card-icon svg { width:15px; height:15px; }
.module-card h2 { font-size:13px; }
.module-card p { color:var(--muted); font-size:11px; }
.module-card p strong { color:var(--ink); font-size:16px; margin-right:5px; font-weight:500; }
.account-dialog { width:min(520px,calc(100vw - 28px)); max-height:calc(100dvh - 36px); margin:auto; padding:26px; border:1px solid var(--line); background:var(--surface-solid); color:var(--ink); border-radius:var(--radius-dialog); box-shadow:0 30px 100px #0003; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.account-dialog::backdrop { background:#0005; backdrop-filter:blur(7px); }
.dialog-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:26px; }
.dialog-heading h2 { font-size:21px; }
.dialog-heading > button { margin-top:-6px; margin-right:-8px; }
.field-label-row { display:flex!important; align-items:center; justify-content:space-between; gap:12px; }
.field-label-row .text-button { font-size:11px; color:var(--accent); }
.permission-fieldset { border:0; padding:0; margin:24px 0 0; min-width:0; }
.permission-fieldset legend { display:flex; align-items:center; gap:10px; width:100%; padding:0; margin:0 0 13px; font-size:12px; color:var(--muted); }
.permission-fieldset legend span { font-size:10px; margin-left:auto; }
.permission-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.permission-option { display:flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:12px; min-height:38px; padding:8px 9px; cursor:pointer; font-size:11px; }
.permission-option:has(input:checked) { border-color:color-mix(in srgb,var(--accent) 35%,transparent); background:var(--accent-soft); }
.permission-option input { width:13px; height:13px; accent-color:var(--accent); margin:0; flex-shrink:0; }
.dialog-footer { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:26px; }
.form-error { font-size:12px; color:var(--danger); line-height:1.7; margin:12px 3px; }
.field-hint { color:var(--muted); font-size:11px; line-height:1.7; margin:8px 3px 16px; }
.account-status-row { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:23px; margin-bottom:24px; border-bottom:1px solid var(--line); }
.account-status-row strong { font-weight:500; font-size:13px; }
.account-status-row p { margin-top:7px; color:var(--muted); font-size:11px; }
.apple-switch { width:42px; height:25px; padding:3px; border:0; border-radius:999px; background:#8b8b902f; flex-shrink:0; transition:background .18s; }
.apple-switch span { display:block; width:19px; height:19px; background:#fff; border-radius:50%; box-shadow:0 1px 4px #0003; transition:transform .18s; }
.apple-switch[aria-checked="true"] { background:var(--accent); }
.apple-switch[aria-checked="true"] span { transform:translateX(17px); }
.password-details { border-top:1px solid var(--line); margin-top:25px; padding-top:20px; }
.password-details summary { font-size:12px; cursor:pointer; color:var(--muted); }
.password-details form { padding-top:20px; }
.confirm-dialog { max-width:370px; }
.confirm-dialog p { color:var(--muted); font-size:13px; line-height:1.8; margin-top:12px; }
.toast { position:fixed; z-index:10000; left:50%; bottom:28px; transform:translateX(-50%); padding:11px 19px; border-radius:999px; font-size:12px; max-width:calc(100vw - 30px); width:max-content; box-shadow:0 4px 20px #0002; }
.data-error { padding:18px; border:1px solid var(--line); border-radius:var(--radius-card); margin-top:22px; font-size:13px; }
.data-error button { margin-top:16px; }
@media(max-width:700px) {
  .auth-top { padding:18px 20px; }
  .auth-layout { padding:12px 20px 20px; }
  .auth-card { padding:26px 24px 20px; }
  .auth-symbol { width:36px; height:36px; margin-bottom:18px; border-radius:11px; }
  .auth-symbol svg { width:25px; height:25px; }
  .auth-subtitle { margin-bottom:24px; }
  .auth-card .account-footnote { margin-top:16px; }
  .local-preview { margin-top:20px; padding-top:14px; }
  .auth-footer { padding:14px; }

  .admin-rail { display:none; }
  .admin-header .badge-local { display:none; }
  .section-heading { margin:24px 0; }
  h1 { font-size:24px; }
  .account-stats { gap:10px; margin-bottom:27px; }
  .account-stats strong { font-size:27px; }
  .list-toolbar { align-items:center; }
  .search-field { width:145px; }
  .users-table,.users-table tbody { display:block; }
  .users-table thead { display:none; }
  .users-table tbody tr { display:grid; grid-template-columns:1fr auto; padding:17px; gap:14px 10px; border-bottom:1px solid var(--line); }
  .users-table tbody tr:last-child { border:0; }
  .users-table td { display:block; border:0; padding:0; }
  .users-table td:first-child { grid-column:1; grid-row:1; }
  .users-table td:nth-child(2) { grid-column:2; grid-row:1; align-self:center; }
  .users-table td:nth-child(3) { grid-column:1; grid-row:2; margin-left:46px; align-self:center; }
  .users-table td:nth-child(4) { display:none; }
  .users-table td:last-child { grid-column:2; grid-row:2; text-align:right; }
  .module-cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .module-card { padding:15px; }
  .module-card-top { gap:8px; }
  .module-card-icon { width:25px; height:25px; border-radius:8px; }
  .module-card h2 { font-size:12px; }
  .account-dialog { padding:22px; }
  .permission-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; } }

.auth-switch{display:flex;gap:4px;padding:4px;margin:0 0 26px;border:1px solid var(--line);border-radius:999px;background:var(--field)}
.auth-switch button{flex:1;border:0;border-radius:999px;background:transparent;color:var(--muted);padding:10px 14px;font-size:13px}
.auth-switch button.active{background:var(--surface-solid);color:var(--ink);box-shadow:0 2px 8px #00000009}
.registration-note{font-size:12px;line-height:1.8;color:var(--muted);margin-bottom:22px}
.account-field small{font-weight:400;opacity:.7;margin-left:4px}
#registrationSubmit{width:100%;min-height:46px;margin-top:7px}
.registration-success{font-size:12px;line-height:1.7;color:var(--accent);padding:12px 0}
.application-item{padding:20px 0;border-bottom:1px solid var(--line)}
.application-item p{font-size:13px;color:var(--muted);line-height:1.8;margin:6px 0;overflow-wrap:anywhere}
.application-item button{margin-top:10px}
