:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #62706a;
  --paper: #f4f1e9;
  --card: #fffdf8;
  --line: #d8d4c8;
  --green: #174c3c;
  --green-2: #256b55;
  --amber: #b46a1b;
  --red: #a33b32;
  --shadow: 0 16px 50px rgba(31, 41, 36, 0.09);
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 10%, rgba(197, 160, 91, 0.14), transparent 28rem),
    linear-gradient(180deg, #eee9dc 0, var(--paper) 22rem);
}
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: min(520px, 100%);
  margin: 0;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 48px; }
.login-card form { display: grid; gap: 18px; margin-top: 24px; }

button, input, textarea { font: inherit; }

.hero {
  max-width: 1120px;
  min-height: 230px;
  margin: 0 auto;
  padding: 54px 24px 34px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.eyebrow, .step {
  color: var(--green-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 4px 0;
  font-family: SimSun, "Songti SC", serif;
  font-size: clamp(46px, 8vw, 82px);
  line-height: 1;
  letter-spacing: 0.08em;
}

.subtitle { margin: 18px 0 0; color: var(--muted); }

.status-panel { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.status {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-size: 13px;
}
.status.good { border-color: #98b9aa; color: var(--green); background: #eef7f1; }

main {
  max-width: 1120px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 15px 19px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover, .tab.active { color: var(--green); }
.tab.active { border-bottom-color: var(--green); font-weight: 700; }

.panel {
  display: none;
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}
.panel.active { display: block; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.panel-heading h2, .panel h2 { margin: 3px 0; font-family: SimSun, "Songti SC", serif; font-size: 30px; }
.privacy { color: var(--green); font-size: 13px; font-weight: 700; }

.notice, .result {
  margin: 18px 0 24px;
  padding: 14px 16px;
  border-left: 4px solid var(--green-2);
  background: #eef4ef;
  color: #425049;
  line-height: 1.7;
}
.notice.warning { border-left-color: var(--amber); background: #fff6e8; }

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label { display: flex; flex-direction: column; gap: 8px; color: #45514c; font-size: 14px; }
label.block { margin-top: 20px; }
.live-option { flex-direction: row; align-items: center; margin-top: 15px; }
.live-option input { width: auto; }
input, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fff;
}
input:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(37, 107, 85, 0.1); }
textarea { resize: vertical; line-height: 1.65; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.button, .mini, .filter {
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: 0.16s ease;
}
.button { padding: 11px 18px; font-weight: 700; }
.button.primary { color: #fff; background: var(--green); }
.button.primary:hover { background: var(--green-2); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: #fff; color: var(--green); }
button:disabled { cursor: wait; opacity: 0.55; transform: none !important; }

.preview { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.speaker-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.speaker-chip { padding: 7px 10px; border: 1px solid #adc4b8; border-radius: 100px; background: #f1f8f3; font-size: 13px; }
.samples { display: grid; gap: 8px; }
.sample { padding: 10px 12px; border-radius: 7px; background: #f3f1eb; }
.sample strong { color: var(--green); }
.sample time { margin-left: 10px; color: var(--muted); font-size: 12px; }
.sample p { margin: 5px 0 0; }
.sources-section { margin-top: 28px; }
.sources-section h3 { font-size: 16px; }
.sources.empty-state.compact { padding: 24px; }
.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.source-row small { display: block; margin-top: 4px; color: var(--muted); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.filter { padding: 7px 12px; border-color: var(--line); background: #fff; color: var(--muted); }
.filter.active { border-color: var(--green); color: #fff; background: var(--green); }
.subsection-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 38px 0 16px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.subsection-heading h2 { margin: 0; }
.subsection-heading span { color: var(--muted); font-size: 13px; }

.card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty-state { display: block; padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }
.principle-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12px; }
.category { padding: 4px 8px; color: #fff; background: var(--green); border-radius: 4px; }
.confidence { color: var(--muted); }
.principle-status { margin-left: auto; font-weight: 700; }
.status-已确认 { color: var(--green-2); }
.status-待复核 { color: var(--amber); }
.status-已驳回 { color: var(--red); }
.principle-card h3 { margin: 15px 0 8px; font-family: SimSun, "Songti SC", serif; font-size: 22px; }
.case-card { grid-column: 1 / -1; }
.logic-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 36px; }
.logic-step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; }
.case-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 18px 0; padding: 18px; border-radius: 8px; background: #f3f5ef; }
.case-context h4 { margin: 0; }
.case-context small, .case-links { color: var(--muted); font-size: 13px; }
.logic-flow a, .principle-card a { color: var(--green-2); overflow-wrap: anywhere; }
.principle-card { scroll-margin-top: 24px; }
.style-profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.style-profile > div { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.style-profile h3 { margin: 0 0 8px; font-size: 15px; color: var(--green); }
.style-profile p, .style-profile ul { margin: 0; line-height: 1.65; }
.statement { line-height: 1.7; font-weight: 700; }
dl { display: grid; grid-template-columns: 72px 1fr; gap: 8px; margin: 9px 0; font-size: 14px; line-height: 1.55; }
dt { color: var(--muted); }
dd { margin: 0; }
details { margin-top: 14px; }
summary { cursor: pointer; color: var(--green-2); }
.evidence-list, .answer-evidence { padding-left: 20px; line-height: 1.65; }
.evidence-list small { display: block; color: var(--muted); }
.concept-evidence li + li { margin-top: 18px; }
.concept-evidence blockquote { margin: 6px 0; padding-left: 12px; border-left: 2px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.citation { display: inline-block; margin-right: 5px; color: var(--green); font-family: Consolas, monospace; font-weight: 800; }
.card-actions { display: flex; gap: 7px; margin-top: 16px; }
.mini { padding: 6px 10px; background: transparent; }
.mini.confirm { border-color: #86ad9c; color: var(--green); }
.mini.reject { border-color: #d7a8a3; color: var(--red); }
.mini.neutral { border-color: var(--line); color: var(--muted); }

.progress { margin: 18px 0; }
.progress-bar { height: 8px; overflow: hidden; border-radius: 10px; background: #e1ded6; }
.progress-bar span { display: block; width: 0; height: 100%; background: var(--green-2); transition: width 0.3s; }
.progress p { color: var(--muted); font-size: 13px; }

.answer { margin-top: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.answer-label { color: var(--green-2); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; }
.as-of-label { color: var(--muted); font-size: 12px; }
.answer-main { margin: 15px 0 24px; font-family: SimSun, "Songti SC", serif; font-size: 22px; line-height: 1.8; }
.answer h3 { margin-top: 20px; font-size: 16px; }
.answer-evidence blockquote { margin: 7px 0; padding-left: 12px; border-left: 2px solid var(--line); }
.answer-evidence small { color: var(--muted); }
.disclaimer { margin-top: 24px; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
.context-list { line-height: 1.6; }
.context-list p { margin: 4px 0; }
.context-list a { color: var(--green-2); }

.workflow { padding-left: 22px; line-height: 1.8; }
.workflow li { margin: 10px 0; }
pre { overflow-x: auto; padding: 18px; border-radius: 8px; background: #1d2823; color: #eaf0ec; line-height: 1.7; }

footer { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: 0.2s;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { background: var(--red); }

@media (min-width: 761px) and (max-width: 1100px) {
  .logic-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logic-flow > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .status-panel { justify-content: flex-start; }
  .panel { padding: 22px 16px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .grid.two, .card-list, .style-profile, .case-context, .logic-flow { grid-template-columns: 1fr; }
}
