:root {
  --bg: #f2f7f8;
  --panel: #ffffff;
  --ink: #14303a;
  --muted: #6b8490;
  --line: #dde9ec;
  --teal: #0f8b8d;
  --teal-dark: #0a6f71;
  --teal-soft: #e6f4f4;
  --blue: #2a6fb0;
  --blue-soft: #e8f1f9;
  --green: #1f8a5b;
  --green-soft: #e7f6ee;
  --amber: #b9761a;
  --amber-soft: #fdf3e3;
  --red: #c24150;
  --red-soft: #fdecee;
  --shadow: 0 6px 22px rgba(19, 56, 68, 0.07);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
a { color: var(--teal); }

.hidden { display: none !important; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(15, 139, 141, 0.10), transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(42, 111, 176, 0.10), transparent 42%),
    var(--bg);
}

.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #12a3a5, #2a6fb0);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px;
  letter-spacing: .5px;
}

.auth-brand h1 { font-size: 18px; margin: 0; }
.auth-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfd;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.10);
}

.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.hint strong { color: var(--ink); }

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfd;
  color: #33505a;
  font-size: 14px;
  transition: .13s;
}
.option:hover { border-color: #b7d8db; background: #f4fbfb; }
.option.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; }
.option .idx {
  flex: 0 0 24px; height: 24px; border-radius: 7px;
  background: #e8f1f2; color: #5a7881;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.option.on .idx { background: var(--teal); color: #fff; }
.option.correct { border-color: #9fd6bd; background: var(--green-soft); }
.option.wrong { border-color: #f0c3ca; background: var(--red-soft); }
.form-error {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--teal); color: #fff; box-shadow: 0 6px 14px rgba(15, 139, 141, .18); }
.btn.primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.secondary { background: #fff; color: #3a5560; border: 1px solid var(--line); }
.btn.secondary:hover:not(:disabled) { border-color: #b9d2d8; }
.btn.soft { background: var(--teal-soft); color: var(--teal-dark); }
.btn.warn { background: var(--amber-soft); color: var(--amber); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

.topbar {
  height: 66px;
  background: #0f2e38;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .brand h1 { font-size: 15px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand small { display: block; color: #a9c6cd; font-size: 11px; margin-top: 1px; }
.top-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .10);
  color: #d9edf1;
  white-space: nowrap;
}
.chip.ok { background: rgba(31, 138, 91, .22); color: #a8f0cb; }
.chip.bad { background: rgba(194, 65, 80, .24); color: #ffc6cd; }

.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: calc(100vh - 66px);
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-label { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; color: #93a7ae; padding: 0 8px; }

.steps { display: flex; flex-direction: column; gap: 7px; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #54707a;
  background: transparent;
  text-align: left;
  width: 100%;
  font-size: 13px;
}
.step .dot {
  width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: #edf4f5; color: #6d8a93;
  font-size: 12px; font-weight: 800; flex: 0 0 24px;
}
.step.active { background: var(--teal-soft); border-color: #bfe2e3; color: var(--teal-dark); font-weight: 800; }
.step.active .dot { background: var(--teal); color: #fff; }
.step.done .dot { background: var(--green-soft); color: var(--green); }
.step.locked { opacity: .55; cursor: not-allowed; }
.step small { display: block; font-size: 11px; color: #8ba0a8; font-weight: 400; margin-top: 1px; }

.side-progress { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; }
.progress-track { height: 7px; border-radius: 8px; background: #e6eff0; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #16a5a7, #2a6fb0); border-radius: 8px; transition: width .3s; }
.progress-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 7px; }

.main { padding: 24px 26px 48px; width: 100%; max-width: 1560px; margin: 0 auto; min-width: 0; }

.view { display: none; }
.view.active { display: block; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: 1.4px; font-weight: 800; color: var(--teal); margin-bottom: 4px; }
.page-head h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mission {
  background: linear-gradient(112deg, #0d3f4a, #10737a);
  color: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.mission .kicker { font-size: 11px; letter-spacing: 1.4px; color: #a9e2e4; font-weight: 800; }
.mission h3 { margin: 5px 0 6px; font-size: 21px; }
.mission p { margin: 0; font-size: 13px; color: #cfecee; max-width: 760px; line-height: 1.6; }
.mission .badge {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.10);
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.task-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.task-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 3px 12px rgba(19, 56, 68, .035);
  min-width: 0;
}
.panel-head {
  padding: 14px 17px;
  border-bottom: 1px solid #edf3f4;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head small { color: var(--muted); font-size: 12px; }
.panel-body { padding: 16px 17px; }

.goal-list, .step-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.goal-list li { display: flex; gap: 10px; font-size: 14px; line-height: 1.6; }
.goal-list .num {
  flex: 0 0 22px; height: 22px; border-radius: 7px;
  background: var(--teal-soft); color: var(--teal-dark);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; margin-top: 2px;
}
.step-list { counter-reset: step; }
.step-list li {
  position: relative; padding: 10px 12px 10px 42px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fbfdfd;
}
.step-list li:before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 12px; top: 10px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #e4f1f2; color: var(--teal-dark);
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
}

.mixly-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  border: 1px dashed #b7d8db; background: #f5fcfc;
  border-radius: 12px; padding: 14px;
}
.mixly-card p { margin: 0; font-size: 13px; color: #44626c; max-width: 560px; }
.mixly-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.upload-zone {
  border: 1px dashed #b7d8db;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: #fbfdfd;
  transition: .15s;
}
.upload-zone.drag { background: var(--teal-soft); border-color: var(--teal); }
.upload-zone strong { display: block; font-size: 15px; margin-bottom: 4px; }
.upload-zone small { color: var(--muted); font-size: 12px; }
.upload-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.upload-name { font-size: 12px; color: var(--blue); }

.result-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }
.score-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.score-ring {
  --pct: 0;
  width: 94px; height: 94px; border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--pct) * 1%), #e7eff0 0);
  display: grid; place-items: center; flex: 0 0 94px;
}
.score-ring .inner {
  width: 74px; height: 74px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; text-align: center;
}
.score-ring b { font-size: 22px; line-height: 1; }
.score-ring small { font-size: 10px; color: var(--muted); }
.score-meta { font-size: 13px; color: #4a6670; }
.score-meta b { color: var(--ink); }

.dims { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; }
.dim { display: grid; grid-template-columns: 96px minmax(0,1fr) 48px; gap: 10px; align-items: center; font-size: 12px; }
.dim .bar { height: 8px; border-radius: 6px; background: #e9f0f1; overflow: hidden; }
.dim .bar span { display: block; height: 100%; background: linear-gradient(90deg, #16a5a7, #3a8ac9); border-radius: 6px; }
.dim .val { text-align: right; color: var(--muted); }

.evidence { display: flex; flex-direction: column; gap: 10px; }
.evidence-group { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.evidence-group h4 { margin: 0 0 7px; font-size: 12px; letter-spacing: .4px; }
.evidence-group.hit { background: #f6fcfa; border-color: #d7ece3; }
.evidence-group.miss { background: #fdf8f2; border-color: #f0e1c8; }
.evidence-group.warn { background: #fffaf0; border-color: #f1e2c4; }
.evidence-group ul { margin: 0; padding-left: 18px; font-size: 13px; color: #405b65; }
.evidence-group li { margin-bottom: 3px; }
.evidence-group .line { font-size: 12px; color: #6b8490; margin-top: 4px; }

.code-toggle { margin-top: 12px; }
.code-toggle summary { cursor: pointer; font-size: 12px; color: var(--blue); }
pre.code {
  background: #10242b; color: #cfe9f0; border-radius: 10px;
  padding: 13px 15px; font: 12px/1.7 Consolas, Monaco, monospace;
  overflow: auto; max-height: 280px; margin: 8px 0 0;
}

.ai-panel { position: sticky; top: 82px; display: flex; flex-direction: column; }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-avatar { width: 34px; height: 34px; border-radius: 11px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.ai-status { font-size: 11px; font-weight: 700; color: var(--green); }
.ai-status.bad { color: var(--red); }
.ai-body { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; padding: 14px 17px; }
.msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--blue-soft); color: #244a6b; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #f2f7f8; color: #27454e; border-bottom-left-radius: 4px; }
.msg.sys { align-self: stretch; background: var(--amber-soft); color: #8a5a12; font-size: 12px; }
.ai-input { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.ai-input textarea { flex: 1; resize: none; height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; font-size: 13px; }
.ai-input textarea:focus { border-color: var(--teal); }
.quick-asks { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.quick-asks button { font-size: 11px; padding: 5px 9px; border-radius: 20px; background: #f1f7f8; color: #4c6d78; }
.quick-asks button:hover { background: var(--teal-soft); color: var(--teal-dark); }
.ai-banner { margin: 0 14px 10px; background: var(--amber-soft); color: #8a5a12; font-size: 12px; padding: 8px 10px; border-radius: 8px; line-height: 1.5; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 9px 10px; font-size: 11px; letter-spacing: .4px;
  color: #71878f; background: #f6fafb; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid #eef4f5; vertical-align: middle; }
table.data tr:hover td { background: #f8fcfc; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-height: 66vh; border: 1px solid var(--line); border-radius: 12px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.info { background: var(--blue-soft); color: var(--blue); }
.tag.muted { background: #eef3f4; color: #6b8490; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .label { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .4px; }
.stat .value { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; }
.stat .hint { font-size: 11px; color: #93a7ae; }

.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px; }
.report-card h3 { margin: 0 0 10px; font-size: 14px; }
.report-card .big { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.report-card .sub { font-size: 12px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed #edf3f4; }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 700; }
.growth { white-space: pre-wrap; font-size: 14px; line-height: 1.85; color: #35535d; }

.stars { display: flex; gap: 4px; }
.star { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #9fb3ba; font-weight: 800; font-size: 13px; }
.star.on { background: var(--teal-soft); border-color: #b7dfe0; color: var(--teal-dark); }
.star-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.star-row .label { width: 84px; font-size: 13px; font-weight: 700; }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.group-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.group-card h4 { margin: 0 0 3px; font-size: 14px; }
.group-card .meta { font-size: 12px; color: var(--muted); }
.group-card .vote-count { font-size: 12px; color: var(--teal-dark); font-weight: 700; margin-top: 8px; }
.group-card.mine { border-color: #b7dfe0; background: #f8fdfd; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 11px 15px; background: transparent; color: #70878f; font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--teal-dark); border-bottom-color: var(--teal); }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  background: #14303a; color: #fff; padding: 11px 15px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow); max-width: 380px;
  opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8f2a37; }
.toast.ok { background: #14664a; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(11, 33, 41, .45);
  z-index: 60; display: grid; place-items: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; max-width: 860px; width: 100%;
  max-height: 86vh; overflow: auto; box-shadow: 0 20px 50px rgba(9, 30, 38, .3);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; }
.close-btn { background: #f0f5f6; color: #5c747d; width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }

.section-title { font-size: 12px; letter-spacing: .6px; color: #71878f; font-weight: 800; margin: 16px 0 8px; }
.section-title:first-child { margin-top: 0; }

.empty-state { text-align: center; padding: 34px 18px; color: var(--muted); font-size: 13px; }
.empty-state strong { display: block; color: #45626b; font-size: 15px; margin-bottom: 4px; }

.alert { border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.alert.warn { background: var(--amber-soft); color: #875816; border: 1px solid #f1e2c4; }
.alert.info { background: var(--blue-soft); color: #27557c; border: 1px solid #d4e4f2; }
.alert.bad { background: var(--red-soft); color: #9a2f3c; border: 1px solid #f3cfd4; }
.alert.ok { background: var(--green-soft); color: #14664a; border: 1px solid #cfe9dd; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[type="number"] { width: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.inline-form input[type="text"] { flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb0 { margin-bottom: 0; }

@media (max-width: 1180px) {
  .task-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-panel { position: static; }
  .ai-body { max-height: 320px; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .steps { flex-direction: row; overflow: auto; }
  .step { min-width: 148px; }
  .side-progress { display: none; }
  .main { padding: 18px 16px 40px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .sidebar, .head-actions, .btn { display: none !important; }
  .layout { display: block; }
}
