:root {
  --ink: #18212f;
  --muted: #748096;
  --line: #e6eaf0;
  --panel: #ffffff;
  --canvas: #f4f7fb;
  --navy: #17263d;
  --blue: #3d75ff;
  --blue-soft: #edf3ff;
  --red: #ef5b64;
  --red-soft: #fff0f1;
  --amber: #e4a125;
  --amber-soft: #fff7e5;
  --green: #28a879;
  --green-soft: #eaf9f3;
  --purple: #8a68df;
  --shadow: 0 16px 40px rgba(38, 59, 92, .07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { height: 74px; padding: 0 42px; background: var(--navy); display: flex; align-items: center; justify-content: space-between; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #6e95ff, #4a68d5); font-weight: 800; font-size: 17px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.brand-name { font-weight: 750; letter-spacing: .3px; }
.brand-sub { color: #a8b6cd; font-size: 11px; margin-top: 3px; }
.topbar-right { display: flex; gap: 18px; align-items: center; color: #b8c5d8; font-size: 12px; }
.data-chip { color: #dff8ed; background: rgba(45, 178, 133, .13); border: 1px solid rgba(105, 223, 177, .2); padding: 7px 11px; border-radius: 99px; }
.data-chip.pending { color: #ffe9b2; background: rgba(228, 161, 37, .14); border-color: rgba(243, 192, 79, .3); }
.data-chip.pending .live-dot { background: #f0bb47; box-shadow: 0 0 0 3px rgba(240,187,71,.15); }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #4ed5a0; box-shadow: 0 0 0 3px rgba(78,213,160,.15); }
.main-content { max-width: 1500px; padding: 36px 42px 54px; margin: auto; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 11px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: 1.4px; }
h1 { font-size: clamp(27px, 3vw, 40px); letter-spacing: -1.5px; margin: 0 0 12px; line-height: 1.15; }
.hero-copy { margin: 0; color: var(--muted); font-size: 14px; }
.hero-note { width: min(500px, 100%); padding: 16px 18px; border-radius: 14px; border: 1px solid #f0dfb3; background: #fffaf0; }
.note-label { color: #a87914; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.note-text { color: #816728; font-size: 12px; line-height: 1.6; }
.standard-list { display: grid; gap: 7px; margin-top: 9px; }
.standard-item { display: grid; grid-template-columns: 42px 1fr; gap: 8px; align-items: start; color: #816728; font-size: 11px; line-height: 1.45; }
.standard-level { display: inline-flex; justify-content: center; padding: 3px 5px; border-radius: 5px; background: #fff0c9; color: #a87914; font-size: 10px; font-weight: 800; }
.standard-footnote { margin-top: 9px; padding-top: 8px; border-top: 1px solid #f2e2bd; color: #9a741e; font-weight: 700; font-size: 11px; }
.view-switch { display: inline-flex; gap: 4px; padding: 5px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; background: #edf1f6; }
.view-tab { border: 0; border-radius: 8px; background: transparent; color: #768398; padding: 9px 15px; font-size: 12px; font-weight: 750; }
.view-tab span { margin-left: 5px; font-size: 10px; color: #9aa5b7; }
.view-tab em { font-style: normal; color: #9a78db; font-size: 9px; margin-left: 6px; }
.view-tab.active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(38,59,92,.09); }
.view-tab.active span { color: var(--blue); }
.period-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 165px auto 165px auto; gap: 13px; align-items: center; padding: 12px 16px; margin-bottom: 18px; }
.period-title { display: flex; align-items: center; gap: 9px; }
.calendar-badge { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 16px; }
.period-title strong { display: block; font-size: 12px; }
.period-title div span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.period-field { display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.period-field input, .period-field select { width: 100%; height: 34px; }
.period-separator { color: #a1acbc; font-size: 12px; text-align: center; }
.period-current { padding: 9px 12px; border-radius: 8px; background: #f7f9fc; color: #627086; font-size: 11px; white-space: nowrap; text-align: center; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric-card { padding: 20px 21px; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); border: 1px solid rgba(230,234,240,.8); position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -20px; bottom: -25px; width: 92px; height: 92px; border-radius: 50%; background: var(--tone, var(--blue)); opacity: .06; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin: 9px 0 4px; }
.metric-foot { font-size: 11px; color: var(--muted); }
.metric-accent { color: var(--tone, var(--blue)); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(350px, .9fr); gap: 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid rgba(230,234,240,.85); border-radius: 17px; box-shadow: var(--shadow); }
.list-panel { min-width: 0; overflow: hidden; }
.panel-head { padding: 22px 23px 15px; display: flex; align-items: center; justify-content: space-between; }
h2 { margin: 0; font-size: 16px; letter-spacing: -.2px; }
.panel-head p, .rules-title p { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
.ghost-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 8px 5px; }
.ghost-button:hover { color: var(--blue); }
.filters { display: grid; grid-template-columns: 1fr 150px 130px; gap: 10px; padding: 0 23px 16px; }
.search-box { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; color: #a4aec0; }
.search-box input { border: 0; outline: 0; min-width: 0; width: 100%; height: 36px; color: var(--ink); background: transparent; font-size: 12px; }
select { height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; color: #5e6b80; background: #fff; outline: none; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 780px; }
thead { background: #f8fafc; }
th { color: #8a94a6; font-size: 11px; font-weight: 700; padding: 11px 15px; white-space: nowrap; }
td { border-top: 1px solid #eef1f5; padding: 14px 15px; font-size: 12px; vertical-align: middle; }
tbody tr { transition: background .15s ease; cursor: pointer; }
tbody tr:hover, tbody tr.selected { background: #f8faff; }
.person-cell { display: flex; gap: 10px; align-items: center; min-width: 145px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #4264b9; background: #e9efff; font-weight: 800; font-size: 12px; }
.person-name { font-weight: 700; }
.person-meta { color: var(--muted); font-size: 10px; margin-top: 4px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 9px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-triggered { color: #d94852; background: var(--red-soft); }
.status-pending { color: #ae7b16; background: var(--amber-soft); }
.status-normal { color: #16855e; background: var(--green-soft); }
.status-pip { color: #7053c3; background: #f2edff; }
.distance { min-width: 154px; }
.distance-main { color: var(--ink); font-weight: 750; font-size: 12px; }
.distance-sub { color: var(--muted); font-size: 10px; margin-top: 5px; }
.mini-progress { width: 112px; height: 5px; background: #edf0f4; border-radius: 99px; overflow: hidden; margin-top: 7px; }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: var(--bar, var(--blue)); }
.progress-red { --bar: var(--red); }
.progress-amber { --bar: var(--amber); }
.progress-green { --bar: var(--green); }
.completion { min-width: 135px; }
.completion strong { font-size: 12px; }
.reason { color: #657187; line-height: 1.45; max-width: 220px; }
.detail-panel { min-height: 580px; padding: 24px; position: sticky; top: 18px; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-person { display: flex; gap: 12px; align-items: center; }
.detail-avatar { width: 44px; height: 44px; font-size: 16px; border-radius: 13px; }
.detail-name { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.detail-meta { color: var(--muted); font-size: 11px; margin-top: 5px; }
.detail-tag { color: #64738a; background: #f3f6fa; border-radius: 6px; padding: 5px 7px; font-size: 10px; white-space: nowrap; }
.distance-card { margin-top: 22px; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, #17263d 0%, #263d5d 100%); color: white; position: relative; overflow: hidden; }
.distance-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -65px; top: -65px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 20px rgba(255,255,255,.025), 0 0 0 42px rgba(255,255,255,.02); }
.distance-label { color: #aebdd0; font-size: 11px; }
.distance-value { font-size: 25px; line-height: 1.25; font-weight: 800; letter-spacing: -.7px; margin: 8px 0 5px; position: relative; z-index: 1; }
.distance-explain { color: #cfdae8; line-height: 1.55; font-size: 11px; position: relative; z-index: 1; max-width: 90%; }
.detail-section { margin-top: 22px; }
.section-label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; color: #66758a; margin-bottom: 11px; }
.section-label span { color: #a0aabb; font-weight: 500; }
.bar-block { margin-bottom: 13px; }
.bar-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 6px; }
.bar-top span:last-child { color: var(--muted); }
.detail-progress { height: 8px; background: #edf0f5; border-radius: 99px; overflow: hidden; }
.detail-progress span { height: 100%; display: block; border-radius: inherit; background: var(--bar, var(--blue)); }
.metric-caption { color: var(--muted); font-size: 10px; margin-top: 5px; }
.evidence { border: 1px solid var(--line); border-radius: 11px; padding: 12px; color: #5c687a; font-size: 11px; line-height: 1.6; }
.evidence strong { color: var(--ink); }
.action-row { display: flex; gap: 8px; margin-top: 20px; }
.status-editor { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.status-editor .section-label { margin-bottom: 9px; }
.status-editor-row { display: flex; gap: 8px; }
.status-editor-row select { flex: 1; }
.profile-editor-grid { display: grid; grid-template-columns: 1fr 104px 104px; gap: 8px; margin-bottom: 8px; }
.profile-editor-grid label { display: grid; gap: 5px; color: #6b7280; font-size: 11px; font-weight: 800; }
.profile-editor-grid input,
.profile-editor-grid select { width: 100%; }
.save-status.full { width: 100%; justify-content: center; }
.save-status { border: 0; border-radius: 8px; padding: 0 12px; background: #edf3ff; color: var(--blue); font-size: 11px; font-weight: 750; }
.status-note { color: #9aa5b7; font-size: 10px; margin-top: 7px; line-height: 1.45; }
.toast { position: fixed; right: 24px; bottom: 24px; background: #1c2b43; color: #fff; padding: 11px 15px; border-radius: 10px; font-size: 12px; box-shadow: 0 10px 24px rgba(22,36,59,.2); z-index: 10; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.primary-button, .secondary-button { border-radius: 9px; padding: 10px 13px; font-size: 11px; font-weight: 750; }
.primary-button { border: 0; background: var(--blue); color: white; flex: 1; box-shadow: 0 5px 14px rgba(61,117,255,.23); }
.secondary-button { border: 1px solid var(--line); background: #fff; color: #657187; }
.rules-strip { margin-top: 18px; padding: 18px 22px; display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); align-items: center; gap: 15px; }
.rules-title { display: flex; gap: 10px; align-items: center; }
.icon-badge { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 12px; }
.rule-mini { display: flex; align-items: center; gap: 7px; color: #788397; font-size: 10px; white-space: nowrap; }
.rule-mini b { color: var(--ink); font-size: 11px; }
.rule-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.rule-dot.red { background: var(--red); }.rule-dot.blue { background: var(--blue); }.rule-dot.purple { background: var(--purple); }
.empty-row { text-align: center; padding: 40px 15px; color: var(--muted); }
@media (max-width: 1050px) { .workspace-grid { grid-template-columns: 1fr; } .detail-panel { position: static; min-height: auto; } .period-toolbar { grid-template-columns: 1fr 155px auto 155px; } .period-current { grid-column: 1 / -1; text-align: left; } }
@media (max-width: 720px) { .topbar { padding: 0 18px; }.updated-at { display: none; }.main-content { padding: 25px 15px 40px; }.hero-row { display: block; }.hero-note { margin-top: 18px; }.metric-grid { grid-template-columns: 1fr 1fr; }.filters { grid-template-columns: 1fr; padding-left: 15px; padding-right: 15px; }.panel-head { padding-left: 15px; padding-right: 15px; }.period-toolbar { grid-template-columns: 1fr; }.period-current { grid-column: auto; }.period-separator { display: none; }.period-field { grid-template-columns: 42px 1fr; }.profile-editor-grid { grid-template-columns: 1fr; }.rule-mini { white-space: normal; } }
