:root {
  --ink: #172d29;
  --muted: #4a655f;
  --paper: #fff;
  --back: #eef3ef;
  --line: #d6e3db;
  --accent: #135360;
  --dark: #112e2a;
  --lime: #def2ae;
  --round: 19px;
  color: var(--ink);
  background: var(--back);
  font: 400 16px/1.52 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei UI", sans-serif;
  accent-color: var(--accent);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button, a, select, input, textarea { -webkit-tap-highlight-color: #13536024; }
:focus-visible { outline: 3px solid #428eb3; outline-offset: 3px; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 1.2rem; line-height: 1.3; }
h3 { font-size: 1.02rem; line-height: 1.35; }
.shell { max-width: 1160px; margin-inline: auto; padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
.topbar { background: var(--dark); color: #fff; padding-top: env(safe-area-inset-top); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 10px; }
.brand { display: flex; gap: 10px; align-items: center; color: #f3faf4; text-decoration: none; white-space: nowrap; font-size: 1.07rem; }
.brand b { font-weight: 800; letter-spacing: -.04em; }
.brand img { border-radius: 10px; }
.year-button { min-height: 42px; padding: 6px 11px; background: #ffffff14; color: #f1f9f3; border: 1px solid #ffffff45; border-radius: 10px; font-size: .875rem; min-width: 0; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk { display: grid; grid-template-columns: 184px minmax(0, 1fr); column-gap: 24px; padding-block: 26px 34px; }
.rail { display: flex; flex-direction: column; align-self: start; padding: 14px 10px; background: #e3ede6; border: 1px solid var(--line); border-radius: var(--round); position: sticky; top: 16px; }
.rail-label { font-size: .875rem; color: var(--muted); font-weight: 650; padding-inline: 10px; margin-bottom: 8px; }
.roles, .rail-actions { display: grid; gap: 5px; }
.rail-link { border: 0; border-radius: 10px; min-height: 44px; padding: 7px 10px; color: var(--ink); background: transparent; text-align: left; font-weight: 650; }
.rail-link:hover { background: #ffffffad; }
.rail-link[aria-pressed="true"] { background: var(--accent); color: #fff; }
.rail-actions { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.offline-state { color: var(--muted); font-size: .875rem; margin: 10px 10px 0; }
main { min-width: 0; }
.hero { padding: clamp(20px, 4vw, 32px); border-radius: 24px; color: #fff; background: var(--accent); margin-bottom: 22px; }
.hero p { color: #e4f3ee; margin-top: 7px; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 19px 0 0; }
.summary div { padding-top: 11px; border-top: 1px solid #ffffff40; min-width: 0; }
.summary dt { color: #f4fbf7; font-size: .875rem; }
.summary dd { margin: 2px 0 0; color: var(--lime); font-size: clamp(1.3rem, 5vw, 1.85rem); font-weight: 750; letter-spacing: -.04em; overflow-wrap: anywhere; }
.section-title { margin-block: 18px 10px; }
.tile-grid, .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; align-items: stretch; }
.tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; min-height: 96px; text-align: left; padding: 15px; border: 1px solid var(--line); border-radius: var(--round); background: var(--paper); box-shadow: 0 2px 3px #142b1d06; }
.tile strong { font-size: 1rem; color: var(--accent); line-height: 1.37; }
.tile span { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.tile:hover { border-color: var(--accent); }
.terminal, .panel { display: grid; align-content: start; gap: 10px; padding: 17px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--round); min-width: 0; }
.cards > .panel { margin-bottom: 0; }
.page-title { display: grid; gap: 7px; margin-bottom: 16px; }
.page-title p, .muted { color: var(--muted); }
.page-title button { justify-self: start; margin-bottom: 3px; }
.badge { display: inline-block; color: #254737; background: #e2efdf; border-radius: 7px; padding: 2px 7px; font-size: .8rem; font-weight: 700; }
.panel-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.metrics { margin: 0; display: grid; }
.metrics div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(75px, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid #e9efeb; }
.metrics div:last-child { border-bottom: 0; }
.metrics dt { color: var(--muted); font-size: .875rem; align-self: center; }
.metrics dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.control { border: 1px solid var(--line); background: #f4f8f4; color: var(--accent); min-height: 44px; padding: 7px 12px; border-radius: 10px; line-height: 1.3; font-weight: 680; }
.control:hover { border-color: var(--accent); }
.control.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.clock { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; padding: 10px 12px; margin-bottom: 12px; min-height: 44px; background: #def0df; border: 1px solid #bfdcc2; border-radius: 12px; color: #234837; }
.clock b { font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field, fieldset { display: grid; gap: 5px; min-width: 0; margin: 0; }
.field label, legend { font-size: .875rem; color: var(--muted); font-weight: 650; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 44px; background: #f6f9f6; border: 1px solid #b9cec3; border-radius: 9px; padding: 8px 9px; font-size: 1rem; }
input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; }
select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #4a655f 50%), linear-gradient(135deg, #4a655f 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; min-height: 80px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.choice { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: .94rem; }
.full { grid-column: 1 / -1; }
.form-error { color: #862d24; font-size: .92rem; }
dialog { width: min(600px, calc(100vw - 20px)); max-height: calc(100% - 38px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--paper); color: var(--ink); overscroll-behavior: contain; box-shadow: 0 14px 50px #152a2350; }
dialog::backdrop { background: #172d2978; }
.dialog-header { position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.icon-button { min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: #eef3ef; font-size: 1.5rem; line-height: 1; }
#dialog-content { display: grid; padding: 16px; gap: 11px; }
#dialog-content form { display: grid; gap: 13px; }
.list-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); background: #f6f9f6; border-radius: 11px; padding: 11px; min-height: 44px; text-align: left; width: 100%; }
.list-option[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.notice { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff; width: max-content; max-width: calc(100vw - 24px); border-radius: 11px; padding: 9px 15px; z-index: 4; box-shadow: 0 5px 20px #172d293c; }
.mobile-nav { display: none; }
.compact { font-size: .875rem; }
@media (max-width: 680px) {
  .shell { padding-inline: max(13px, env(safe-area-inset-left)) max(13px, env(safe-area-inset-right)); }
  .topbar-inner { min-height: 61px; }
  .brand { font-size: .95rem; gap: 7px; }
  .brand img { width: 34px; height: 34px; }
  .desk { display: block; padding-block: 12px calc(82px + env(safe-area-inset-bottom)); }
  .rail { display: none; }
  .tile { min-height: 110px; padding: 11px; border-radius: 15px; }
  .tile-grid, .cards { gap: 8px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .hero { margin-bottom: 15px; }
  .panel, .terminal { padding: 13px; }
  .mobile-nav { position: fixed; z-index: 3; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 7px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); background: #fbfdfb; border-top: 1px solid var(--line); }
  .mobile-nav button { background: #edf4ef; border: 0; border-radius: 9px; min-height: 44px; padding: 3px; font-size: .875rem; font-weight: 700; }
  .mobile-nav button[aria-current] { background: var(--accent); color: #fff; }
  .notice { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .offline-state { margin: 8px 0 0; }
}
@media (max-width: 340px) {
  .tile-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
}
