/* Match the established desktop theme in 界面原型/finance-prototype.html. */
:root {
  --bg: #f5f6f8;
  --ink: #1b293e;
  --muted: #68768a;
  --line: #e1e6ed;
  --blue: #285bd2;
  --light: #eef4ff;
  --amber: #93631d;
  --green: #267862;
  --red: #ba3946;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 "Segoe UI", "Microsoft YaHei", sans-serif; }
header { min-height: 65px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand img { display: block; width: 40px; height: 40px; object-fit: contain; }
.brand strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: .6px; white-space: nowrap; }
.brand small { display: block; font-size: 8px; letter-spacing: .8px; }
#identity { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
#identity button { padding: 5px 9px; font-size: 12px; }
.banner { padding: 8px 24px; background: #fff7e8; color: #866333; border-bottom: 1px solid #ecdcc0; font-size: 12px; }
main { max-width: 1760px; margin: auto; padding: 20px 24px; min-width: 0; }
h1 { font-size: 24px; line-height: 1.35; font-weight: 650; margin: 3px 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 7px; }
h3 { font-size: 14px; font-weight: 600; margin: 14px 0 7px; }
p { margin: 8px 0 14px; }
main > .muted { font-size: 13px; margin: 0 0 16px; }
.muted, small { color: var(--muted); }
.card { background: #fff; padding: 16px; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 14px; min-width: 0; }
.login { max-width: 560px; margin: 7vh auto; padding: 24px; }
.login h1 { margin-bottom: 10px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: #8490a0; margin: 0 0 7px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.actions label { margin: 0; }
nav { display: flex; gap: 18px; align-items: stretch; overflow-x: auto; margin: 0 0 16px; padding: 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
nav button.secondary { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 11px 1px; color: var(--muted); font-size: 13px; }
nav button.secondary:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--blue); }
nav button.secondary.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
nav button.secondary.active:hover:not(:disabled) { border-bottom-color: var(--blue); }
button, .button { font: inherit; display: inline-block; padding: 7px 11px; border: 1px solid var(--blue); border-radius: 6px; background: var(--blue); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; vertical-align: middle; }
button:hover:not(:disabled), .button:hover { background: #204bb3; border-color: #204bb3; color: #fff; }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
button.secondary:hover:not(:disabled) { background: #f0f4fa; border-color: #b6c5dc; color: var(--ink); }
button:focus-visible, .button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #ccd4df; border-radius: 5px; padding: 7px 9px; max-width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #285bd22f; border-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
label { display: block; margin: 12px 0; font-size: 13px; }
label input, label select { margin-left: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.metric { padding: 12px 16px; border-right: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.metric:last-child { border-right: 0; }
.metric strong { display: block; margin-top: 3px; color: var(--ink); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.table-wrap { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; text-align: left; }
th { padding: 7px 8px; background: #f8f9fc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #67758a; font-weight: 500; }
td { padding: 6px 8px; border-bottom: 1px solid #edf0f5; line-height: 1.5; }
tbody tr:hover { background: #fafcff; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td button, td .button { padding: 5px 9px; font-size: 12px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
#message:not(:empty) { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 10px 17px; background: #203149; color: #fff; border-radius: 6px; box-shadow: 0 8px 30px #12294030; z-index: 10; max-width: 85vw; font-size: 13px; }
iframe { display: block; width: 100%; height: calc(100dvh - 240px); min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
details { margin: 14px 0; }
summary { cursor: pointer; color: var(--blue); font-size: 12px; }
summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
details > p, details > pre { margin: 8px 0; }
.scope label { display: inline-flex; align-items: center; margin-right: 18px; gap: 6px; }
.scope input { margin: 0; }
.versions { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #fff7e8; color: var(--amber); font-size: 12px; }
.success { background: #e7f5ec; color: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid label { margin: 0; }
.form-grid label:has(input:not([type="checkbox"])), .form-grid label:has(select) { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
.form-grid label input:not([type="checkbox"]), .form-grid label select { width: 100%; margin: 0; }
.form-grid label:has(input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 7px; }
.form-grid input[type="checkbox"] { margin: 3px 0 0; flex: 0 0 16px; }
code { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: #f8f9fc; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
#setup-secret code { white-space: normal; }
@media (max-width: 700px) {
  header { gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
  .brand img { width: 34px; height: 34px; }
  .brand strong { font-size: 14px; }
  #identity { margin-left: auto; }
  .banner { padding: 8px 14px; }
  main { padding: 16px 14px; }
  h1 { font-size: 22px; }
  nav { gap: 16px; padding: 0 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 12px; }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric strong { font-size: 21px; }
  .card { padding: 14px; }
  .login { margin: 4vh auto; padding: 20px; }
  #login-actions > button { display: block; width: 100%; margin-top: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  iframe { min-height: 500px; }
}
