/* Inner Wisdom Content Studio
   设计方向：编辑部 —— 暖白底、朱红重点色、无卡片。
   分区靠分割线和留白，不靠盒子和阴影。 */

:root {
  --paper:      #fbfaf7;   /* 页面底色，带一点暖 */
  --paper-2:    #f4f2ec;   /* 次级底色：输入框 hover、表头 */
  --ink:        #16150f;   /* 正文与标题 */
  --ink-2:      #56534a;   /* 次级文字 */
  --ink-3:      #86827a;   /* 说明文字 */
  --ink-4:      #a9a49a;   /* 表头、占位符 */
  --rule:       #e3e0d6;   /* 主分割线 */
  --rule-2:     #eeebe3;   /* 次级分割线（表格行）*/
  --accent:     #b5442e;   /* 朱红：只用于真正要点的动作 */
  --accent-dim: #f3e6e2;   /* 朱红的浅底 */
  --ok:         #4a6b3d;
  --ok-bg:      #eaf0e4;
  --warn:       #8a6a1f;
  --warn-bg:    #f7f0dd;

  --sans: "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
          "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */

#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 196px;
  flex-shrink: 0;
  border-right: 1px solid var(--rule);
  padding: 30px 0;
  display: flex;
  flex-direction: column;
}

.brand { padding: 0 24px 26px; }
.brand span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav a {
  display: block;
  padding: 7px 24px;
  color: var(--ink-2);
  font-size: 13.5px;
  border-left: 2px solid transparent;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--accent);
}

.sidebar-foot { margin-top: auto; padding: 18px 24px 0; }
.sidebar-foot button {
  background: none; border: none; padding: 0;
  color: var(--ink-4); font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.sidebar-foot button:hover { color: var(--accent); }

.main { flex: 1; min-width: 0; padding: 32px 40px 96px; max-width: 1080px; }

/* ---------- 标题区 ---------- */

.page-head { margin-bottom: 26px; }
.page-head h2 {
  margin: 0 0 3px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-head p { margin: 0; color: var(--ink-3); font-size: 13px; }

/* ---------- 分区：不是卡片，是一段有标题的内容 ---------- */

.card {
  border-top: 1px solid var(--rule);
  padding: 20px 0 26px;
  margin: 0;
}
.card:first-of-type { border-top: 2px solid var(--ink); }
.card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card h3 .hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 8px;
  letter-spacing: 0;
}

.row { display: flex; gap: 18px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.stack > * + * { margin-top: 12px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.right { text-align: right; }

/* ---------- 按钮 ---------- */

button, .btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 3px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  letter-spacing: 0.01em;
}
button:hover { background: #9c3826; border-color: #9c3826; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 次要动作：不抢主按钮的注意力 */
button.ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--rule);
  font-weight: 500;
}
button.ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink-4); }

button.small { padding: 5px 12px; font-size: 12.5px; }

button.danger { background: transparent; color: var(--accent); border-color: var(--rule); font-weight: 500; }
button.danger:hover { background: var(--accent-dim); border-color: var(--accent); }

/* gold 是旧类名，保留兼容：等同主按钮 */
button.gold { background: var(--accent); border-color: var(--accent); color: #fff; }
button.gold:hover { background: #9c3826; border-color: #9c3826; }

/* ---------- 表单 ---------- */

input[type="text"], input[type="password"], input[type="url"],
input[type="date"], select, textarea {
  font-family: inherit;
  font-size: 13.5px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  line-height: 1.6;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
}
textarea { resize: vertical; }

label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  margin-bottom: 5px;
}
.field { margin-bottom: 16px; }

/* 长文编辑：这是每天待最久的地方，单独给它衬线和宽行距 */
textarea.prose {
  min-height: 460px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.9;
  padding: 22px 24px;
  background: #fff;
  border-color: var(--rule);
}
textarea.mid { min-height: 160px; }

/* ---------- 标记 ---------- */

.pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--paper-2);
  color: var(--ink-2);
  margin: 0 6px 6px 0;
  letter-spacing: 0.02em;
}
.pill.draft     { background: var(--paper-2); color: var(--ink-2); }
.pill.ready     { background: var(--warn-bg); color: var(--warn); }
.pill.published { background: var(--ok-bg);   color: var(--ok); }
.pill.archived  { background: #efefec; color: var(--ink-4); }

.chip {
  display: inline-block;
  padding: 5px 13px;
  margin: 0 7px 7px 0;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-4); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 表格 ---------- */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  padding: 0 10px 9px 0;
}
td { padding: 11px 10px 11px 0; border-top: 1px solid var(--rule-2); vertical-align: top; }
tr:hover td { background: rgba(0, 0, 0, 0.012); }

/* ---------- 数字概览 ---------- */

