:root {
  --ink: #173b35;
  --muted: #6d817d;
  --brand: #0d7c66;
  --brand-dark: #075b4b;
  --brand-soft: #e8f5f1;
  --line: #dce8e4;
  --paper: #ffffff;
  --canvas: #f3f7f5;
  --danger: #b73c46;
  --danger-soft: #fff0f1;
  --warning: #a36b11;
  --shadow: 0 18px 50px rgba(28, 71, 62, .09);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: radial-gradient(circle at 85% 0, #e2f1ec 0, transparent 28rem), var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1.08fr) minmax(420px, .92fr); }
.auth-brand { position: relative; overflow: hidden; padding: clamp(42px, 7vw, 110px); display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, #075b4b, #0d7c66 58%, #15947a); color: #fff; }
.auth-brand::after { content: ""; position: absolute; width: 34rem; height: 34rem; right: -14rem; bottom: -17rem; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 5rem rgba(255,255,255,.035), 0 0 0 10rem rgba(255,255,255,.025); }
.auth-brand img { width: min(470px, 90%); height: auto; filter: drop-shadow(0 16px 30px rgba(0,0,0,.12)); background: #fff; border-radius: 14px; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 580px; }
.auth-brand-copy .eyebrow { margin: 0 0 20px; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; opacity: .72; }
.auth-brand-copy h1 { margin: 0; max-width: 560px; font-size: clamp(38px, 5vw, 68px); line-height: 1.12; letter-spacing: -.035em; }
.auth-brand-copy p { max-width: 500px; margin: 28px 0 0; font-size: 17px; line-height: 1.9; color: rgba(255,255,255,.78); }
.privacy-line { position: relative; z-index: 1; font-size: 13px; color: rgba(255,255,255,.62); }
.auth-panel { display: grid; place-items: center; padding: 36px; }
.auth-card { width: min(430px, 100%); padding: 38px; background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.8); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.auth-card h2 { margin: 0 0 8px; font-size: 28px; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.7; }
.auth-switch { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--brand); font-weight: 700; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 700; }
.field small { color: var(--muted); line-height: 1.5; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); background: #fff; outline: 0; transition: .2s border-color, .2s box-shadow; }
textarea { min-height: 108px; resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(13,124,102,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions.right { justify-content: flex-end; }
.button { min-height: 42px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 16px; background: #fff; color: var(--ink); font-weight: 700; }
.button:hover { border-color: #a8c7be; background: #f8fbfa; }
.button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.button.danger { border-color: #f1c5c9; color: var(--danger); background: var(--danger-soft); }
.button.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.button:disabled { opacity: .55; cursor: wait; }
.wide { width: 100%; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px; background: #073f35; color: #fff; display: flex; flex-direction: column; z-index: 5; }
.side-logo { display: flex; gap: 12px; align-items: center; padding: 4px 8px 28px; }
.side-logo img { width: 48px; height: 48px; border-radius: 12px; }
.side-logo strong { display: block; font-size: 15px; line-height: 1.45; }
.side-logo span { font-size: 12px; color: rgba(255,255,255,.58); }
.nav { display: grid; gap: 7px; }
.nav button { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; border-radius: 11px; padding: 12px 14px; text-align: left; color: rgba(255,255,255,.72); background: transparent; }
.nav button:hover, .nav button.active { color: #fff; background: rgba(255,255,255,.11); }
.nav .icon { width: 22px; font-size: 17px; text-align: center; }
.side-user { margin-top: auto; padding: 18px 10px 4px; border-top: 1px solid rgba(255,255,255,.12); }
.side-user strong, .side-user span { display: block; }
.side-user span { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.55); }
.side-user button { margin-top: 12px; border: 0; padding: 0; color: #9ddccc; background: transparent; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 4; min-height: 78px; padding: 17px clamp(22px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; background: rgba(243,247,245,.88); border-bottom: 1px solid rgba(220,232,228,.75); backdrop-filter: blur(18px); }
.topbar h1 { margin: 0; font-size: 23px; }
.topbar p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 24px; }
.content { width: min(1420px, 100%); margin: 0 auto; padding: 32px clamp(22px, 4vw, 54px) 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.page-head h2 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(35,70,62,.04); }
.card h3 { margin: 0 0 17px; font-size: 18px; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 12px; font-size: 34px; letter-spacing: -.04em; }
.metric small { color: var(--muted); }
.progress { height: 7px; overflow: hidden; margin-top: 16px; border-radius: 9px; background: #e8efec; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #37ae91); }

.list { display: grid; gap: 10px; }
.list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid #edf2f0; }
.list-item:last-child { border-bottom: 0; }
.list-item strong { display: block; }
.list-item p, .list-item small { display: block; margin: 5px 0 0; color: var(--muted); line-height: 1.55; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.badge.warning { color: var(--warning); background: #fff6e4; }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 14px 15px; border-bottom: 1px solid #edf2f0; text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f8fbfa; font-size: 12px; font-weight: 700; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.case-card { border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: #fff; transition: .2s transform, .2s box-shadow; }
.case-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.case-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.case-card h3 { margin: 0; font-size: 18px; }
.case-card p { min-height: 44px; color: var(--muted); line-height: 1.6; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.detail-hero { padding: 26px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #075b4b, #12846c); }
.detail-hero h2 { margin: 8px 0; font-size: 30px; }
.detail-hero p { margin: 0; color: rgba(255,255,255,.72); }
.detail-hero .actions { margin-top: 22px; }
.detail-hero .button { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; }
.detail-hero .button.danger { border-color: rgba(255,210,214,.45); color: #ffe2e4; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 7px; bottom: 7px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 22px 14px; }
.timeline-item::before { content: ""; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline-item h4 { margin: 0; }
.timeline-item p { margin: 6px 0 0; color: var(--muted); }
.notice { padding: 13px 15px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-dark); line-height: 1.65; }
.notice.danger { color: var(--danger); background: var(--danger-soft); }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(5, 32, 27, .55); backdrop-filter: blur(5px); }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 20px; padding: 25px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide-modal { width: min(820px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-head h2 { margin: 0; }
.modal-head button { border: 0; background: transparent; font-size: 25px; color: var(--muted); }
.toast { position: fixed; z-index: 40; right: 24px; bottom: 24px; max-width: min(390px, calc(100vw - 48px)); padding: 13px 17px; border-radius: 12px; color: #fff; background: #173b35; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.loading { min-height: 55vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 38px; height: 38px; border: 3px solid #d9e8e3; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .grid.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { min-height: 300px; padding: 42px 28px; }
  .auth-brand-copy h1 { font-size: 39px; }
  .privacy-line { display: none; }
  .auth-panel { padding: 24px 18px 44px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(292px, 85vw); transition: .22s transform; box-shadow: 20px 0 60px rgba(0,0,0,.2); }
  .shell.menu-open .sidebar { transform: none; }
  .mobile-menu { display: block; }
  .topbar { min-height: 68px; }
  .topbar > div:first-of-type p { display: none; }
  .grid.two, .case-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .auth-card { padding: 26px 22px; }
  .grid.metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 17px; }
  .metric strong { font-size: 27px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h2 { font-size: 26px; }
  .content { padding-top: 22px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}
