/* ===== 小红书内容参谋台 · 设计系统(浅色 · 暖纸专业) ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --bg: #f4f1ec;
  --bg-grad: radial-gradient(1100px 560px at 82% -8%, rgba(232, 69, 95, 0.06), transparent 60%),
    radial-gradient(900px 500px at -8% 108%, rgba(184, 134, 63, 0.05), transparent 55%);
  --panel: #ffffff;
  --panel-2: #faf8f4;
  --panel-3: #f1ede6;
  --line: #e6e0d6;
  --line-soft: #efe9df;
  --ink: #232020;
  --ink-dim: #6a655e;
  --ink-faint: #9b958c;
  --accent: #e8455f;
  --accent-d: #cf3450;
  --accent-soft: rgba(232, 69, 95, 0.1);
  --gold: #b8863f;
  --ok: #3f9d6b;
  --warn: #cc8a33;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 14px 40px -22px rgba(60, 40, 30, 0.4);
  --shadow-soft: 0 2px 10px -4px rgba(60, 40, 30, 0.12);
  --sans: 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Noto Serif SC', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ddd5c8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #cabfae; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fffefb, #f6f2eb);
  display: flex; flex-direction: column; padding: 26px 18px;
}
.brand { display: flex; flex-direction: column; gap: 3px; padding: 0 8px 22px; }
.brand .mark {
  font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: 0.5px;
  color: var(--ink); display: flex; align-items: center; gap: 9px;
}
.brand .mark i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px rgba(232, 69, 95, 0.5); display: inline-block; font-style: normal;
}
.brand .sub { font-size: 11.5px; color: var(--ink-faint); letter-spacing: 2px; padding-left: 18px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav .grp { font-size: 11px; color: var(--ink-faint); letter-spacing: 2px; padding: 16px 12px 7px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--ink-dim); font-size: 14px; font-weight: 400; transition: 0.18s; position: relative;
}
.nav a .ic { font-style: normal; width: 18px; text-align: center; opacity: 0.85; font-size: 15px; }
.nav a:hover { background: var(--panel-3); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-d); font-weight: 500; }
.nav a.active::before {
  content: ''; position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.sidebar .foot { margin-top: auto; padding: 14px 10px 0; font-size: 11.5px; color: var(--ink-faint); border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: baseline; gap: 16px; padding: 30px 44px 16px; }
.topbar h1 { font-family: var(--serif); font-weight: 600; font-size: 25px; margin: 0; letter-spacing: 0.5px; }
.topbar .desc { color: var(--ink-dim); font-size: 13.5px; }
.content { padding: 8px 44px 64px; max-width: 1240px; }

/* ---------- 卡片 / 面板 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow-soft);
}
.card.tight { padding: 16px 18px; }
.card-h { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.card-h h3 { font-family: var(--serif); font-weight: 600; font-size: 16.5px; margin: 0; }
.card-h .tag-mini { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 980px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 7px; letter-spacing: 0.5px; }
.field .hint { color: var(--ink-faint); font-size: 11.5px; font-weight: 300; }
input[type='text'], input[type='number'], textarea, select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-s); padding: 11px 13px; font-family: var(--sans); font-size: 14px;
  font-weight: 400; transition: 0.18s; resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 120px; line-height: 1.7; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 11px 20px; font-family: var(--sans); font-size: 14px;
  font-weight: 500; cursor: pointer; transition: 0.18s; letter-spacing: 0.5px;
}
.btn:hover { border-color: #d6cdbd; background: var(--panel-2); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-d)); border-color: var(--accent-d); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 标签 / chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px;
  color: var(--ink-dim); font-weight: 400;
}
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-d); }
.chip.gold { color: var(--gold); border-color: rgba(184, 134, 63, 0.3); background: rgba(184, 134, 63, 0.08); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------- 上传区 ---------- */
.drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center;
  color: var(--ink-faint); cursor: pointer; transition: 0.18s; background: var(--panel-2);
}
.drop:hover, .drop.over { border-color: var(--accent); color: var(--ink-dim); background: #fff6f7; }
.drop .big { font-size: 26px; color: var(--ink-dim); margin-bottom: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,0.55); color: #fff; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; }

/* ---------- 结果区 ---------- */
.result h4 { font-family: var(--serif); font-weight: 600; font-size: 14.5px; color: var(--accent-d); margin: 0 0 6px; letter-spacing: 0.5px; }
.result .blk { margin-bottom: 18px; }
.result p { margin: 0 0 8px; color: var(--ink); font-size: 14px; }
.result ul { margin: 6px 0; padding-left: 18px; }
.result li { margin-bottom: 5px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-faint); }
.kv dd { margin: 0; color: var(--ink); }
.prompt-box {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 12px 14px; font-size: 13px; line-height: 1.7; color: var(--ink-dim); position: relative; white-space: pre-wrap;
}
.prompt-box .copy { position: absolute; top: 8px; right: 8px; }
/* 可编辑文案框 */
.edit-box {
  width: 100%; background: var(--panel-2); border: 1px dashed var(--line); border-radius: var(--radius-s);
  padding: 12px 14px; font-family: var(--sans); font-size: 14px; line-height: 1.8; color: var(--ink);
  transition: 0.18s; resize: vertical;
}
.edit-box:focus { outline: none; border-style: solid; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.edit-row { position: relative; margin-bottom: 9px; }
.edit-row .copy { position: absolute; top: 7px; right: 7px; opacity: 0; transition: 0.15s; }
.edit-row:hover .copy, .edit-row:focus-within .copy { opacity: 1; }
.field-note { font-size: 11.5px; color: var(--ink-faint); margin: 2px 0 10px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- 评分 / 图表 ---------- */
.score-wrap { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.radar { flex: 0 0 auto; }
.overall { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.overall .num { font-family: var(--serif); font-size: 46px; font-weight: 700; line-height: 1; color: var(--accent); }
.overall .lab { font-size: 12px; color: var(--ink-faint); letter-spacing: 1px; }
.bars { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 86px 1fr 38px; gap: 10px; align-items: center; }
.bar-row .bn { font-size: 12.5px; color: var(--ink-dim); }
.bar-track { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width 0.6s ease; }
.bar-row .bv { font-size: 12.5px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.score-notes { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
@media (max-width: 720px) { .score-notes { grid-template-columns: 1fr; } }
.score-notes div { font-size: 12.5px; color: var(--ink-dim); }
.score-notes b { color: var(--ink); font-weight: 500; }

/* ---------- 库 / 卡片网格 ---------- */
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.libcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: 0.18s; display: flex; flex-direction: column; box-shadow: var(--shadow-soft); }
.libcard:hover { transform: translateY(-3px); border-color: #d8cfbf; box-shadow: var(--shadow); }
.libcard .cover { aspect-ratio: 3/4; background: var(--panel-2); overflow: hidden; position: relative; }
.libcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.libcard .cover.empty { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--serif); font-size: 30px; aspect-ratio: 16/10; }
.libcard .body { padding: 13px 14px; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.libcard .t { font-weight: 500; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.libcard .s { font-size: 12px; color: var(--ink-faint); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.libcard .meta { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 11px; color: var(--ink-faint); }
.type-badge { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.5px; }
.type-account { background: rgba(63,157,107,0.13); color: #2f7d53; }
.type-note { background: var(--accent-soft); color: var(--accent-d); }
.type-generate { background: rgba(184,134,63,0.16); color: var(--gold); }
.type-cover { background: rgba(90,120,200,0.14); color: #4a5fa6; }

/* ---------- 工具栏 / 切换 ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .search { flex: 1; min-width: 220px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; }
.seg button { background: transparent; border: none; color: var(--ink-dim); padding: 7px 14px; border-radius: 7px; cursor: pointer; font-family: var(--sans); font-size: 13px; transition: 0.15s; }
.seg button.on { background: var(--accent); color: #fff; }

/* ---------- 杂项 ---------- */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn:not(.primary) .spinner { border-color: rgba(0,0,0,0.2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--ink-faint); }
.empty-state { text-align: center; padding: 80px 20px; color: var(--ink-faint); }
.empty-state .big { font-family: var(--serif); font-size: 40px; color: var(--line); margin-bottom: 12px; }
.divider { height: 1px; background: var(--line-soft); margin: 22px 0; }

.toast-wrap { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #2c2826; color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow); animation: rise 0.25s; }
.toast.err { background: var(--accent-d); }
.toast.ok { background: var(--ok); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 模态 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(40,30,25,0.4); backdrop-filter: blur(4px); z-index: 800; display: flex; align-items: flex-start; justify-content: center; padding: 50px 20px; overflow: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-width: 880px; width: 100%; box-shadow: var(--shadow); }
.modal .mh { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.modal .mh h3 { font-family: var(--serif); margin: 0; font-size: 18px; flex: 1; }
.modal .mb { padding: 22px 24px; }
.x-btn { cursor: pointer; color: var(--ink-faint); font-size: 20px; line-height: 1; }
.x-btn:hover { color: var(--ink); }

@media (max-width: 760px) {
  .sidebar { display: none; }
  .topbar, .content { padding-left: 20px; padding-right: 20px; }
}
