:root {
  --ink: #17211d;
  --muted: #68736d;
  --line: #dfe5e1;
  --paper: #f4f6f3;
  --white: #fff;
  --green: #176b4d;
  --green-dark: #0f4d38;
  --green-soft: #e4f0e9;
  --gold: #c68a2c;
  --red: #b34136;
  --red-soft: #f9e8e5;
  --shadow: 0 18px 50px rgba(25, 45, 35, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.6 "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: #13231c; }
.auth-story { padding: clamp(48px, 9vw, 130px); color: white; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-story::after { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -170px; bottom: -240px; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.brand-mark { width: 66px; height: 66px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5); font: 700 22px/1 serif; margin-bottom: 62px; }
.auth-story .eyebrow { color: #90c5ad; }
.auth-story h1 { max-width: 650px; margin: 0; font: 600 clamp(42px, 5vw, 74px)/1.14 Georgia, "Songti SC", serif; letter-spacing: -.03em; }
.auth-lead { max-width: 570px; margin: 30px 0 48px; color: #c8d3cd; font-size: 17px; }
.principles { display: flex; gap: 12px; flex-wrap: wrap; }
.principles span { padding: 8px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 30px; color: #dce5e0; font-size: 12px; }
.auth-panel { background: #f8f9f7; display: grid; place-items: center; padding: 48px; }
.auth-form { width: min(390px, 100%); }
.auth-form h2 { margin: 0 0 32px; font: 600 34px/1.2 Georgia, "Songti SC", serif; }
label { display: grid; gap: 7px; margin-bottom: 17px; color: #39443f; font-weight: 600; font-size: 13px; }
input, textarea, select { width: 100%; border: 1px solid #cfd7d2; background: white; border-radius: 8px; padding: 11px 12px; color: var(--ink); outline: none; }
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,77,.09); }
.primary { border: 0; background: var(--green); color: white; border-radius: 8px; padding: 10px 17px; font-weight: 700; }
.primary:hover { background: var(--green-dark); }
.wide { width: 100%; margin-top: 8px; padding: 13px; }
.ghost { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 7px; padding: 8px 12px; }
.text-button { border: 0; background: transparent; color: var(--green); margin-top: 18px; }
.form-error { min-height: 22px; color: var(--red); }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; color: #dce7e1; background: #12261e; padding: 28px 18px; display: flex; flex-direction: column; }
.brand { padding: 0 12px 30px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand span { display: block; color: white; font: 700 28px Georgia, "Songti SC", serif; }
.brand small { color: #91a59b; font-size: 10px; }
nav { padding-top: 22px; display: grid; gap: 6px; }
.nav-item { border: 0; background: transparent; color: #a9bbb2; text-align: left; padding: 12px 13px; border-radius: 8px; display: flex; gap: 13px; align-items: center; }
.nav-item b { color: #6d887b; font-size: 10px; }
.nav-item.active, .nav-item:hover { color: white; background: rgba(255,255,255,.09); }
.nav-item.active b { color: #8ed1b3; }
.sidebar-note { margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; color: #9db0a6; font-size: 11px; }
.sidebar-note strong { color: #dce7e1; }
.sidebar-note p { margin: 6px 0 0; }
.main { min-width: 0; }
.topbar { height: 94px; padding: 20px 34px; background: rgba(255,255,255,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0; font: 600 23px Georgia, "Songti SC", serif; }
.user-area { display: flex; align-items: center; gap: 14px; }
.user-area div { display: grid; }
.user-area small { color: var(--muted); }
.environment { padding: 5px 9px; color: var(--green); background: var(--green-soft); border-radius: 20px; font-size: 11px; font-weight: 700; }
.view-root { padding: 30px 34px 60px; max-width: 1540px; margin: auto; }
.banner { margin: 18px 34px 0; padding: 11px 14px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); }
.banner.error { background: var(--red-soft); color: var(--red); }

.hero { background: linear-gradient(120deg, #173f30, #176b4d); color: white; border-radius: 16px; padding: 32px 36px; display: flex; justify-content: space-between; gap: 30px; box-shadow: var(--shadow); }
.hero h3 { margin: 4px 0 9px; font: 600 29px Georgia, "Songti SC", serif; }
.hero p { max-width: 670px; margin: 0; color: #cae0d5; }
.hero .eyebrow { color: #9ed1b9; }
.date-block { text-align: right; min-width: 190px; }
.date-block strong { display: block; font: 600 42px Georgia, serif; }
.date-block span { color: #b9d4c7; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 22px 0; }
.metric { background: white; border: 1px solid var(--line); border-radius: 11px; padding: 18px 20px; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 5px; font: 600 30px Georgia, serif; }
.metric strong.compact-value { font-size: 18px; }
.metric em { font-style: normal; color: var(--green); font-size: 11px; }
.grid-2 { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 35px rgba(25,45,35,.035); overflow: hidden; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-body { padding: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.section-head h3 { margin: 0; font: 600 25px Georgia, "Songti SC", serif; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; color: var(--muted); background: #f7f9f7; font-size: 11px; text-align: left; }
td { padding: 13px; border-top: 1px solid var(--line); vertical-align: top; }
.title-cell strong { display: block; max-width: 440px; }
.title-cell small { color: var(--muted); }
.badge { display: inline-block; padding: 4px 8px; border-radius: 20px; background: #edf1ee; color: #526059; font-size: 11px; font-weight: 700; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gold { background: #f8efd9; color: #89601d; }
.link-button { border: 0; background: transparent; color: var(--green); padding: 3px; font-weight: 700; }
.empty { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.risk-list, .timeline { display: grid; gap: 11px; }
.risk-item { border-left: 3px solid var(--gold); background: #faf9f5; padding: 12px 14px; }
.risk-item.high { border-color: var(--red); }
.risk-item strong { display: block; }
.risk-item small { color: var(--muted); }
.step { display: grid; grid-template-columns: 25px 1fr; gap: 9px; align-items: start; }
.step b { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 10px; }
.step p { margin: 0; }
.step small { color: var(--muted); }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: 0 24px 80px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(10,20,15,.58); backdrop-filter: blur(3px); }
.modal-shell { padding: 28px; position: relative; }
.modal-close { position: absolute; right: 16px; top: 12px; border: 0; background: transparent; color: var(--muted); font-size: 28px; }
.modal-shell h3 { margin: 0 0 6px; font: 600 25px Georgia, "Songti SC", serif; }
.modal-shell > div > p { color: var(--muted); margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 76px 1fr; }
  .sidebar { padding: 22px 10px; }
  .brand small, .nav-item:not(.active) span, .nav-item { font-size: 0; }
  .brand span { font-size: 20px; text-align: center; }
  .nav-item { justify-content: center; }
  .nav-item b { font-size: 11px; }
  .sidebar-note { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-story { min-height: 340px; padding: 42px 30px; }
  .brand-mark { margin-bottom: 30px; }
  .auth-panel { padding: 38px 24px; }
  .workspace { display: block; }
  .sidebar { position: fixed; z-index: 10; top: auto; bottom: 0; width: 100%; height: 64px; padding: 7px; }
  .brand, .sidebar-note { display: none; }
  nav { grid-template-columns: repeat(6, 1fr); padding: 0; gap: 2px; }
  .nav-item { padding: 10px 4px; }
  .topbar { padding: 14px 18px; height: 78px; }
  .user-area .environment, .user-area div { display: none; }
  .view-root { padding: 20px 16px 90px; }
  .banner { margin: 12px 16px 0; }
  .metric-grid, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 25px; }
  .date-block { display: none; }
  .panel { overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}
