/* DuoGrader · Claude/Anthropic 风格：米色纸感、赤陶橘、衬线标题、圆角软阴影 */

:root {
  --bg: #f0eee6;          /* oat 背景纸 */
  --surface: #faf9f5;     /* 卡片奶白 */
  --surface-2: #ffffff;
  --ink: #1f1e1d;         /* 主文字 */
  --ink-soft: #3d3929;
  --muted: #6b6a66;
  --accent: #d97757;      /* Claude 赤陶橘 */
  --accent-deep: #c4633f;
  --accent-soft: #f7e8e1;
  --border: #e5e1d5;
  --ok: #6a8a5f;
  --ok-soft: #eaf0e6;
  --warn: #b7791f;
  --warn-soft: #f8efd9;
  --danger: #b3554d;
  --danger-soft: #f7e6e2;
  --serif: "Lora", "Source Serif 4", Georgia, "Songti SC", "SimSun", serif;
  --sans: "Inter", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 30, 29, 0.05), 0 4px 16px rgba(31, 30, 29, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(217, 119, 87, 0.07), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(106, 138, 95, 0.05), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

.wrap { max-width: 780px; margin: 0 auto; padding: 0 18px 80px; }

/* ===== 顶栏 ===== */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(240, 238, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top-inner { max-width: 780px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.logo .mark { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 2px 8px rgba(196, 99, 63, 0.35); }
.logo h1 { font-family: var(--serif); font-size: 19px; margin: 0; letter-spacing: 0.2px; font-weight: 600; }
.logo small { color: var(--muted); font-size: 12px; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
  border-radius: 10px; padding: 7px 12px; font-size: 13px; cursor: pointer; font-family: var(--sans);
  transition: all 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ===== 卡片 ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-top: 18px;
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 2px 4px rgba(31,30,29,0.05), 0 8px 24px rgba(31,30,29,0.08); }
.card h2 {
  font-family: var(--serif); font-size: 17px; margin: 0 0 14px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.card h2 .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* 步骤编号徽章 + 识别提示 */
.stepnum {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  background: var(--accent); color: #fff; font-family: var(--sans); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(217, 119, 87, 0.3);
}
.detect-note {
  background: var(--ok-soft); border: 1px solid #d5e0cf; color: #4c6442;
  border-radius: 10px; padding: 9px 13px; font-size: 12.5px; margin-top: 10px; line-height: 1.55;
}
.seg.big button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; }
.seg.big button b { font-size: 15px; font-weight: 600; }
.seg.big button small { font-size: 11px; color: var(--muted); }
.seg.big button.on small { color: rgba(250, 249, 245, 0.75); }

/* ===== 表单 ===== */
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.seg button {
  flex: 1; min-width: 110px; padding: 9px 10px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  font-size: 13.5px; font-family: var(--sans); transition: all 0.15s ease;
}
.seg button.on { background: var(--ink); color: #faf9f5; border-color: var(--ink); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
textarea, input[type="text"], input[type="password"], select {
  width: 100%; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
  padding: 11px 13px; font-size: 14px; color: var(--ink); font-family: var(--sans); line-height: 1.6;
  resize: vertical; transition: border-color 0.15s ease;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14); }
textarea::placeholder { color: #a8a49a; }

.count-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.count-bar b { color: var(--ink); font-weight: 600; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--border); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: #d5e0cf; }
.pill.soft { background: var(--warn-soft); color: var(--warn); border-color: #ecd9ac; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: #e8c7c0; }

.btn-primary {
  width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; font-family: var(--sans);
  box-shadow: 0 2px 8px rgba(217, 119, 87, 0.32); transition: all 0.15s ease;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-primary.canceling { background: #8a8578; box-shadow: none; }
.btn-primary.canceling:hover { background: #6f6b60; }

/* ===== 流水线 ===== */
.steps { display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 7px 4px; border-radius: 9px; }
.step .st-icon {
  width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 1.6px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent; transition: all 0.2s ease;
}
.step.done .st-icon { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.step.doing .st-icon { border-color: var(--accent); color: var(--accent); animation: pulse 1.1s infinite; }
.step.fail .st-icon { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.step .st-body { flex: 1; font-size: 13.5px; color: var(--muted); }
.step.done .st-body, .step.doing .st-body { color: var(--ink-soft); }
.step .st-note { font-size: 12px; color: var(--muted); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(217,119,87,0.35);} 50% { box-shadow: 0 0 0 6px rgba(217,119,87,0);} }

/* ===== 报告 ===== */
.score-hero { display: flex; align-items: center; gap: 18px; padding: 6px 2px 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.score-big { font-family: var(--serif); font-size: 52px; line-height: 1; color: var(--accent-deep); font-weight: 600; }
.score-big small { font-size: 20px; color: var(--muted); font-weight: 400; }
.score-meta { font-size: 13px; color: var(--muted); display: grid; grid-template-columns: auto auto; gap: 2px 14px; }
.score-meta b { color: var(--ink-soft); font-weight: 600; }

.dual-note { background: var(--accent-soft); border: 1px solid #eed6ca; border-radius: 11px; padding: 10px 14px; font-size: 12.5px; color: #8c4a2f; margin-bottom: 14px; }

table.rep { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rep th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--border); }
table.rep td { padding: 8px; border-bottom: 1px solid #efece2; vertical-align: top; color: var(--ink-soft); }
table.rep tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.chip.error { background: var(--danger-soft); color: var(--danger); }
.chip.awkward { background: var(--warn-soft); color: var(--warn); }
.chip.style { background: #eee9dd; color: var(--muted); }

.en { font-family: Georgia, serif; font-style: italic; }

.essay-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 16px 18px; font-family: var(--serif); font-size: 14.5px; line-height: 1.85;
  white-space: pre-wrap; color: var(--ink-soft);
}
.flag-line { font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border-radius: 9px; padding: 7px 11px; margin: 8px 0; }

ul.problems { margin: 0; padding-left: 18px; }
ul.problems li { margin: 7px 0; color: var(--ink-soft); font-size: 13.5px; }
.advice { background: var(--ok-soft); border-radius: 11px; padding: 12px 15px; font-size: 13.5px; color: #4c6442; margin-top: 12px; }

/* ===== 抽屉 / 弹窗 ===== */
.drawer-mask, .modal-mask { position: fixed; inset: 0; background: rgba(31,30,29,0.32); z-index: 40; display: none; }
.drawer-mask.show, .modal-mask.show { display: block; }
.drawer {
  position: fixed; top: 0; right: -420px; width: min(400px, 92vw); height: 100%; background: var(--surface);
  z-index: 50; transition: right 0.25s ease; display: flex; flex-direction: column;
  border-left: 1px solid var(--border); box-shadow: -8px 0 30px rgba(31,30,29,0.12);
}
.drawer.show { right: 0; }
.drawer-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.drawer-head h3 { font-family: var(--serif); margin: 0; font-size: 16px; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.hist-item { border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; margin-bottom: 9px; cursor: pointer; background: var(--surface-2); transition: border-color 0.15s; }
.hist-item:hover { border-color: var(--accent); }
.hist-item .hi-score { font-family: var(--serif); font-size: 19px; color: var(--accent-deep); font-weight: 600; }
.hist-item .hi-meta { font-size: 11.5px; color: var(--muted); }
.hist-item .hi-del { float: right; color: #b7ab98; cursor: pointer; font-size: 12px; }
.hist-item .hi-del:hover { color: var(--danger); }

.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal.show { display: flex; }
.modal-card { background: var(--surface); border-radius: 16px; width: min(460px, 100%); max-height: 88vh; overflow-y: auto; padding: 22px; box-shadow: 0 20px 60px rgba(31,30,29,0.25); border: 1px solid var(--border); }
.modal-card h3 { font-family: var(--serif); margin: 0 0 16px; font-size: 17px; display: flex; align-items: center; }
.modal-card h3 span { margin-left: auto; cursor: pointer; color: var(--muted); font-family: var(--sans); font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 高级设置折叠条 */
.adv-toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; color: var(--muted); padding: 9px 2px; user-select: none;
  border-top: 1px dashed var(--border); margin-top: 14px;
}
.adv-toggle:hover { color: var(--accent-deep); }
.adv-arrow { display: inline-block; width: 14px; transition: transform 0.15s ease; color: var(--accent); }

/* 一键诊断清单 */
.diag { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.diag-line {
  display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px;
}
.diag-line .d-ico { flex: none; width: 16px; text-align: center; font-weight: 700; }
.diag-line .d-name { flex: none; width: 84px; color: var(--ink-soft); font-weight: 600; }
.diag-line .d-detail { color: var(--muted); word-break: break-all; }
.diag-line.ok { border-color: #d5e0cf; background: var(--ok-soft); }
.diag-line.ok .d-ico, .diag-line.ok .d-name { color: var(--ok); }
.diag-line.bad { border-color: #e8c7c0; background: var(--danger-soft); }
.diag-line.bad .d-ico, .diag-line.bad .d-name { color: var(--danger); }
.diag-line.doing .d-ico { color: var(--accent); }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-ghost { flex: 1; padding: 11px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 14px; color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn-fill { flex: 1.4; padding: 11px; border-radius: 11px; border: none; background: var(--accent); color: #fff; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-fill:hover { background: var(--accent-deep); }

.banner { background: var(--danger-soft); border: 1px solid #e8c7c0; color: var(--danger); border-radius: 12px; padding: 12px 16px; margin-top: 18px; font-size: 13.5px; }
.banner.info { background: var(--ok-soft); border-color: #d5e0cf; color: var(--ok); }

footer { text-align: center; color: #a8a49a; font-size: 12px; margin-top: 34px; line-height: 1.8; }
footer a { color: var(--muted); }

/* ===== 拍照上传 ===== */
.photo-row { display: flex; gap: 12px; }
.photo-group { flex: 1; border: 1.5px dashed var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); }
.pg-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.pg-hint { font-weight: 400; color: #a8a49a; }
.photo-add {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 54px;
  border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 22px; cursor: pointer;
  transition: all 0.15s ease; border: 1px solid transparent;
}
.photo-add:hover { background: var(--accent-soft); color: var(--accent-deep); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .t-del {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(31,30,29,0.6); color: #fff; font-size: 11px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.thumb .t-del:hover { background: var(--danger); }

@media (max-width: 560px) {
  .photo-row { flex-direction: column; }
  .score-big { font-size: 42px; }
  /* ≥16px 防止 iOS Safari 聚焦输入框时自动放大页面 */
  textarea, input[type="text"], input[type="password"], select { font-size: 16px; }
  .card { padding: 16px; }
  table.rep { font-size: 12.5px; }
  table.rep td, table.rep th { padding: 6px 5px; }
  .hide-sm { display: none; }
}