.stat-row { display: flex; gap: 40px; padding-bottom: 4px; }
.stat { flex: 0 0 auto; min-width: 0; background: none; border: none; padding: 0; }
.stat b {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat span { font-size: 12px; color: var(--ink-3); }

/* ---------- 提示 ---------- */

.banner {
  padding: 11px 14px;
  border-radius: 3px;
  margin-bottom: 20px;
  font-size: 13px;
  border-left: 2px solid;
}
.banner.warn  { background: var(--warn-bg);   border-color: var(--warn);   color: #6b551c; }
.banner.error { background: var(--accent-dim); border-color: var(--accent); color: #7d2f26; }
.banner.ok    { background: var(--ok-bg);     border-color: var(--ok);     color: #345034; }

#toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px;
  border-radius: 3px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  z-index: 50;
  max-width: 380px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { background: var(--accent); }

.save-state { font-size: 11.5px; color: var(--ink-4); letter-spacing: 0.04em; }
.save-state.saving { color: var(--warn); }
.save-state.failed { color: var(--accent); }

/* ---------- 生成进度 ---------- */

.steps { list-style: none; padding: 0; margin: 14px 0 0; }
.steps li {
  padding: 6px 0 6px 20px;
  color: var(--ink-4);
  font-size: 13.5px;
  position: relative;
}
.steps li::before {
  content: "";
  position: absolute;
  left: 0; top: 12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1px solid var(--rule);
}
.steps li.doing { color: var(--ink); font-weight: 600; }
.steps li.doing::before { background: var(--accent); border-color: var(--accent); }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--ink); border-color: var(--ink); }
.steps li.failed { color: var(--accent); }
.steps li.failed::before { background: var(--accent); border-color: var(--accent); }

/* ---------- 登录 ---------- */

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: var(--paper);
}
.login-box {
  width: 320px;
  padding: 0 8px;
}
.login-box span.eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 5px;
}
.login-box h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.login-box p { margin: 0 0 26px; color: var(--ink-3); font-size: 13px; }
.login-box button { width: 100%; margin-top: 16px; padding: 11px; }

/* ---------- 首页：今天的任务 ---------- */

.eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 5px;
}

.today-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}
.today-head h2 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.streak {
  flex-shrink: 0;
  text-align: right;
  padding-left: 22px;
  border-left: 2px solid var(--ink);
}
.streak b {
  display: block;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.streak span { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.streak.hot { border-left-color: var(--accent); }
.streak.hot b { color: var(--accent); }
.streak.none { border-left-color: var(--rule); }
.streak.none b { color: var(--ink-4); }

/* 今天要做的那件事，页面上最重的一块 */
.hero {
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 22px 24px 24px;
  margin-bottom: 22px;
  background: #fff;
}
.hero-body { margin: 18px 0 20px; }
.hero-body h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.hero-body p { margin: 0; }

.hero-done {
  border-top: 2px solid var(--ok);
  padding: 20px 0 24px;
  margin-bottom: 22px;
}
.hero-done p { margin: 0 0 14px; font-size: 16px; font-weight: 600; }

button.big { font-size: 15px; padding: 12px 26px; }

/* ---------- 步骤条 ---------- */

.stepbar {
  display: flex;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  gap: 0;
  flex-wrap: wrap;
}
.stepbar li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-4);
  padding-right: 14px;
  margin-right: 14px;
  border-right: 1px solid var(--rule);
}
.stepbar li:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.stepbar li b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stepbar li.done { color: var(--ink-2); }
.stepbar li.done b { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.stepbar li.now { color: var(--ink); font-weight: 700; }
.stepbar li.now b { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 编辑页顶部的「下一步」 ---------- */

.next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-left: 3px solid var(--accent);
  background: #fff;
  padding: 16px 20px;
  margin-bottom: 26px;
  border-radius: 0 4px 4px 0;
}
.next h3 { margin: 0 0 3px; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.next p { margin: 0; }
.next > div:last-child { flex-shrink: 0; }
.next.done { border-left-color: var(--ok); }

/* ---------- 中英对照 ---------- */

.bi-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bi-tabs { display: flex; gap: 0; }
.bi-tab {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-weight: 500;
  border-radius: 0;
  padding: 6px 14px;
  font-size: 13px;
}
.bi-tab:first-child { border-radius: 3px 0 0 3px; }
.bi-tab:last-child { border-radius: 0 3px 3px 0; border-left: none; }
.bi-tab:hover { background: var(--paper-2); color: var(--ink); }
.bi-tab.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bi-tab.on:hover { background: var(--ink); }

.bilingual {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}
.bi-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.bi-head span {
  padding: 8px 18px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
}
.bi-head span:first-child { border-right: 1px solid var(--rule); }

.bi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule-2);
}
.bi-row:last-child { border-bottom: none; }
.bi-row:hover { background: #fdfcf9; }

.bi-en, .bi-cn { padding: 15px 18px; }
.bi-en {
  border-right: 1px solid var(--rule-2);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.85;
}
.bi-cn {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
  background: rgba(0, 0, 0, 0.008);
}

.scope-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--rule-2);
  margin-bottom: 4px;
}

/* ---------- 移动端 ---------- */

@media (max-width: 820px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--rule); padding: 18px 0 0; }
  .brand { padding: 0 18px 14px; }
  .nav { display: flex; overflow-x: auto; }
  .nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 8px 14px;
  }
  .nav a.active { border-left: none; border-bottom-color: var(--accent); }
  .sidebar-foot { display: none; }
  .main { padding: 22px 18px 64px; }
  textarea.prose { min-height: 320px; font-size: 15px; padding: 16px; }
  .stat-row { gap: 28px; }
  .stat b { font-size: 26px; }

  .today-head { flex-direction: row; align-items: center; }
  .today-head h2 { font-size: 21px; }
  .streak b { font-size: 26px; }
  .hero { padding: 18px 16px 20px; }
  .hero-body h3 { font-size: 17px; }
  button.big { width: 100%; }
  .next { flex-direction: column; align-items: flex-start; }
  .next > div:last-child { width: 100%; }
  .next button { width: 100%; }
  .stepbar li { font-size: 11.5px; padding-right: 9px; margin-right: 9px; }

  /* 手机上左右并排太窄，改成上下堆叠 */
  .bi-head { display: none; }
  .bi-row { grid-template-columns: 1fr; }
  .bi-en { border-right: none; border-bottom: 1px dashed var(--rule); font-size: 15px; }
  .bi-cn { padding-top: 10px; }
  .bi-cn::before {
    content: "中文";
    display: block;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--ink-4);
    margin-bottom: 4px;
  }
  .bi-toolbar { flex-direction: column; align-items: stretch; }
  .scope-switch { flex-direction: column; align-items: flex-start; gap: 6px; }
}
