/* 志说 · 界面样式 */
:root {
  --ink: #241f1a;
  --ink-2: #4a4038;
  --paper: #f4efe4;
  --card: #fffdf8;
  --red: #9e2b25;
  --red-dark: #7c201b;
  --gold: #c19a3f;
  --muted: #837769;
  --line: #e7ddcb;
  --line-2: #f1e9da;
  --green: #2f6f4f;
  --blue: #2f5f7a;
  --amber: #a06a12;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(36, 31, 26, .05), 0 8px 24px rgba(36, 31, 26, .05);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", SimSun, Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: .5px; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
::selection { background: #f0d9b5; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: all .15s ease; white-space: nowrap; font-weight: 500;
}
.btn:hover { border-color: #d6c8ae; background: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #efe7d8; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { color: var(--red); border-color: #e8cfcb; }
.btn-danger:hover { background: #fbefed; }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(158, 43, 37, .08);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 12px;
  background: #f1e9da; color: var(--ink-2); border: 1px solid var(--line);
}
.tag-red { background: #fbeeec; color: var(--red); border-color: #f0d6d2; }
.tag-green { background: #ecf4ee; color: var(--green); border-color: #d5e6da; }
.tag-amber { background: #fbf3e2; color: var(--amber); border-color: #f0e0bd; }
.tag-blue { background: #eef3f7; color: var(--blue); border-color: #d8e3eb; }
.tag-gray { background: #f3f1ec; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px 22px; }
.card-title { font-size: 16px; margin-bottom: 4px; }
.card-desc { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink-2); margin-bottom: 8px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.divider { height: 1px; background: var(--line-2); margin: 18px 0; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- 登录页 ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.landing-left {
  padding: 64px 72px; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(158, 43, 37, .07), transparent 60%),
    linear-gradient(160deg, #fbf7ee 0%, #f4efe4 100%);
  display: flex; flex-direction: column; justify-content: center;
}
.landing-left::before {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(158, 43, 37, .18), transparent);
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 8px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-family: var(--serif); font-size: 20px;
}
.brand-name { font-family: var(--serif); font-size: 20px; letter-spacing: 3px; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.hero-title { font-size: 40px; line-height: 1.35; margin-bottom: 20px; }
.hero-title em { font-style: normal; color: var(--red); }
.hero-desc { font-size: 15px; color: var(--ink-2); max-width: 520px; line-height: 1.9; margin-bottom: 36px; }
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.flow-step {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow); min-width: 108px;
}
.flow-step b { display: block; font-size: 12px; color: var(--red); letter-spacing: 1px; }
.flow-arrow { color: var(--gold); font-size: 18px; }
.hero-points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; }
.point { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }
.point::before { content: "·"; color: var(--red); font-weight: 700; }

.landing-right { display: grid; place-items: center; padding: 40px; background: #fffdf8; border-left: 1px solid var(--line); }
.auth-card { width: 100%; max-width: 360px; }
.auth-tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.auth-tab { padding: 8px 0 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: 0; border-left: 0; border-right: 0; font-size: 15px; }
.auth-tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.auth-card .btn { width: 100%; padding: 11px; margin-top: 8px; }
.auth-foot { margin-top: 20px; font-size: 12px; color: var(--muted); line-height: 1.8; }

/* ---------- 后台布局 ---------- */
.shell { display: grid; grid-template-columns: 226px 1fr; min-height: 100vh; }
.sidebar {
  background: #fbf8f1; border-right: 1px solid var(--line);
  padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 20px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 7px;
  color: var(--ink-2); cursor: pointer; font-size: 14px; border: 1px solid transparent;
}
.nav-item:hover { background: #f3ecdd; }
.nav-item.active { background: var(--card); border-color: var(--line); color: var(--red); font-weight: 600; box-shadow: var(--shadow); }
.nav-item .ico { width: 18px; text-align: center; opacity: .75; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side-foot .who { color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 16px 30px;
  border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, .85); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; }
.topbar .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.content { padding: 26px 30px 60px; max-width: 1320px; width: 100%; }

.quota-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 20px; background: #f6efe1; border: 1px solid var(--line); font-size: 12px; }
.quota-bar { width: 66px; height: 5px; border-radius: 3px; background: #e6dcc8; overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: var(--red); }

/* ---------- 概览 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { padding: 18px 20px; }
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .5px; margin-bottom: 8px; }
.stat .v { font-family: var(--serif); font-size: 28px; line-height: 1.2; }
.stat .v small { font-size: 13px; color: var(--muted); font-family: var(--sans); margin-left: 4px; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 6px; }

.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2);
}
.list-row:last-child { border-bottom: 0; }
.list-row .t { min-width: 0; flex: 1; }
.list-row .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .t span { font-size: 12px; color: var(--muted); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fcf9f2;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: #fcfaf4; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- 素材 ---------- */
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.item:hover { border-color: #d9c9ab; box-shadow: var(--shadow); }
.item.sel { border-color: var(--red); background: #fffaf6; }
.item input[type=checkbox] { margin-top: 4px; width: 15px; height: 15px; accent-color: var(--red); }
.item .body { flex: 1; min-width: 0; }
.item .body b { display: block; font-weight: 600; margin-bottom: 3px; }
.item .body p { margin: 0 0 6px; color: var(--muted); font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.item > .btn { align-self: flex-start; }

/* ---------- 创作 ---------- */
.create-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; align-items: start; }
.progress { padding: 30px; text-align: center; }
.spinner {
  width: 30px; height: 30px; border: 2px solid #e8dcc6; border-top-color: var(--red);
  border-radius: 50%; margin: 0 auto 16px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.steps { display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.step { font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 20px; background: #f3ecdd; }
.step.on { background: #fbeeec; color: var(--red); }
.step.done { background: #ecf4ee; color: var(--green); }

/* ---------- 文章详情 ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start; }
.phone {
  border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: #fff;
  box-shadow: var(--shadow); position: sticky; top: 90px;
}
.phone-screen {
  border-radius: 10px; overflow: hidden; background: #fff; max-height: 640px; overflow-y: auto;
}
.phone-title { padding: 14px 14px 6px; font-family: var(--serif); font-size: 18px; line-height: 1.5; }
.phone-meta { padding: 0 14px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid #eee; margin-bottom: 8px; }
.phone-body { padding: 0 6px 10px; }
.q-list { display: flex; flex-direction: column; gap: 8px; }
.q-item { display: flex; gap: 8px; font-size: 13px; align-items: flex-start; }
.q-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 8px; flex: none; }
.q-dot.bad { background: #c0392b; }
.q-dot.warn { background: var(--gold); }
.score-ring { font-family: var(--serif); font-size: 30px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 24, 18, .42); display: grid; place-items: center;
  z-index: 100; padding: 24px; animation: fade .15s ease;
}
.modal {
  background: var(--card); border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(20, 15, 10, .25);
  animation: pop .18s ease;
}
.modal.wide { max-width: 860px; }
.modal-head { padding: 20px 24px 0; display: flex; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px 24px; }
.modal-foot { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }

/* ---------- Toast ---------- */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 8px; background: #2b2620; color: #fff; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); animation: pop .2s ease; max-width: 560px;
}
.toast.err { background: #8f2721; }
.toast.ok { background: #2f5f45; }

/* ---------- 套餐 ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.plan.current { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.plan h4 { font-size: 16px; margin-bottom: 4px; }
.plan .price { font-family: var(--serif); font-size: 26px; color: var(--red); margin: 10px 0 2px; }
.plan ul { padding-left: 18px; margin: 12px 0 0; color: var(--ink-2); font-size: 13px; }
.plan li { margin-bottom: 6px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .create-grid, .detail-grid { grid-template-columns: 1fr; }
  .phone { position: static; }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
  .landing { grid-template-columns: 1fr; }
  .landing-left { padding: 40px 28px; }
  .landing-right { border-left: 0; border-top: 1px solid var(--line); }
  .hero-title { font-size: 30px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 10px; }
  .side-brand, .side-foot { display: none; }
  .nav-item { white-space: nowrap; padding: 7px 10px; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .stat-grid, .plan-grid, .grid-2 { grid-template-columns: 1fr; }
  .table { font-size: 13px; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}
