:root {
  --ink: #17243f;
  --muted: #6d7485;
  --paper: #f6f2e9;
  --card: #fffdf8;
  --line: #ded9ce;
  --green: #b7e24b;
  --blue: #77bdfb;
  --orange: #ffad5c;
  --shadow: 0 18px 50px rgba(23, 36, 63, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px; color: #fff; background: var(--ink); display: flex; flex-direction: column; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: inline-grid; place-items: center; color: var(--ink); background: var(--green); font-weight: 900; box-shadow: 5px 5px 0 rgba(255,255,255,.14); }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #aeb6c8; }
.sidebar nav { display: grid; gap: 8px; margin-top: 56px; }
.sidebar nav a { padding: 13px 14px; border-radius: 13px; color: #bac2d2; text-decoration: none; display: flex; align-items: center; gap: 13px; font-weight: 700; }
.sidebar nav a span { width: 22px; text-align: center; font-size: 19px; }
.sidebar nav a:hover, .sidebar nav a.active { color: var(--ink); background: var(--green); }
.sidebar-note { margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; display: flex; gap: 10px; align-items: center; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note small { margin-top: 3px; color: #9fa9bd; font-size: 11px; }
.status-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(255,173,92,.15); }
.status-dot[data-state="synced"] { background: var(--green); box-shadow: 0 0 0 5px rgba(183,226,75,.15); }
.status-dot[data-state="error"] { background: #ff7770; box-shadow: 0 0 0 5px rgba(255,119,112,.15); }

main { min-width: 0; }
.topbar { min-height: 116px; padding: 25px clamp(24px, 4vw, 64px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 36px); }
.eyebrow { margin: 0; color: #7f8796; font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.account-strip { display: flex; align-items: center; gap: 12px; }
.role-button { padding: 9px 12px; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); background: var(--green); font-weight: 900; }
.points-pill { min-width: 106px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.points-pill small, .points-pill strong { display: block; }
.points-pill small { color: var(--muted); }
.points-pill strong { margin-top: 2px; font-size: 20px; }
.avatar-button { border: 0; background: transparent; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.avatar-button span { width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; }
.mobile-menu { display: none; margin-right: 8px; border: 0; background: transparent; font-size: 22px; }
.page { padding: clamp(24px, 4vw, 62px); }
.hero-card { min-height: 310px; padding: clamp(30px, 5vw, 60px); border: 1px solid #233454; border-radius: 28px; color: #fff; background: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 32px; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; width: 280px; height: 280px; border: 70px solid rgba(183,226,75,.09); border-radius: 50%; right: -80px; top: -105px; }
.hero-card h2 { margin: 10px 0 13px; font-size: clamp(32px, 5vw, 58px); line-height: 1.12; letter-spacing: -.04em; }
.hero-card p:not(.eyebrow) { max-width: 530px; color: #c2cada; }
.parent-hero { min-height: 230px; padding: clamp(30px, 5vw, 54px); border-radius: 28px; color: #fff; background: linear-gradient(135deg, var(--ink), #29446f); display: flex; align-items: center; justify-content: space-between; gap: 30px; box-shadow: var(--shadow); }
.parent-hero h2 { margin: 10px 0; font-size: clamp(30px, 5vw, 50px); }
.parent-hero p:not(.eyebrow) { margin-bottom: 0; color: #c2cada; }
.primary-button { padding: 13px 18px; border: 1px solid var(--green); border-radius: 13px; color: var(--ink); background: var(--green); font-weight: 900; box-shadow: 4px 4px 0 rgba(255,255,255,.13); }
.primary-button:hover { transform: translateY(-1px); }
.primary-button.full { width: 100%; }
.progress-orbit { z-index: 1; width: 150px; height: 150px; flex: none; border-radius: 50%; border: 13px solid rgba(255,255,255,.12); outline: 2px dashed var(--green); outline-offset: 10px; display: grid; place-content: center; text-align: center; }
.progress-orbit strong { font-size: 34px; }
.progress-orbit span { color: #aeb8ca; font-size: 12px; }
.metrics { margin: 20px 0 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metrics.four { grid-template-columns: repeat(4, 1fr); }
.metrics article { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.metrics span, .metrics small { display: block; color: var(--muted); }
.metrics strong { display: block; margin: 8px 0; font-size: 32px; }
.section-heading { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 4px 0 0; }
.text-button { border: 0; background: transparent; color: var(--ink); font-weight: 800; }
.task-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.task-preview { min-height: 225px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.task-preview::before { content: ""; position: absolute; width: 7px; inset: 0 auto 0 0; background: var(--accent); }
.accent-green { --accent: var(--green); }.accent-blue { --accent: var(--blue); }.accent-orange { --accent: var(--orange); }
.subject-tag { align-self: flex-start; padding: 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 32%, transparent); font-size: 12px; font-weight: 800; }
.task-preview h3 { margin: 18px 0 8px; font-size: 19px; }
.task-preview p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.task-preview > div { margin-top: auto; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.task-preview button { padding: 8px 12px; border: 1px solid var(--ink); border-radius: 10px; color: var(--ink); background: transparent; font-weight: 800; }

.auth-dialog { width: min(850px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 26px; overflow: hidden; box-shadow: 0 30px 90px rgba(7,16,33,.28); grid-template-columns: 1.05fr 1fr; }
.auth-dialog[open] { display: grid; }
.auth-dialog::backdrop { background: rgba(11, 20, 38, .72); backdrop-filter: blur(7px); }
.auth-copy { min-height: 500px; padding: 48px; color: #fff; background: var(--ink); display: flex; flex-direction: column; justify-content: center; }
.auth-copy .brand-mark { margin-bottom: 34px; }
.auth-copy h2 { margin: 10px 0 16px; font-size: 38px; line-height: 1.18; }
.auth-copy > p:last-child { color: #bbc4d5; line-height: 1.8; }
.auth-dialog form { padding: 48px; background: var(--card); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.auth-tabs button { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; font-weight: 800; }
.auth-tabs button.active { border-color: var(--ink); color: #fff; background: var(--ink); }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
input, textarea, select { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,36,63,.08); }
.auth-dialog form > small { color: var(--muted); text-align: center; line-height: 1.5; }
.form-message { min-height: 18px; margin: 0; color: #b53232; font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 13px 17px; border-radius: 12px; color: #fff; background: var(--ink); box-shadow: var(--shadow); transform: translateY(120px); transition: .2s ease; z-index: 30; }
.toast.show { transform: translateY(0); }

.toolbar { margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.toolbar h2 { margin: 5px 0 0; font-size: 30px; }
.toolbar > div:last-child { display: flex; gap: 10px; flex-wrap: wrap; }
.secondary-button, .small-button, .reject-button, .icon-button { border: 1px solid var(--ink); border-radius: 11px; color: var(--ink); background: transparent; font-weight: 800; }
.secondary-button { padding: 12px 15px; }
.small-button { padding: 8px 12px; }
.reject-button { padding: 11px 15px; color: #a33131; border-color: #ca7474; }
.icon-button { width: 34px; height: 34px; font-size: 20px; }
.primary-button.compact { padding: 10px 14px; box-shadow: none; }
.task-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.task-card { min-height: 230px; padding: 21px; border: 1px solid var(--line); border-radius: 19px; background: var(--card); display: flex; flex-direction: column; }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-card h3 { margin: 22px 0 8px; font-size: 19px; }
.task-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.task-card > small { margin-top: 12px; color: #969ca8; }
.task-card-actions { margin-top: auto; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.status-badge { display: inline-flex; padding: 7px 10px; border-radius: 999px; color: var(--ink); background: #e9e6dd; font-size: 12px; font-weight: 900; }
.status-badge.pending { background: #ffddb8; }.status-badge.approved { background: #dff4a9; }.status-badge.rejected { background: #ffd0cd; }
.empty-state { grid-column: 1 / -1; min-height: 170px; padding: 36px; border: 1px dashed #bbb5a8; border-radius: 18px; display: grid; place-content: center; text-align: center; background: rgba(255,255,255,.25); }
.empty-state strong { font-size: 19px; }.empty-state p { margin: 7px 0 0; color: var(--muted); }
.subject-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.subject-summary article { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); display: flex; align-items: center; justify-content: space-between; }
.subject-summary article span { color: var(--muted); }.subject-summary article strong { font-size: 22px; }
.local-warning { padding: 8px 11px; border-radius: 9px; color: #8a511d; background: #ffe2bf; font-size: 12px; font-weight: 800; }
.info-card { padding: 20px 22px; border-left: 5px solid var(--blue); border-radius: 13px; background: #eaf5ff; }
.info-card p { margin: 7px 0 0; color: #4f6073; line-height: 1.7; }
.spaced { margin-top: 42px; }
.review-list { display: grid; gap: 15px; }
.review-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); display: grid; grid-template-columns: 190px 1fr; gap: 22px; }
.evidence { min-height: 150px; overflow: hidden; border-radius: 13px; background: #ebe7dd; display: grid; place-items: center; color: var(--muted); }
.evidence img { width: 100%; height: 100%; object-fit: cover; }
.review-card h3 { margin: 18px 0 8px; }.review-card p { color: var(--muted); }.review-card small { color: #8e94a0; }
.review-actions { margin-top: 20px; display: flex; gap: 9px; justify-content: flex-end; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.product-card { min-height: 290px; padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); display: flex; flex-direction: column; }
.product-icon { width: 46px; height: 46px; margin-bottom: 20px; border-radius: 15px; display: grid; place-items: center; color: var(--ink); background: var(--green); font-size: 24px; }
.product-card small { color: var(--muted); }.product-card h3 { margin: 7px 0 9px; }.product-card p { color: var(--muted); line-height: 1.7; }
.product-card > div:last-child { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-card > div:last-child span { display: flex; gap: 7px; }
.balance-banner { margin-bottom: 22px; padding: 26px; border-radius: 20px; color: #fff; background: var(--ink); display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 20px; }
.balance-banner strong { color: var(--green); font-size: 36px; }.balance-banner p { margin: 0; color: #bbc4d5; text-align: right; }
.history-list { display: grid; gap: 9px; }
.history-list > div { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); display: flex; justify-content: space-between; gap: 15px; }
.history-list span { color: var(--muted); }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.import-grid article { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.import-grid article > span { color: var(--green); font-size: 34px; font-weight: 900; -webkit-text-stroke: 1px var(--ink); }
.import-grid h3 { font-size: 23px; }.import-grid p { min-height: 74px; color: var(--muted); line-height: 1.7; }
pre { padding: 14px; overflow: auto; border-radius: 10px; color: #dbe4f7; background: #202d48; font-size: 12px; }
.import-grid a { margin-left: 12px; color: var(--ink); font-weight: 800; }
.logs-layout { display: grid; grid-template-columns: 230px 1fr; gap: 20px; }
.logs-layout aside { display: grid; align-content: start; gap: 8px; }
.logs-layout aside button { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); text-align: left; }
.logs-layout aside button.active { border-color: var(--ink); box-shadow: 4px 4px 0 var(--green); }
.logs-layout aside strong, .logs-layout aside small, .logs-layout aside span { display: block; }
.logs-layout aside small { margin: 3px 0 8px; color: var(--muted); }.logs-layout aside span { font-size: 12px; }
.markdown-body { padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); line-height: 1.75; }
.markdown-body h1 { margin-top: 0; }.markdown-body h2 { margin-top: 30px; }.markdown-body li { margin: 6px 0; }
.account-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.account-grid article { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.account-grid p { color: var(--muted); line-height: 1.7; }.large-avatar { width: 65px; height: 65px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ink); font-size: 28px; font-weight: 900; }
.modal-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 30px 90px rgba(7,16,33,.28); }
.modal-dialog::backdrop { background: rgba(11,20,38,.65); backdrop-filter: blur(5px); }
.modal-heading { position: sticky; top: 0; z-index: 2; padding: 22px 25px; border-bottom: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: space-between; }
.modal-heading h2 { margin: 4px 0 0; }.modal-heading button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #ece8df; font-size: 25px; }
#modal-content { padding: 25px; }.form-stack { display: grid; gap: 17px; }.form-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role-choice button { min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; text-align: left; }
.role-choice button:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--green); }
.role-choice strong, .role-choice span { display: block; }.role-choice strong { margin-bottom: 9px; font-size: 22px; }.role-choice span, .role-note { color: var(--muted); line-height: 1.6; }
.role-note { display: block; margin-top: 16px; text-align: center; }
.form-stack > small { color: var(--muted); line-height: 1.5; }.code-card { margin-bottom: 20px; padding: 20px; border-radius: 16px; background: var(--ink); color: #fff; text-align: center; }.code-card small, .code-card strong { display: block; }.code-card strong { margin: 7px 0; color: var(--green); font-size: 30px; letter-spacing: .08em; }.code-card p { margin: 0; color: #b9c2d3; font-size: 12px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { z-index: 20; position: fixed; left: 0; transform: translateX(-105%); width: 238px; transition: .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-block; }
  .task-preview-grid { grid-template-columns: 1fr; }
  .task-grid, .product-grid, .account-grid { grid-template-columns: 1fr 1fr; }
  .subject-summary { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .metrics.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .topbar { min-height: 90px; padding: 18px; }
  .topbar .eyebrow, .avatar-button b { display: none; }
  .role-button { padding: 8px 10px; font-size: 12px; }
  .page { padding: 18px; }
  .hero-card { padding: 30px 24px; min-height: 360px; align-items: flex-start; }
  .progress-orbit { position: absolute; right: 26px; bottom: 26px; width: 92px; height: 92px; border-width: 8px; }
  .progress-orbit strong { font-size: 22px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics.four { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .task-grid, .product-grid, .account-grid, .import-grid, .logs-layout, .subject-summary, .role-choice { grid-template-columns: 1fr; }
  .parent-hero { align-items: flex-start; flex-direction: column; }
  .review-card { grid-template-columns: 1fr; }
  .balance-banner { grid-template-columns: 1fr 1fr; }.balance-banner p { grid-column: 1 / -1; text-align: left; }
  .history-list > div { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .auth-dialog[open] { display: block; }
  .auth-copy { min-height: auto; padding: 30px; }
  .auth-copy h2 { font-size: 28px; }
  .auth-dialog form { padding: 30px; }
}
