:root {
  --bg: #f3f0ea;
  --panel: #fffcf7;
  --line: #d9d1c4;
  --text: #1f1b16;
  --muted: #6f675c;
  --accent: #215e52;
  --accent-fill: #2a7a69;
  --ok: #2d6a4f;
  --bad: #9b2c2c;
  --warn: #b45309;
  --hero: 1.15rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Noto Sans CJK SC", "WenQuanYi Micro Hei", "Noto Sans", sans-serif;
}

.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tabs { display: flex; gap: 6px; }

.tab, .ghost, .primary, .file-btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.tab.active, .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ghost:hover, .file-btn:hover, .tab:hover { border-color: var(--accent); }

.file-btn { display: inline-flex; align-items: center; }
.file-btn input { display: none; }

.status-row { margin-left: auto; display: flex; gap: 12px; font-size: 13px; }
.status { color: var(--muted); }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

.page { min-height: calc(100vh - 54px); }
.hidden { display: none !important; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.side {
  border-right: 1px solid var(--line);
  background: #f7f3ec;
  padding: 14px 12px;
  min-height: calc(100vh - 54px);
}

.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
}

.side h2 {
  font-size: 13px;
  text-transform: none;
  color: var(--muted);
  margin: 8px 8px 6px;
}

.content {
  padding: 20px 28px 48px;
  max-width: 920px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.field {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

select, input, textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
}

.hint, .muted, .caption { color: var(--muted); }
.hint { margin: 0 0 16px; }
.warn-card {
  border-color: #e8c48a;
  background: #fff7ed;
  color: #7c4a12;
  margin-bottom: 12px;
}
.warn-card a { color: #9a3412; }

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem;
  font-weight: 650;
}

.history, .modes { display: flex; flex-direction: column; gap: 4px; }
.modes { margin-bottom: 16px; }

.mode, .hist {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
}

.mode.active, .hist.active { background: #e7efe9; }
.mode:hover, .hist:hover { background: #eee8dc; }
.mode .sub, .hist .sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.hero { font-size: var(--hero); font-weight: 650; white-space: pre-wrap; }
.copy-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e4efe9;
  font-size: 12px;
}

.issue-orig { color: var(--bad); text-decoration: line-through; }
.issue-fix { color: var(--ok); }

.settings {
  padding: 24px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #1f1b16;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}

.seg time {
  color: var(--muted);
  font-size: 12px;
  margin-right: 8px;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
