:root {
  --ink: #0a1822;
  --navy: #071723;
  --navy-2: #102b3b;
  --paper: #edf4f7;
  --panel: #f8fbfc;
  --line: #cad7dd;
  --muted: #6f8089;
  --blue: #0078d2;
  --blue-soft: #d9ebf8;
  --white: #ffffff;
  --danger: #a83a3a;
  --success: #16795a;
  --font-heavy: "Source Han Sans SC Heavy", "Source Han Sans TC Heavy", "Source Han Sans Heavy", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-light: "Source Han Sans SC Light", "Source Han Sans TC Light", "Source Han Sans Light", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--font-light); }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; background: var(--white); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.console-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.console-nav { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 38px 24px 24px; background: var(--navy); color: rgba(255,255,255,.76); }
.console-brand { display: block; margin-bottom: 68px; text-decoration: none; }
.console-brand img { display: block; width: 148px; height: auto; }
.console-brand span, .login-brand span { display: block; margin-top: 13px; color: rgba(255,255,255,.48); font-family: var(--font-light); font-size: 10px; letter-spacing: .22em; }
.console-nav nav { display: grid; gap: 8px; }
.console-nav nav a { display: grid; grid-template-columns: 30px 1fr; align-items: center; min-height: 48px; padding: 0 12px; border-left: 1px solid transparent; text-decoration: none; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.console-nav nav a:hover { color: var(--white); background: rgba(255,255,255,.045); }
.console-nav nav a[aria-current="page"] { color: var(--white); border-color: var(--blue); background: rgba(0,120,210,.11); }
.nav-index { color: rgba(255,255,255,.35); font-size: 10px; letter-spacing: .08em; }
.console-nav__foot { margin-top: auto; padding: 22px 12px 0; border-top: 1px solid rgba(255,255,255,.12); }
.console-nav__foot > span { display: block; margin-bottom: 10px; color: var(--white); font-family: var(--font-heavy); font-size: 13px; }
.console-nav__foot form { margin: 0; }
.console-nav__foot button { padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.55); cursor: pointer; }
.console-nav__foot button:hover { color: var(--white); }
.console-mobile-header { display: none; }
.console-main { min-width: 0; padding: 56px clamp(28px, 4.2vw, 74px) 84px; }

.message-stack { display: grid; gap: 8px; margin-bottom: 20px; }
.message { padding: 13px 16px; border-left: 3px solid var(--blue); background: var(--white); }
.message--error { border-color: var(--danger); }
.message--success { border-color: var(--success); }
.eyebrow { margin: 0 0 13px; color: var(--muted); font-size: 11px; letter-spacing: .18em; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 42px; }
.page-head h1 { max-width: 760px; margin: 0; font-family: var(--font-heavy); font-size: clamp(34px, 3.15vw, 52px); font-weight: 900; line-height: 1.02; letter-spacing: -.035em; }
.page-head p:last-child { max-width: 650px; margin: 15px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.page-head--detail { align-items: flex-start; }
.back-link { display: inline-block; margin-bottom: 26px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--blue); }
.text-action { padding-bottom: 8px; border-bottom: 1px solid var(--ink); text-decoration: none; white-space: nowrap; }

.range-tabs { display: flex; padding: 3px; border: 1px solid var(--line); background: rgba(255,255,255,.46); }
.range-tabs a { min-width: 54px; padding: 9px 12px; text-align: center; text-decoration: none; font-size: 12px; }
.range-tabs a[aria-current="page"] { background: var(--ink); color: var(--white); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; border: 1px solid var(--line); background: var(--panel); }
.metric-grid article { min-height: 144px; padding: 24px 26px; border-right: 1px solid var(--line); }
.metric-grid article:last-child { border-right: 0; }
.metric-grid span, .metric-grid small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.metric-grid strong { display: block; margin: 13px 0 17px; font-family: var(--font-heavy); font-size: 38px; line-height: 1; }
.metric-grid__signal { position: relative; overflow: hidden; }
.metric-grid__signal::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--blue); content: ""; }

.dashboard-grid { display: grid; gap: 22px; margin-bottom: 22px; }
.dashboard-grid--lead { grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); }
.dashboard-grid--triple { grid-template-columns: repeat(3, 1fr); }
.dashboard-grid--bottom { grid-template-columns: 1.25fr .75fr; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--panel); }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 72px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel > header > div { display: flex; align-items: center; gap: 13px; }
.panel h2 { margin: 0; font-family: var(--font-heavy); font-size: 17px; letter-spacing: -.015em; }
.panel header p, .panel header time { margin: 0; color: var(--muted); font-size: 11px; }
.panel header a { color: var(--muted); font-size: 12px; text-decoration: none; }
.panel header a:hover { color: var(--blue); }
.panel-index { color: var(--blue); font-size: 10px; letter-spacing: .08em; }

.trend-chart { display: flex; align-items: stretch; gap: 3px; height: 250px; padding: 28px 22px 22px; border-bottom: 3px solid var(--blue); }
.trend-bar { position: relative; display: flex; flex: 1; min-width: 2px; flex-direction: column; justify-content: flex-end; }
.trend-bar svg { display: block; width: 100%; height: 192px; overflow: visible; }
.trend-bar rect { fill: var(--navy-2); opacity: .74; transition: fill .18s ease, opacity .18s ease; }
.trend-bar:hover rect { fill: var(--blue); opacity: 1; }
.trend-bar span { min-height: 18px; color: var(--muted); font-size: 9px; text-align: center; }

.country-list, .rank-list { margin: 0; padding: 13px 22px 20px; list-style: none; }
.country-list li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, .8fr) 32px; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.country-list li:last-child, .rank-list li:last-child { border-bottom: 0; }
.country-list li > span { display: flex; align-items: center; gap: 9px; min-width: 0; }
.country-list b { width: 28px; color: var(--blue); font-size: 10px; letter-spacing: .08em; }
.country-list progress { width: 100%; height: 4px; border: 0; background: var(--line); }
.country-list progress::-webkit-progress-bar { background: var(--line); }
.country-list progress::-webkit-progress-value { background: var(--navy-2); }
.country-list progress::-moz-progress-bar { background: var(--navy-2); }
.country-list strong { text-align: right; }
.rank-list li { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.rank-list li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list strong { font-family: var(--font-heavy); }
.empty-state { display: flex; min-height: 178px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 28px 22px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-family: var(--font-heavy); }
.empty-state--large { min-height: 260px; }

.compact-table, .audit-list { padding: 7px 22px 16px; }
.compact-table a { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.compact-table a:last-child { border: 0; }
.compact-table a:hover strong { color: var(--blue); }
.compact-table strong, .compact-table small { display: block; }
.compact-table strong { font-family: var(--font-heavy); font-size: 13px; }
.compact-table small, .compact-table time, .audit-list small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.audit-list > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.audit-list > div:last-child { border: 0; }
.audit-list span, .audit-list small { display: block; }
.audit-list span { font-size: 12px; }

.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #81909a; }
.status-dot--new { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.status-dot--reviewing, .status-dot--waiting { background: #b1842b; }
.status-dot--contacted, .status-dot--nda, .status-dot--evaluating { background: #496f87; }
.status-dot--converted { background: var(--success); }
.status-dot--closed { background: #7e858a; }
.status-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 13px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 11px; }
.status-chip--new { border-color: var(--blue); color: var(--blue); }
.status-chip--converted { border-color: var(--success); color: var(--success); }
.status-chip--waiting { border-color: #b1842b; color: #8a641d; }

.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 220px auto auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.filter-bar label, .action-form label, .action-form > div, .login-form label { display: grid; gap: 7px; }
.filter-bar label > span, .action-form label > span, .action-form > div > label, .login-form label > span { color: var(--muted); font-size: 11px; letter-spacing: .05em; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: var(--white); color: var(--ink); }
input, select { min-height: 43px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; }
.filter-bar button, .action-form button, .login-form button { min-height: 43px; padding: 0 18px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); cursor: pointer; }
.filter-bar > a { min-height: 43px; padding: 13px 8px 0; color: var(--muted); text-decoration: none; }
.data-panel { border: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.data-table { min-width: 920px; }
.data-table__head, .data-table__row { display: grid; grid-template-columns: 130px minmax(230px, 1.2fr) minmax(170px, .8fr) 150px 150px; align-items: center; gap: 18px; padding: 0 22px; }
.data-table__head { min-height: 49px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.data-table__row { min-height: 82px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 12px; }
.data-table__row:last-child { border-bottom: 0; }
.data-table__row:hover { background: var(--white); }
.data-table__row > span:first-child { display: flex; align-items: center; gap: 9px; }
.data-table__row strong, .data-table__row small { display: block; }
.data-table__row strong { font-family: var(--font-heavy); font-size: 13px; }
.data-table__row small, .data-table__row time { margin-top: 4px; color: var(--muted); font-size: 10px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 22px; margin-bottom: 22px; }
.detail-main { padding-bottom: 26px; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 8px 22px 24px; }
.detail-facts div { min-width: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
.detail-facts div:nth-child(odd) { padding-right: 20px; }
.detail-facts div:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
.detail-facts dt, .requirement-copy > span { margin-bottom: 7px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.detail-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.detail-facts small { color: var(--muted); }
.requirement-copy { margin: 0 22px; padding: 22px; background: var(--paper); }
.requirement-copy p { margin: 9px 0 0; font-size: 14px; line-height: 1.8; }
.privacy-record { margin: 18px 22px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.detail-side { display: grid; align-content: start; gap: 22px; }
.action-form { padding-bottom: 20px; }
.action-form > div, .action-form > label { margin: 16px 20px 0; }
.action-form > button { margin: 18px 20px 0; }
.action-form ul.errorlist, .login-form ul.errorlist { margin: 0; padding: 0; color: var(--danger); list-style: none; font-size: 11px; }
.button-danger { border-color: var(--danger) !important; background: transparent !important; color: var(--danger) !important; }
.activity-panel { margin-bottom: 22px; }
.timeline { padding: 8px 22px 20px; }
.timeline article { display: grid; grid-template-columns: 10px 1fr; gap: 13px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.timeline article > span { width: 7px; height: 7px; margin-top: 5px; border: 1px solid var(--blue); border-radius: 50%; }
.timeline strong, .timeline small { display: block; }
.timeline strong { font-size: 12px; font-weight: 400; }
.timeline small { margin-top: 5px; color: var(--muted); font-size: 10px; }

.security-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; }
.security-card { padding-bottom: 24px; }
.security-card > p, .security-steps, .security-list { margin: 22px; }
.security-steps p { color: var(--muted); line-height: 1.65; }
.security-steps code { display: block; padding: 15px; background: var(--navy); color: var(--white); overflow-wrap: anywhere; }
.security-steps details { margin-top: 12px; }
.security-steps details code { margin-top: 10px; font-size: 10px; }
.security-list { padding: 0; list-style: none; }
.security-list li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.security-list li::before { margin-right: 10px; color: var(--blue); content: "—"; }

.login-page { min-height: 100vh; background: var(--navy); color: var(--white); }
.login-stage { display: grid; grid-template-columns: minmax(420px, 600px) 1fr; min-height: 100vh; }
.login-panel { display: flex; flex-direction: column; padding: clamp(36px, 7vw, 92px); border-right: 1px solid rgba(255,255,255,.15); }
.login-brand img { width: 190px; }
.login-copy { margin: auto 0 40px; }
.login-copy .eyebrow { color: rgba(255,255,255,.5); }
.login-copy h1 { max-width: 420px; margin: 0; font-family: var(--font-heavy); font-size: clamp(38px, 4vw, 58px); line-height: 1.02; letter-spacing: -.04em; }
.login-copy p:last-child { max-width: 450px; margin: 18px 0 0; color: rgba(255,255,255,.58); line-height: 1.7; }
.login-form { display: grid; gap: 18px; }
.login-form label > span { color: rgba(255,255,255,.55); }
.login-form label em { font-style: normal; opacity: .7; }
.login-form input { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: var(--white); }
.login-form button { display: flex; align-items: center; justify-content: space-between; background: var(--white); color: var(--navy); font-family: var(--font-heavy); }
.form-error, .login-form small { color: #ffaaaa; font-size: 11px; }
.login-foot { margin: 38px 0 0; color: rgba(255,255,255,.38); font-size: 10px; }
.login-field { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; padding: 70px; overflow: hidden; color: rgba(255,255,255,.22); font-size: clamp(20px, 3vw, 48px); letter-spacing: .04em; }
.login-field::before { position: absolute; inset: 0; border-right: 1px solid rgba(255,255,255,.055); border-left: 1px solid rgba(255,255,255,.055); content: ""; }
.login-field::after { position: absolute; top: 46%; right: 7%; left: 7%; height: 1px; background: var(--blue); box-shadow: 120px -38px 0 -0.35px var(--blue), 260px 27px 0 -0.35px var(--blue); content: ""; transform: rotate(-7deg); }
.login-field span { position: relative; z-index: 1; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article:nth-child(2) { border-right: 0; }
  .metric-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid--lead, .dashboard-grid--bottom { grid-template-columns: 1fr; }
  .dashboard-grid--triple { grid-template-columns: 1fr 1fr; }
  .detail-grid, .security-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .console-shell { display: block; }
  .console-mobile-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 18px; background: var(--navy); color: var(--white); }
  .console-mobile-header button { border: 0; background: transparent; color: inherit; }
  .console-nav { position: fixed; z-index: 30; inset: 0 54px 0 0; width: auto; transform: translateX(-105%); transition: transform .2s ease; }
  .console-nav.is-open { transform: none; }
  .console-main { padding: 34px 18px 60px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
  .page-head h1 { font-size: 36px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article { min-height: 124px; padding: 19px; }
  .metric-grid strong { font-size: 31px; }
  .dashboard-grid--triple { grid-template-columns: 1fr; }
  .trend-chart { height: 220px; padding-right: 12px; padding-left: 12px; }
  .trend-bar svg { height: 165px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar > a { padding-top: 5px; }
  .detail-facts { grid-template-columns: 1fr; }
  .detail-facts div:nth-child(odd), .detail-facts div:nth-child(even) { padding-right: 0; padding-left: 0; border-left: 0; }
  .login-stage { display: block; }
  .login-panel { min-height: 100vh; padding: 34px 24px; border: 0; }
  .login-copy { margin-top: auto; }
  .login-field { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
