:root {
  --bg: #eef1ea;
  --brand: #1e5c3f;
  --brand-dark: #174a33;
  --brand-light: #e7f0ea;
  --text: #24312b;
  --text-muted: #64736b;
  --border: #d9e0d8;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(30, 60, 45, 0.08), 0 1px 2px rgba(30, 60, 45, 0.05);
  --red: #c0392b;
  --red-bg: #fbeceb;
  --orange: #c97a16;
  --orange-bg: #fdf3e3;
  --green: #2e7d32;
  --green-bg: #e9f4ea;
  --radius: 10px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部 ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.brand-name { font-size: 17px; font-weight: 700; color: var(--brand-dark); }

.coze-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  color: var(--text-muted);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #b7bfb9; }
.coze-status[data-state="connected"] .status-dot { background: var(--green); }
.coze-status[data-state="connected"] { color: var(--green); border-color: #bfdcc2; background: var(--green-bg); }
.coze-status[data-state="demo"] .status-dot { background: var(--orange); }
.coze-status[data-state="demo"] { color: var(--orange); border-color: #ecd9b5; background: var(--orange-bg); }

/* ---------- 首屏 ---------- */
.hero {
  text-align: center;
  padding: 44px 0 20px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  color: var(--brand-dark);
}
.hero-sub { margin: 0 0 10px; font-size: 17px; color: var(--text); font-weight: 600; }
.hero-desc {
  margin: 0 auto 26px;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 14px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.step-num {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step-text { font-size: 14px; font-weight: 600; }

/* 进度步骤状态 */
.progress-steps li { opacity: 0.55; }
.progress-steps li.active { opacity: 1; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.progress-steps li.active .step-num { background: var(--brand); color: #fff; animation: pulse 1.4s infinite; }
.progress-steps li.done .step-num { background: var(--green); color: #fff; }
.progress-steps li.done { opacity: 1; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 92, 63, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(30, 92, 63, 0); }
}

/* ---------- 面板 ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
}
.panel h2 { margin: 0 0 18px; font-size: 19px; color: var(--brand-dark); }

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 92, 63, 0.12);
}
textarea { resize: vertical; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  background: #fff;
}
.checkbox-item:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
}
.checkbox-item input { accent-color: var(--brand); }

/* 上传区 */
.dropzone {
  border: 1.5px dashed #b9c6bc;
  border-radius: var(--radius);
  background: #fafcf9;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); outline: none; }
.dropzone.dragover { border-color: var(--brand); background: var(--brand-light); }
.dz-icon { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.dz-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--text); }
.dz-hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.dz-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.dz-file-info { display: flex; flex-direction: column; min-width: 0; }
.dz-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dz-file-size { font-size: 12px; color: var(--text-muted); }
.dz-remove {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}
.dz-remove:hover { color: var(--red); border-color: var(--red); }

/* 错误提示 */
.form-error, .progress-error {
  margin: 4px 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  border: 1px solid #f2c8c3;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(30, 92, 63, 0.25); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 6px 10px; font-weight: 600; }
.btn-ghost:hover:not(:disabled) { background: var(--brand-light); }

.form-actions { display: flex; gap: 12px; margin-top: 4px; }
.form-actions .btn-primary { min-width: 180px; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 审查过程 ---------- */
.progress-msg { margin: 18px 0 4px; color: var(--text-muted); font-size: 14px; text-align: center; }

/* ---------- 结果 ---------- */
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.result-head h2 { margin-bottom: 2px; }
.result-status { margin: 0; color: var(--green); font-size: 13px; font-weight: 600; }

.demo-badge {
  display: inline-block;
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid #ecd9b5;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

.demo-notice {
  background: var(--orange-bg);
  border: 1px solid #ecd9b5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #8a5a12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.demo-notice p { margin: 0; flex: 1 1 260px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.summary-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafcf9;
  padding: 14px;
  text-align: center;
}
.summary-num { display: block; font-size: 26px; font-weight: 700; color: var(--text); }
.summary-label { font-size: 12px; color: var(--text-muted); }
.summary-item.risk-high .summary-num { color: var(--red); }
.summary-item.risk-medium .summary-num { color: var(--orange); }
.summary-item.risk-low .summary-num { color: var(--green); }

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.check-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fafcf9;
}
.check-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.check-text { margin: 0; font-size: 13px; color: var(--text-muted); white-space: pre-wrap; }
.check-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1ee;
  color: var(--text-muted);
  font-weight: 600;
}
.check-badge.ok { background: var(--green-bg); color: var(--green); }
.check-badge.warn { background: var(--orange-bg); color: var(--orange); }

.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.filter-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.result-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* 意见卡片 */
.opinion-list { display: flex; flex-direction: column; gap: 14px; }
.opinion-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  background: #fff;
}
.opinion-card[data-risk="high"] { border-left-color: var(--red); }
.opinion-card[data-risk="medium"] { border-left-color: var(--orange); }
.opinion-card[data-risk="low"] { border-left-color: var(--green); }

.opinion-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.opinion-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; flex: 1 1 200px; }

.risk-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.risk-badge.high { background: var(--red-bg); color: var(--red); }
.risk-badge.medium { background: var(--orange-bg); color: var(--orange); }
.risk-badge.low { background: var(--green-bg); color: var(--green); }

.opinion-block { margin-top: 8px; }
.opinion-block h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.opinion-block p { margin: 0; font-size: 14px; white-space: pre-wrap; }
.opinion-block.suggestion { background: var(--brand-light); border-radius: var(--radius-sm); padding: 12px 14px; }
.opinion-block.suggestion h4 { color: var(--brand-dark); }
.copy-suggestion {
  margin-top: 12px;
  align-self: flex-start;
  font-size: 13px;
  padding: 6px 14px;
}

.empty-note { color: var(--text-muted); font-size: 14px; }

.raw-preview {
  margin-top: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.raw-preview summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }
.raw-preview pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  color: var(--text-muted);
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
}

/* ---------- 历史记录 ---------- */
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.history-head h2 { margin-bottom: 8px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding: 12px 2px;
  font-size: 14px;
}
.history-list li:first-child { border-top: none; }
.history-empty { color: var(--text-muted); justify-content: flex-start !important; }
.history-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.history-meta { color: var(--text-muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.history-meta .hi { color: var(--red); font-weight: 700; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0 26px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.site-footer p { margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .hero { padding-top: 30px; }
  .hero h1 { font-size: 24px; }
  .hero-sub { font-size: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .btn-primary { min-width: 0; width: 100%; }
  .form-actions .btn-secondary { width: 100%; }
  .result-actions { flex-direction: column; align-items: stretch; }
  .result-btns { flex-direction: column; }
  .result-btns .btn { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .checkbox-group { flex-direction: column; align-items: stretch; }
  .checkbox-item { justify-content: center; }
  .panel { padding: 18px 16px; }
  .header-inner { height: 56px; }
  .brand-name { font-size: 15px; }
  .coze-status { font-size: 12px; padding: 4px 10px; }
}