:root {
  --paper: #eef3f8;
  --surface: #ffffff;
  --navy: #18374d;
  --ink: #20374a;
  --muted: #5f7281;
  --line: #d8e2eb;
  --blue: #2565a6;
  --blue-soft: #eaf2fb;
  --amber: #8a570d;
  --amber-soft: #fff5dc;
  --red: #a6313d;
  --red-soft: #fff0f1;
  --green: #1a7058;
  --green-soft: #e9f5ef;
  --radius: 12px;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--blue); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #85b5ec; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(23px, 3vw, 31px); line-height: 1.35; font-weight: 650; letter-spacing: -.5px; }
h2 { font-size: 18px; font-weight: 650; line-height: 1.45; }
h3 { font-size: 15px; font-weight: 650; line-height: 1.4; }
p { margin-bottom: 14px; }
small, .muted { color: var(--muted); }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; overflow-wrap: anywhere; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 30; padding: 10px 16px; background: white; transform: translateY(-150%); border-radius: 6px; }
.skip-link:focus { transform: none; }
.initial-loading { padding: 60px; text-align: center; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-story { background: var(--navy); color: white; padding: clamp(40px, 7vw, 110px); display: flex; flex-direction: column; justify-content: space-between; min-height: 650px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 600; letter-spacing: .4px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid #8da9bc; display: grid; grid-template-columns: 1fr 1fr; padding: 6px; gap: 3px; border-radius: 7px; }
.brand-mark span { background: #aac8dc; border-radius: 1px; }
.brand-mark span:nth-child(2) { background: #5e91b3; }
.brand-mark span:nth-child(3) { grid-column: 1 / -1; background: #e6f1f8; }
.login-story h1 { font-size: clamp(34px, 4vw, 48px); margin: 42px 0 18px; }
.login-story p { color: #c1d1dc; max-width: 410px; font-size: 16px; }
.binding-demo { margin: 34px 0; display: grid; gap: 10px; max-width: 350px; }
.binding-demo .binding-row { border-color: #456175; background: #234256; padding: 13px 16px; color: #dfeaf1; }
.binding-demo .binding-arrow { color: #95bed9; }
.login-footnote { font-size: 12px; color: #b0c4d3; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box { width: min(100%, 390px); }
.login-box h2 { font-size: 27px; margin-bottom: 10px; }
.login-box .intro { margin-bottom: 32px; }
.login-box .button { width: 100%; margin-top: 6px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #e4ecf4; padding: 4px; border-radius: 9px; margin-bottom: 25px; }
.login-box .auth-switch .button { margin: 0; border-color: transparent; background: transparent; font-size: 13px; color: var(--muted); }
.login-box .auth-switch .button[aria-pressed="true"] { background: var(--surface); color: var(--navy); border-color: var(--line); }
.login-box .auth-switch .button:hover:not(:disabled) { color: var(--navy); background: #f6f9fc; }
.auth-form .field { margin-bottom: 16px; }
.login-boundary { margin-top: 28px; padding: 14px 16px; border-left: 3px solid var(--blue); background: var(--blue-soft); font-size: 12px; color: #375875; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #d9e6ef; padding: 28px 18px; display: flex; flex-direction: column; gap: 30px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 0 9px; font-size: 17px; }
.sidebar .brand-mark { width: 26px; height: 26px; }
.sidebar-role { padding: 0 11px; color: #a8c0d2; font-size: 12px; margin-top: -17px; }
.nav-list { display: grid; gap: 7px; }
.nav-item { border: none; color: #c1d3e1; background: transparent; text-align: left; padding: 12px 14px; border-radius: 8px; display: flex; align-items: center; gap: 11px; }
.nav-item:hover { background: #24485f; color: white; }
.nav-item[aria-current="page"] { background: #365b76; color: white; }
.nav-symbol { width: 21px; text-align: center; color: #a8c6dc; font-size: 18px; }
.sidebar-foot { margin-top: auto; padding: 0 11px; color: #a8c0d2; font-size: 11px; }
.workspace { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 36px; background: white; border-bottom: 1px solid var(--line); gap: 14px; }
.topbar-context { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.topbar-user { display: flex; align-items: center; gap: 14px; }
.topbar-user strong { font-weight: 600; }
.boundary-strip { padding: 12px 36px; background: #e2edf7; border-bottom: 1px solid #c9dcec; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.boundary-strip strong { color: #244d73; }
.boundary-strip span { color: #48667e; }
.content { max-width: 1440px; margin: auto; padding: 32px 36px 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin-bottom: 6px; }
.page-heading p { color: var(--muted); margin: 0; }
.heading-actions { display: flex; gap: 10px; flex-shrink: 0; }
.button { border: 1px solid var(--line); border-radius: 7px; padding: 9px 16px; background: white; color: var(--ink); line-height: 1.5; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.button:hover:not(:disabled) { border-color: #97b2c7; background: #f4f8fc; }
.button.primary { background: var(--blue); color: white; border-color: var(--blue); }
.button.primary:hover:not(:disabled) { background: #1d548d; }
.button.danger { color: var(--red); border-color: #e7bcc1; }
.button.small { padding: 6px 11px; font-size: 12px; }
.button.ghost { border-color: transparent; background: transparent; font-size: 12px; padding: 6px 9px; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; padding: 21px 24px 17px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; }
.panel-body { padding: 24px; }
.two-column { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.task-columns { grid-template-columns: minmax(310px, .8fr) minmax(0, 1.2fr); }
.stack { display: grid; gap: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 19px; }
.field-label { font-weight: 600; font-size: 13px; }
.field-hint { font-size: 11px; color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid #becdd9; border-radius: 6px; padding: 10px 12px; color: var(--ink); background: white; min-height: 43px; }
textarea { min-height: 126px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #8ca9bf; }
input:disabled, select:disabled { background: #f2f5f8; }
.form-error { color: var(--red); padding: 10px 0; font-size: 13px; }
.form-note { font-size: 12px; color: var(--muted); }
.empty { padding: 44px 24px; text-align: center; }
.empty strong { display: block; font-weight: 600; margin-bottom: 7px; }
.empty p { margin: 0; color: var(--muted); font-size: 13px; }
.loading { padding: 36px 24px; color: var(--muted); }
.badge { display: inline-block; border-radius: 5px; padding: 3px 8px; font-size: 11px; line-height: 1.55; font-weight: 600; background: #edf1f5; color: var(--muted); white-space: nowrap; }
.badge.available, .badge.assigned { color: var(--green); background: var(--green-soft); }
.badge.frozen, .badge.reclaim_pending, .badge.submission_unknown { color: var(--amber); background: var(--amber-soft); }
.badge.local_registered { color: var(--blue); background: var(--blue-soft); }
.badge.demo { color: #6d508c; background: #f2ebfb; }
.account-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 18px; }
.account-card { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-heading h3 { margin: 0; font-size: 18px; }
.account-id { color: var(--muted); margin-bottom: 22px; }
.binding-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: #f4f8fc; border: 1px solid #dde8f1; border-radius: 7px; font-size: 12px; }
.binding-row > span { overflow-wrap: anywhere; }
.binding-arrow { color: #6f98b5; font-size: 18px; }
.account-meta { display: flex; justify-content: space-between; margin-top: 15px; font-size: 11px; color: var(--muted); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.account-reason { margin: 15px 0 0; font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 14px 20px; color: var(--muted); background: #f8fafc; font-weight: 500; white-space: nowrap; }
td { padding: 16px 20px; border-top: 1px solid var(--line); vertical-align: top; }
.table-name { display: block; font-size: 13px; font-weight: 600; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); }
.task-list { display: grid; }
.task-card { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.task-card:last-child { border-bottom: 0; }
.task-card h3 { font-size: 16px; margin: 0; }
.task-info { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin: 7px 0 14px; }
.task-prompt { margin: 0 0 15px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: #40586b; max-height: 260px; overflow-y: auto; padding: 12px 14px; background: #f6f9fc; border-radius: 6px; }
.file-list { margin: 0 0 13px; padding: 0; list-style: none; display: grid; gap: 8px; }
.file-list li { display: flex; gap: 10px; align-items: baseline; font-size: 12px; }
.file-list a { overflow-wrap: anywhere; }
.task-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.audit-detail { max-width: 360px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 12px 20px; background: var(--navy); color: white; border-radius: 9px; z-index: 50; box-shadow: 0 8px 24px #15344f26; width: max-content; max-width: min(650px, calc(100% - 32px)); }
.notice.error { background: #85363f; }
.notice[hidden] { display: none; }
dialog { border: 1px solid var(--line); border-radius: 14px; width: min(520px, calc(100% - 32px)); padding: 0; color: var(--ink); max-height: calc(100vh - 48px); }
dialog::backdrop { background: #17374d66; }
.dialog-content { padding: 27px; }
.dialog-content h2 { margin-bottom: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dialog-warning { font-size: 12px; padding: 12px 14px; border-radius: 7px; background: var(--amber-soft); color: var(--amber); margin-bottom: 20px; }
.check-field { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; font-size: 12px; }
.check-field input { width: 17px; min-height: auto; height: 17px; margin: 3px 0 0; }
.browser-runtime { margin-bottom: 24px; }
.browser-runtime-body { padding: 20px 24px; }
.browser-runtime-heading, .browser-session-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.browser-runtime-body p { margin-bottom: 8px; }
.browser-runtime-body p:last-child { margin-bottom: 0; }
.browser-status { color: var(--amber); background: var(--amber-soft); white-space: normal; }
.browser-session { border-top: 1px solid var(--line); padding-top: 19px; margin-top: 20px; }
.browser-session-heading strong { font-size: 13px; font-weight: 600; }
.browser-message { color: var(--muted); font-size: 12px; margin-bottom: 10px; overflow-wrap: anywhere; }
.browser-origin { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.browser-checked { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.browser-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 15px 0 10px; }
.browser-controls .button:first-child { flex-basis: 100%; }
.browser-controls .button { flex-grow: 1; }
.browser-session .form-note { margin-bottom: 0; }
.user-browser-summary { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.user-browser-summary .form-note { flex-basis: 100%; margin-bottom: 0; }
@media (max-width: 520px) {
  .browser-runtime-body { padding: 18px; }
  .browser-controls .button { padding-left: 8px; padding-right: 8px; }
}

@media (min-width: 1500px) { .content { padding-top: 42px; } }
@media (max-width: 1120px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .content { padding: 26px 24px 48px; }
  .topbar, .boundary-strip { padding-left: 24px; padding-right: 24px; }
  .two-column { grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
  .task-columns { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; height: auto; position: static; padding: 17px 18px 12px; gap: 15px; }
  .sidebar .brand { padding: 0; }
  .sidebar-role, .sidebar-foot { display: none; }
  .nav-list { min-width: 0; max-width: 100%; display: flex; overflow-x: auto; gap: 7px; }
  .nav-item { white-space: nowrap; padding: 8px 12px; font-size: 12px; }
  .nav-symbol { font-size: 15px; width: 17px; }
  .two-column { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-story { min-height: auto; padding: 30px; gap: 18px; }
  .login-story h1 { font-size: 30px; margin: 12px 0; }
  .login-story p { font-size: 13px; margin-bottom: 0; }
  .binding-demo, .login-footnote { display: none; }
  .login-main { padding: 38px 25px; }
}
@media (max-width: 520px) {
  .content { padding: 23px 16px 44px; }
  .topbar { padding: 13px 16px; flex-wrap: wrap; }
  .topbar-user { width: 100%; justify-content: space-between; }
  .boundary-strip { padding: 10px 16px; gap: 3px; }
  .boundary-strip span { display: block; width: 100%; }
  .page-heading { align-items: flex-start; gap: 12px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 12px; }
  .page-heading .button { padding: 7px 11px; font-size: 12px; }
  .panel-body, .panel-head, .task-card { padding: 18px; }
  .account-list { grid-template-columns: 1fr; }
  .card-heading h3 { font-size: 17px; }
  .dialog-content { padding: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .nav-item { transition: background .12s ease, border-color .12s ease; }
}




/* 管理员远程登录画面沿用工作台的海军蓝与浅蓝信息层次。 */
.remote-dialog { width: min(1180px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); overflow: auto; }
.remote-content { padding: 22px; min-width: 0; }
.remote-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.remote-heading h2 { margin-bottom: 12px; overflow-wrap: anywhere; }
.remote-heading .button { flex-shrink: 0; }
.remote-boundary { padding: 11px 14px; background: var(--blue-soft); color: var(--navy); border-left: 3px solid var(--blue); font-size: 12px; }
.remote-status { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.remote-status.error { color: var(--red); }
.remote-surface { position: relative; width: 100%; aspect-ratio: 8 / 5; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin: 12px 0; }
.remote-surface:focus-visible, .remote-surface:focus-within { outline: 3px solid #85b5ec; outline-offset: 3px; }
.remote-image { display: none; width: 100%; height: 100%; object-fit: fill; user-select: none; cursor: crosshair; }
.remote-surface.has-frame .remote-image { display: block; }
.remote-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.remote-surface.has-frame .remote-placeholder { display: none; }
.remote-keys { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.remote-input-form { border-top: 1px solid var(--line); padding-top: 16px; }
.remote-text-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.remote-input-row { display: flex; gap: 10px; }
.remote-text { display: block; min-width: 0; flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.remote-input-row .button { flex-shrink: 0; }
.remote-input-form .form-note { margin: 8px 0; }
.remote-feedback { min-height: 1.65em; margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .remote-content { padding: 14px; }
  .remote-heading { gap: 8px; }
  .remote-heading h2 { font-size: 16px; }
  .remote-heading .button { padding: 7px 9px; }
  .remote-input-row { flex-direction: column; }
  .remote-input-row .button { align-self: flex-end; }
}
.remote-dialog [hidden] { display: none; }

/* 真实可编辑焦点供中文输入法使用；临时文字透明且发送后立即清空。 */
.remote-keyboard-capture { position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-width: 0; min-height: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; resize: none; pointer-events: none; font-size: 16px; }
.remote-keyboard-status { margin: 0 0 8px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }