:root {
  --ink: #17201d;
  --muted: #66716d;
  --line: #dfe4df;
  --paper: #f3f2ec;
  --panel: #fff;
  --forest: #122520;
  --forest-2: #1c352e;
  --mint: #a9e37d;
  --coral: #fa765f;
  --blue: #6b9df0;
  --shadow: 0 22px 60px rgba(21, 36, 31, .12);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; overflow: hidden; position: relative; background: var(--forest); }
.login-shell::before { content: ""; position: absolute; inset: 0; opacity: .08; background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px); background-size: 48px 48px; }
.login-ambient { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .75; }
.login-ambient-one { width: 460px; height: 460px; left: -120px; bottom: -180px; background: #375f50; }
.login-ambient-two { width: 280px; height: 280px; right: -40px; top: -80px; background: #9bcc73; opacity: .18; }
.login-card { width: min(440px, 100%); position: relative; z-index: 1; border: 1px solid rgba(255,255,255,.18); border-radius: 28px; padding: 46px; color: white; background: rgba(25, 49, 42, .84); box-shadow: 0 34px 100px rgba(0,0,0,.28); backdrop-filter: blur(16px); }
.brand-mark { width: 60px; height: 60px; display: grid; place-items: center; position: relative; border-radius: 18px; color: var(--forest); background: var(--mint); font-size: 21px; font-weight: 900; letter-spacing: -1px; }
.brand-mark i { width: 10px; height: 10px; position: absolute; right: -3px; bottom: 10px; border: 3px solid var(--forest); border-radius: 50%; background: var(--coral); }
.eyebrow { margin: 24px 0 10px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.eyebrow.dark { margin: 0 0 10px; color: #497267; }
.login-card h1 { margin: 0; font-size: clamp(32px, 8vw, 44px); letter-spacing: -.04em; }
.login-copy { margin: 12px 0 30px; color: #b8c8c2; }
.login-form { display: grid; gap: 18px; }
.login-form label { display: grid; gap: 8px; color: #d7e0dc; font-size: 13px; font-weight: 650; }
.login-form input { width: 100%; height: 52px; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; padding: 0 16px; outline: none; color: white; background: rgba(8, 23, 18, .45); transition: .2s; }
.login-form input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(169, 227, 125, .13); }
.form-error { min-height: 18px; margin: -4px 0; color: #ff9f8f; font-size: 13px; }
.primary-button { height: 54px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 13px; padding: 0 20px; color: var(--forest); background: var(--mint); font-weight: 800; transition: .2s; }
.primary-button:hover { transform: translateY(-1px); background: #b8eb92; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.login-meta { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; color: #91a69e; font-size: 12px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #76d69c; box-shadow: 0 0 0 4px rgba(118,214,156,.12); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; color: white; background: var(--forest); overflow: auto; }
.sidebar-brand { min-height: 92px; display: flex; align-items: center; gap: 13px; padding: 22px 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark-small { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px; font-size: 17px; }
.brand-mark-small i { width: 8px; height: 8px; border-width: 2px; }
.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand small { display: block; margin-top: 4px; color: #789088; font-size: 9px; letter-spacing: .14em; }
.site-nav { flex: 1; padding: 14px 12px; }
.site-group { padding: 15px 8px 19px; border-bottom: 1px solid rgba(255,255,255,.07); }
.site-heading { display: flex; align-items: center; gap: 10px; padding: 0 6px 12px; }
.site-heading strong, .site-heading small { display: block; }
.site-heading strong { font-size: 12px; }
.site-heading small { margin-top: 3px; color: #758a83; font-size: 10px; }
.site-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--forest); background: var(--mint); font-size: 11px; font-weight: 900; }
.site-icon.coral { background: var(--coral); }
.site-icon.blue { background: var(--blue); }
.nav-item { width: 100%; height: 38px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 9px; padding: 0 10px 0 44px; color: #91a39d; background: transparent; font-size: 12px; text-align: left; transition: .18s; }
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: var(--forest-2); }
.nav-item b { min-width: 25px; padding: 3px 6px; border-radius: 10px; color: #779087; background: rgba(255,255,255,.06); font-size: 9px; text-align: center; }
.nav-item.active b { color: var(--forest); background: var(--mint); }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account .avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: #28443b; font-size: 12px; }
.account strong, .account small { display: block; }
.account strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.account small { margin-top: 3px; color: #71877f; font-size: 9px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: #3d4d48; background: white; font-size: 18px; }
.icon-button:hover { border-color: #aab8b2; }
.icon-button.light { border-color: rgba(255,255,255,.1); color: #8fa39b; background: rgba(255,255,255,.04); }

.workspace { min-width: 0; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid #e0e1db; background: rgba(243,242,236,.88); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8a928f; font-size: 12px; }
.breadcrumb i { color: #bdc2bf; font-style: normal; }
.breadcrumb strong { color: #2f3b37; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.live-pill { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #d9ded9; border-radius: 18px; color: #52615c; background: rgba(255,255,255,.58); font-size: 11px; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #54b77d; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.content { max-width: 1600px; margin: 0 auto; padding: 42px 42px 28px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-intro h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -.05em; }
.page-intro p:last-child { margin: 15px 0 0; color: var(--muted); font-size: 13px; }
.intro-stamp { display: flex; align-items: baseline; gap: 8px; }
.intro-stamp span { font-size: 40px; font-weight: 800; letter-spacing: -.04em; }
.intro-stamp small { color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0 18px; }
.summary-card { min-height: 112px; display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; border: 1px solid #e0e2dd; border-radius: 16px; padding: 19px; background: rgba(255,255,255,.72); }
.summary-index { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--forest); background: var(--mint); font-size: 11px; font-weight: 900; }
.coral-bg { background: var(--coral); }
.blue-bg { background: var(--blue); }
.summary-card small, .summary-card strong { display: block; }
.summary-card small { color: var(--muted); font-size: 11px; }
.summary-card strong { margin-top: 5px; font-size: 25px; }
.summary-card .trend { margin-left: auto; color: #b8c0bc; font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .12em; }
.data-panel { border: 1px solid #dfe2dc; border-radius: 18px; background: var(--panel); box-shadow: 0 14px 40px rgba(37, 47, 43, .05); overflow: hidden; }
.panel-toolbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #e7e9e4; }
.search-box { width: min(430px, 100%); height: 44px; display: flex; align-items: center; gap: 10px; border: 1px solid #e1e4df; border-radius: 11px; padding: 0 12px; background: #f8f9f6; }
.search-box span { color: #66736e; font-size: 20px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-box kbd { padding: 4px 7px; border: 1px solid #e0e3de; border-radius: 5px; color: #9aa19e; background: white; font-family: inherit; font-size: 9px; }
.secondary-button { height: 42px; display: flex; align-items: center; gap: 8px; border: 1px solid #dce1dc; border-radius: 10px; padding: 0 14px; color: #33443e; background: white; font-size: 11px; font-weight: 700; }
.secondary-button:hover { border-color: #aab7b1; background: #f9faf8; }
.table-wrap { min-height: 380px; position: relative; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { height: 42px; position: sticky; top: 0; z-index: 1; padding: 0 16px; color: #87918d; background: #fafbf8; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-align: left; white-space: nowrap; }
td { max-width: 300px; padding: 15px 16px; border-top: 1px solid #eef0ec; color: #3c4844; vertical-align: middle; }
tbody tr { transition: .15s; }
tbody tr:hover { background: #fafbf8; }
.primary-cell { color: #1f2c27; font-weight: 750; }
.muted-cell { color: #83908b; }
.truncate { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 7px; color: #37574c; background: #e8f3e4; font-size: 9px; font-weight: 800; white-space: nowrap; }
.tag.coral { color: #874032; background: #ffebe7; }
.tag.blue { color: #31588e; background: #eaf1ff; }
.record-link { color: #2f6a58; font-weight: 700; text-decoration: none; }
.record-link:hover { text-decoration: underline; }
.detail-button { width: 28px; height: 28px; border: 1px solid #e0e5df; border-radius: 8px; color: #52605b; background: white; }
.panel-footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-top: 1px solid #e7e9e4; color: #7d8884; font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination button { width: 32px; height: 30px; border: 1px solid #dee2dd; border-radius: 8px; color: #596661; background: white; }
.pagination button:disabled { cursor: default; opacity: .35; }
.loading-state, .empty-state { position: absolute; inset: 43px 0 0; display: grid; place-content: center; place-items: center; color: #7e8985; background: rgba(255,255,255,.92); text-align: center; }
.spinner { width: 30px; height: 30px; border: 3px solid #e1e8e3; border-top-color: #3a6d5c; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state div { font-size: 34px; }
.empty-state strong { margin-top: 8px; color: #44534e; }
.empty-state p { margin: 7px 0 0; font-size: 11px; }
.sync-note { display: flex; align-items: center; gap: 9px; margin: 16px 3px 0; color: #8a918e; font-size: 10px; }

.detail-dialog { width: min(680px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: white; box-shadow: var(--shadow); }
.detail-dialog::backdrop { background: rgba(12, 26, 21, .6); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; padding: 24px 26px 18px; border-bottom: 1px solid #e9ebe7; }
.dialog-head h2 { margin: 0; font-size: 24px; }
.dialog-close { width: 36px; height: 36px; border: 1px solid #e0e4df; border-radius: 10px; color: #4f5c57; background: white; font-size: 22px; }
.detail-content { max-height: 620px; overflow: auto; padding: 6px 26px 28px; }
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid #eef0ec; }
.detail-row dt { color: #89928e; font-size: 11px; }
.detail-row dd { margin: 0; color: #303d38; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-row pre { max-height: 260px; margin: 0; overflow: auto; white-space: pre-wrap; font: 10px/1.6 ui-monospace, Consolas, monospace; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 13px 16px; border-radius: 11px; color: white; background: #243c34; box-shadow: 0 14px 38px rgba(15,34,28,.2); font-size: 12px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 232px minmax(0,1fr); }
  .content { padding: 34px 26px 24px; }
  .topbar { padding: 0 26px; }
  .summary-card { padding: 15px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: 280px; position: fixed; left: 0; z-index: 10; transform: translateX(-105%); transition: .25s; box-shadow: 18px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }
  .breadcrumb span, .breadcrumb i { display: none; }
  .topbar { height: 62px; padding: 0 16px; }
  .live-pill { display: none; }
  .content { padding: 28px 16px 20px; }
  .page-intro { align-items: start; }
  .intro-stamp { display: none; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 82px; }
  .panel-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .toolbar-actions, .secondary-button { width: 100%; }
  .secondary-button { justify-content: center; }
  .login-card { padding: 34px 26px; }
  .detail-row { grid-template-columns: 1fr; gap: 5px; }
}

