/* style.css — 黄金内库 · 暖金色调 · 移动优先 */
:root {
  --gold: #b8860b;
  --gold-deep: #8b6508;
  --gold-light: #f6e7c1;
  --bg: #faf6ee;
  --card: #ffffff;
  --text: #3d3427;
  --muted: #8a7f6d;
  --line: #eadfc8;
  --danger: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.topbar { background: linear-gradient(135deg, #a9790a, #d4af37); color: #fff; box-shadow: 0 2px 10px rgba(139,101,8,.25); }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 14px 16px 10px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand-icon { font-size: 30px; }
.brand h1 { font-size: 20px; letter-spacing: 2px; }
.brand-sub { font-size: 11px; opacity: .85; margin-top: 2px; }
.user-box { font-size: 12px; text-align: right; opacity: .95; line-height: 1.5; }
.user-box a { color: #fff; }

.tabs { max-width: 760px; margin: 0 auto; display: flex; padding: 0 12px; gap: 4px; }
.tab {
  flex: 1; border: none; background: rgba(255,255,255,.14); color: rgba(255,255,255,.85);
  padding: 10px 4px; font-size: 14px; border-radius: 10px 10px 0 0; cursor: pointer; font-family: inherit;
}
.tab.active { background: var(--bg); color: var(--gold-deep); font-weight: 600; }

/* ---------- 主体 ---------- */
#main { max-width: 760px; margin: 0 auto; padding: 16px 12px 40px; }
.page { display: none; }
.page.active { display: block; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 20px; color: var(--gold-deep); }
.stat span { font-size: 11px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(139,101,8,.06); }
.card h3 { font-size: 15px; margin-bottom: 12px; color: var(--gold-deep); }
.section-title { font-size: 15px; color: var(--gold-deep); margin: 18px 2px 10px; }

.toolbar { display: flex; gap: 8px; margin-bottom: 14px; }

/* ---------- 表单 ---------- */
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 2px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px;
  font-size: 14px; font-family: inherit; background: #fffdf7; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-light); border-color: var(--gold); }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }

.form-card { border: 2px solid var(--gold-light); }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }
.hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.btn.primary:active { background: var(--gold-deep); }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: #e6b3ac; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- 金饰卡片 ---------- */
.record-card { position: relative; }
.record-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.record-name { font-size: 16px; font-weight: 600; }
.record-brand { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; background: var(--gold-light); color: var(--gold-deep); border-radius: 20px; padding: 2px 9px; margin: 6px 6px 0 0; }
.record-nums { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; flex-wrap: wrap; }
.record-nums b { color: var(--gold-deep); }
.record-meta { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.record-imgs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.record-imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); cursor: zoom-in; }
.record-ops { display: flex; gap: 8px; margin-top: 12px; }
.img-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.img-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }

/* ---------- 问题 / 故事 ---------- */
.q-row { display: flex; gap: 8px; margin-bottom: 10px; }
.q-row select { flex: 1; }
.q-list { list-style: none; }
.q-list li { padding: 8px 0 8px 22px; position: relative; font-size: 14px; line-height: 1.6; border-bottom: 1px dashed var(--line); }
.q-list li:last-child { border-bottom: none; }
.q-list li::before { content: "❓"; position: absolute; left: 0; font-size: 12px; top: 10px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.proc-badges { margin-top: 10px; }
.story-card .story-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.story-content { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

/* ---------- 其他 ---------- */
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }
.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 20px 0 30px; }
.foot a { color: var(--gold-deep); }
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(50,42,28,.92); color: #fff; padding: 10px 20px; border-radius: 22px;
  font-size: 13px; z-index: 99; max-width: 80vw; text-align: center;
}
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 98; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; }
.login-tip { text-align: center; padding: 60px 20px; }
.login-tip .big { font-size: 44px; margin-bottom: 14px; }
.login-tip a { display: inline-block; margin-top: 16px; background: var(--gold); color: #fff; text-decoration: none; padding: 10px 26px; border-radius: 24px; font-size: 14px; }

/* [GOLD-ACL] 可见范围提示 */
.scope-tip {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #8a7f6d;
  background: #fdf9ee;
  border: 1px dashed var(--line);
  border-radius: 9px;
  padding: 7px 12px;
  margin-bottom: 4px;
  text-align: center;
}
