:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #1d2b35;
  background: #f6f7f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (pointer: coarse) {
  html { overscroll-behavior-y: contain; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #e8ad55; outline-offset: 2px; }
input, select { width: 100%; min-height: 44px; border: 1px solid #dce3df; border-radius: 10px; padding: 0 13px; background: #fff; color: #23323b; transition: border-color .18s, box-shadow .18s; }
input:hover, select:hover { border-color: #b8c7bd; }
input:focus, select:focus { border-color: #477c5d; box-shadow: 0 0 0 3px #477c5d20; outline: none; }
input::placeholder { color: #9ba8a2; }
label { font-size: 13px; font-weight: 680; color: #43534d; }
h1, h2, h3, p { margin-top: 0; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-size: 13px; font-weight: 720; white-space: nowrap; transition: transform .15s, background .15s, border-color .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { color: #fff; background: #2d654b; border-color: #2d654b; }
.button-primary:not(:disabled):hover { background: #21563d; border-color: #21563d; }
.button-outline { background: #fff; border-color: #d9e1dc; color: #385348; }
.button-outline:not(:disabled):hover { background: #f2f7f3; border-color: #91ab9a; }
.button-quiet { background: transparent; color: #607169; padding: 0 10px; }
.button-quiet:hover { background: #edf2ee; color: #244d38; }
.button-full { width: 100%; }
.button-small { min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 12px; }
.muted { color: #7c8b83; }
.eyebrow { margin-bottom: 9px; color: #ad7d42; font-size: 11px; font-weight: 800; letter-spacing: .22em; }
.form-error { padding: 10px 12px; border-radius: 8px; color: #9c3934; background: #fff0ed; font-size: 12px; line-height: 1.5; }
.feedback { color: #75847c; font-size: 13px; }
.feedback.is-error { color: #9c3934; }
.toast { position: fixed; z-index: 10; bottom: 26px; left: 50%; transform: translateX(-50%); max-width: min(90vw, 450px); padding: 12px 18px; border-radius: 11px; background: #193e2c; color: #fff; font-size: 13px; box-shadow: 0 14px 32px #0d261e3b; }
.toast.is-error { background: #9c3934; }

.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 16px; color: #fff; background: #df974e; font-size: 31px; font-weight: 800; box-shadow: 0 10px 24px #ae69373d; }
.brand-mark-small { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; box-shadow: none; }
.login-layout { display: grid; grid-template-columns: minmax(380px, 1.1fr) minmax(360px, .9fr); min-height: 100vh; background: #f8f8f5; }
.login-intro { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 72px clamp(38px, 8vw, 136px); background: radial-gradient(circle at 85% 10%, #315a45 0%, transparent 39%), linear-gradient(135deg, #173b2b, #284e37 55%, #143324); color: #fff; }
.login-intro .eyebrow { margin-top: 35px; color: #dbbb85; }
.login-intro h1 { margin: 15px 0 23px; font-size: clamp(33px, 3.65vw, 60px); line-height: 1.24; font-weight: 780; letter-spacing: -.035em; }
.login-intro-copy { max-width: 430px; color: #c5d9c9; font-size: 15px; line-height: 1.9; }
.intro-steps { display: flex; align-items: center; gap: 13px; margin-top: 74px; color: #b0cbb9; font-size: 11px; letter-spacing: .07em; }
.step-line { width: 25px; height: 1px; background: #799a82; }
.login-card { display: flex; flex-direction: column; justify-content: center; width: min(100%, 490px); margin: auto; padding: 50px; }
.card-kicker { display: flex; align-items: center; gap: 8px; color: #597361; font-size: 12px; font-weight: 680; }
.status-dot, .online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #58ad79; box-shadow: 0 0 0 3px #58ad7926; }
.login-card h2 { margin: 30px 0 7px; font-size: 31px; letter-spacing: -.035em; }
.login-card .muted { margin-bottom: 36px; font-size: 14px; }
#login-form { display: grid; gap: 12px; }
#login-form label:not(:first-child) { margin-top: 10px; }
#login-submit { margin-top: 14px; min-height: 49px; }
.login-footnote { margin: 24px 0 0; color: #9aa7a0; font-size: 12px; }

.app-shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 29px 15px 22px; background: #173b2b; color: #e7f1e9; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin: 0 9px 49px; }
.sidebar-brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.sidebar-brand small { display: block; margin-top: 3px; color: #91b39a; font-size: 10px; letter-spacing: .1em; }
.nav-list { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; height: 44px; padding: 0 15px; border: none; border-radius: 10px; background: transparent; color: #b8d0bf; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item:hover { background: #ffffff15; color: #fff; }
.nav-item.is-active { background: #e8f0e8; color: #26553a; }
.nav-icon { width: 19px; text-align: center; font-size: 19px; line-height: 1; }
.sidebar-bottom { display: flex; align-items: center; gap: 10px; margin: auto 12px 0; color: #96b6a0; font-size: 11px; }
.app-main { min-width: 0; }
.topbar { display: flex; justify-content: flex-end; align-items: center; height: 72px; padding: 0 clamp(23px, 4.5vw, 72px); border-bottom: 1px solid #e8ede8; background: #fff; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.role-badge { padding: 5px 9px; border-radius: 7px; background: #e9f1e9; color: #4b7458; font-size: 11px; font-weight: 750; }
.current-user { color: #33473b; font-size: 13px; font-weight: 700; }
.mobile-brand, .mobile-nav { display: none; }
.content-section { max-width: 1500px; margin: 0 auto; padding: 40px clamp(23px, 4.5vw, 72px) 75px; }
.pull-refresh-indicator { margin: -18px 0 18px; padding: 9px; border-radius: 8px; background: #e8f1e9; color: #326248; font-size: 12px; font-weight: 700; text-align: center; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 7px; color: #23352a; font-size: clamp(27px, 2.6vw, 36px); letter-spacing: -.05em; }
.page-subtitle { margin: 0; color: #7c8b82; font-size: 13px; line-height: 1.65; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.stat-card { min-height: 126px; padding: 20px 23px; border: 1px solid #ebefea; border-radius: 14px; background: #fff; box-shadow: 0 6px 20px #233e2707; }
.stat-card span, .stat-card small { display: block; color: #869389; font-size: 12px; }
.stat-card strong { display: block; margin: 10px 0 4px; color: #2c5a3d; font-size: 30px; line-height: 1; font-weight: 780; }
.stat-card small { font-size: 11px; }
.filter-panel { display: flex; align-items: flex-end; gap: 13px; flex-wrap: wrap; padding: 20px; border: 1px solid #e8ede7; border-radius: 14px; background: #fff; }
.field { display: grid; gap: 8px; min-width: 155px; flex: 1; }
.field-search { flex: 2; min-width: 250px; }
.filter-actions { display: flex; gap: 8px; }
#code-feedback { min-height: 41px; padding: 15px 2px 9px; }
.station-groups { display: grid; gap: 15px; }
.station-card { overflow: hidden; border: 1px solid #e5ebe5; border-radius: 13px; background: #fff; box-shadow: 0 5px 18px #23432b07; }
.station-header { display: flex; align-items: center; width: 100%; min-height: 65px; padding: 13px 20px; border: none; background: #fff; color: #263a2c; text-align: left; }
.station-header:hover { background: #f9fbf8; }
.station-chevron { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 12px; border-radius: 6px; background: #eaf2eb; color: #477457; font-size: 15px; transition: transform .18s; }
.station-card.is-collapsed .station-chevron { transform: rotate(-90deg); }
.station-title { display: block; min-width: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 750; }
.station-count { margin-left: auto; padding-left: 12px; color: #8b9a8e; font-size: 12px; white-space: nowrap; }
.station-body { border-top: 1px solid #edf1ec; }
.record-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.record-table th { padding: 12px 14px; color: #93a097; background: #fbfcfa; font-size: 11px; font-weight: 680; text-align: left; }
.record-table td { padding: 15px 14px; border-top: 1px solid #f0f3ef; color: #506059; font-size: 12px; line-height: 1.55; vertical-align: middle; overflow-wrap: anywhere; }
.record-table tr:first-child td { border-top: none; }
.record-table th:first-child, .record-table td:first-child { padding-left: 20px; width: 24%; }
.record-table th:nth-child(2), .record-table td:nth-child(2) { width: 19%; }
.record-table th:nth-child(3), .record-table td:nth-child(3) { width: 30%; }
.record-table th:last-child, .record-table td:last-child { width: 27%; padding-right: 20px; text-align: right; }
.code-value { color: #1c4c35; font-size: 17px; font-weight: 800; letter-spacing: .025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code-value.is-invalidated { color: #9aa49d; text-decoration: line-through; text-decoration-thickness: 1px; }
.record-table tr.is-invalidated { background: #fafbf9; }
.record-company { display: block; color: #314639; font-size: 12px; font-weight: 680; }
.record-subtext { display: block; color: #95a099; font-size: 11px; }
.status-pill { display: inline-block; padding: 5px 8px; border-radius: 7px; background: #e7f4e9; color: #46845a; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill.is-done { background: #f1f2f0; color: #8b948c; }
.status-pill.is-invalidated { background: #f5e9e6; color: #9a6258; }
.invalidated-note { color: #9b948e; font-size: 11px; }
.copy-button { border: none; background: #eef5ee; color: #356847; min-height: 30px; padding: 0 10px; border-radius: 7px; font-size: 11px; font-weight: 720; }
.copy-button:hover { background: #e0ede1; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.status-action { min-height: 30px; padding: 4px 8px; border: 1px solid #3d7653; border-radius: 7px; background: #3d7653; color: #fff; font-size: 11px; font-weight: 720; line-height: 1.3; }
.status-action:not(:disabled):hover { background: #2a6241; }
.status-action.is-revert { border-color: #dce6dc; background: #fff; color: #456a4f; }
.status-action.is-revert:not(:disabled):hover { background: #f0f6f0; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 67px; color: #89958c; font-size: 12px; }
.pagination > div { display: flex; gap: 9px; }
.empty-state { padding: 43px 25px; border: 1px dashed #d6e0d6; border-radius: 13px; background: #fff; color: #8a978d; font-size: 13px; text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: #496653; font-size: 15px; }

.two-column { display: grid; grid-template-columns: minmax(290px, 370px) minmax(0, 1fr); align-items: start; gap: 18px; }
.surface-card { padding: 24px; border: 1px solid #e8ede7; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px #23432b07; }
.surface-heading { display: flex; gap: 13px; margin-bottom: 25px; }
.surface-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: #edf5ed; color: #3d7151; font-size: 21px; line-height: 1; }
.surface-heading h2 { margin: 0 0 4px; font-size: 17px; }
.surface-heading p { margin: 0; color: #94a097; font-size: 11px; line-height: 1.6; }
.stack-form { display: grid; gap: 8px; }
.stack-form label { margin-top: 8px; }
.stack-form > div { display: grid; gap: 8px; }
.stack-form .button { margin-top: 13px; }
.optional { color: #9aa69c; font-weight: 400; }
.form-note { margin: 7px 0 0; color: #829284; font-size: 11px; line-height: 1.7; }
.account-list { display: grid; }
.account-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid #eef2ed; }
.account-row:first-child { border-top: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 37px; height: 37px; border-radius: 10px; background: #e5eee5; color: #477054; font-size: 15px; font-weight: 800; }
.account-detail { min-width: 0; flex: 1; }
.account-detail strong { display: block; color: #344b39; font-size: 13px; overflow-wrap: anywhere; }
.account-detail small { display: block; margin-top: 3px; color: #91a096; font-size: 11px; overflow-wrap: anywhere; }
.account-action { display: flex; align-items: center; gap: 7px; flex: none; }
.account-action select { min-height: 34px; width: min(170px, 18vw); padding: 0 8px; font-size: 11px; }
.account-action .button { min-height: 34px; padding: 0 11px; }
.reassign-form { display: grid; gap: 9px; margin: 0 0 14px 49px; padding: 15px; border: 1px solid #dce9de; border-radius: 10px; background: #f8fbf8; }
.reassign-form strong { color: #31533a; font-size: 12px; }
.reassign-form label { margin-top: 3px; }
.reassign-form .button { justify-self: start; margin-top: 4px; }
.reassign-note { margin: 0; color: #708776; font-size: 11px; line-height: 1.7; }
.shortcut-key-panel { display: grid; gap: 8px; margin-top: 9px; padding: 16px; border: 1px solid #dbe7df; border-radius: 10px; background: #fff; }
.shortcut-key-panel > strong { color: #31533a; font-size: 13px; }
.shortcut-key-note { margin: 0; color: #708776; font-size: 11px; line-height: 1.7; }
.shortcut-key-status { margin: 1px 0; color: #38624a; font-size: 12px; font-weight: 700; }
.shortcut-key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shortcut-key-warning { margin: 15px 0; padding: 12px; border-radius: 8px; background: #fff5e8; color: #75512a; font-size: 12px; line-height: 1.7; }
.shortcut-key-value { display: block; padding: 13px; border: 1px solid #dbe7df; border-radius: 8px; background: #f8fbf8; color: #234d34; font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.shortcut-key-expiry { margin: 10px 0 16px; color: #708776; font-size: 12px; }
.reassign-form .checkbox-line { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.reassign-form .checkbox-line input { width: 17px; min-height: 17px; accent-color: #2d654b; }
.account-status { align-self: center; padding: 5px 8px; border-radius: 7px; background: #e7f4e9; color: #46845a; font-size: 11px; font-weight: 700; white-space: nowrap; }
.account-status.is-inactive { background: #f2f2f0; color: #959b93; }
.admin-edit-form { display: grid; gap: 9px; margin: 0 0 14px 49px; padding: 15px; border: 1px solid #dce9de; border-radius: 10px; background: #f8fbf8; }
.admin-edit-form strong { color: #31533a; font-size: 12px; }
.admin-edit-form .button { justify-self: start; margin-top: 4px; }
.admin-edit-form .checkbox-line { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.admin-edit-form .checkbox-line input { width: 17px; min-height: 17px; accent-color: #2d654b; }
.admin-edit-note { margin: 0; color: #708776; font-size: 11px; line-height: 1.7; }
.modal { width: min(92vw, 430px); padding: 27px; border: 1px solid #e3ebe2; border-radius: 15px; box-shadow: 0 25px 80px #18372b35; }
.modal::backdrop { background: #0f261b99; }
.modal-heading { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.modal-heading h2 { margin: 0; font-size: 21px; }
.modal-close { width: 31px; height: 31px; border: none; border-radius: 7px; background: #f0f3ef; color: #64766a; font-size: 20px; line-height: 1; }
.modal-note { margin: 0 0 7px; color: #829185; font-size: 12px; line-height: 1.6; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 193px minmax(0, 1fr); }
  .sidebar-brand strong { font-size: 13px; }
  .two-column { grid-template-columns: minmax(245px, 320px) minmax(0, 1fr); }
  .record-table th:first-child, .record-table td:first-child { width: 22%; }
  .record-table th:nth-child(2), .record-table td:nth-child(2) { width: 18%; }
  .record-table th:nth-child(3), .record-table td:nth-child(3) { width: 30%; }
  .record-table th:last-child, .record-table td:last-child { width: 30%; }
}
@media (max-width: 770px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 260px; padding: 32px 28px; }
  .login-intro .eyebrow { display: none; }
  .login-intro h1 { margin: 17px 0 10px; font-size: 30px; }
  .login-intro-copy { margin-bottom: 0; font-size: 12px; }
  .intro-steps { display: none; }
  .login-card { padding: 38px 28px 50px; }
  .sidebar { display: none; }
  .app-shell { display: block; }
  .topbar { justify-content: space-between; padding: 0 18px; height: 62px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; }
  .mobile-brand .brand-mark { width: 30px; height: 30px; font-size: 17px; }
  .topbar-right { gap: 7px; }
  .topbar-right .button { min-height: 35px; padding: 0 6px; font-size: 11px; }
  .current-user { display: none; }
  .mobile-nav { display: flex; gap: 4px; padding: 7px 17px; border-bottom: 1px solid #e8ede8; background: #fff; }
  .mobile-nav-item { padding: 10px 12px; border: none; border-radius: 8px; background: transparent; color: #7b8c7e; font-size: 12px; font-weight: 700; }
  .mobile-nav-item.is-active { background: #e8f1e9; color: #326248; }
  .content-section { padding: 27px 17px 55px; }
  .two-column { grid-template-columns: 1fr; }
  .filter-panel { padding: 15px; }
  .field-search { flex-basis: 100%; }
  .record-table th:first-child, .record-table td:first-child { width: 27%; }
  .record-table th:nth-child(2), .record-table td:nth-child(2) { width: 20%; }
  .record-table th:nth-child(3), .record-table td:nth-child(3) { width: 27%; }
  .record-table th:last-child, .record-table td:last-child { width: 26%; }
}
@media (max-width: 520px) {
  .page-heading { align-items: flex-start; }
  .page-heading .button { padding: 0 10px; font-size: 11px; }
  .page-subtitle { font-size: 12px; }
  .stat-grid { gap: 8px; }
  .stat-card { min-height: 105px; padding: 14px 12px; }
  .stat-card strong { font-size: 24px; }
  .stat-card span, .stat-card small { font-size: 10px; }
  .field { min-width: 100%; }
  .filter-actions { width: 100%; }
  .filter-actions .button { flex: 1; }
  .station-header { padding: 11px 13px; }
  .station-title { font-size: 13px; }
  .record-table th, .record-table td { padding: 11px 7px; font-size: 10px; }
  .record-table th:first-child, .record-table td:first-child { padding-left: 12px; width: 27%; }
  .record-table th:nth-child(2), .record-table td:nth-child(2) { width: 19%; }
  .record-table th:nth-child(3), .record-table td:nth-child(3) { width: 26%; }
  .record-table th:last-child, .record-table td:last-child { padding-right: 12px; width: 28%; }
  .code-value { font-size: 13px; white-space: normal; }
  .record-company { font-size: 10px; }
  .copy-button { min-height: 28px; padding: 0 6px; }
  .status-action { min-height: 28px; padding: 3px 5px; font-size: 10px; }
  .status-pill { padding: 4px 5px; font-size: 10px; }
  .account-row { flex-wrap: wrap; }
  .account-action { flex: 1 0 100%; padding-left: 49px; }
  .account-action select { width: min(100%, 190px); }
}
