/* 书香上海·阅荐好书 H5 — mobile first, no external fonts or assets. */
:root {
  --ink: #2b2420;
  --muted: #7d726a;
  --paper: #f7f1e6;
  --card: #fffdf8;
  --line: #e7dccb;
  --brand: #7a2e1f;
  --brand-deep: #5c2016;
  --gold: #b8893c;
  --ok: #2f6f4f;
  --ok-bg: #e7f2ea;
  --err: #b3261e;
  --err-bg: #fbeae8;
  --info-bg: #f3ecdc;
  --radius: 14px;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.7 var(--sans);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.35; margin: 0; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 253, 248, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-seal {
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font: 600 15px/1 var(--serif);
}
.brand-text { font: 600 15px/1.2 var(--serif); }
.brand-text em { font-style: normal; color: var(--brand); margin-left: 4px; }
.topnav { display: flex; gap: 14px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 4px 0; }
.topnav a[aria-current="page"] { color: var(--brand); font-weight: 600; border-bottom: 2px solid var(--brand); }

.page { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 14px 28px; }

/* hero */
.hero {
  position: relative; overflow: hidden;
  margin: -16px -14px 16px; padding: 36px 22px 28px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(184, 137, 60, .45), transparent 45%),
    linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
}
.hero::after {
  content: "阅"; position: absolute; right: -10px; bottom: -40px;
  font: 700 180px/1 var(--serif); color: rgba(255, 255, 255, .06);
}
.hero-kicker { margin: 0 0 6px; font-size: 13px; letter-spacing: .2em; color: #f1d9a8; }
.hero-title { font-size: 34px; letter-spacing: .06em; }
.hero-title span { display: block; font-size: 26px; color: #f1d9a8; }
.hero-slogan { margin: 10px 0 14px; font: 16px/1.5 var(--serif); }
.hero-lead { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .86); }
.hero-status {
  display: inline-block; margin-top: 16px; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
}
.hero-status.status-open::before { content: "● "; color: #9fe0b5; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.hero-actions .btn { flex: 1; }

/* cards & sections */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(60, 40, 20, .04);
}
.card.narrow { max-width: 420px; margin: 8px auto 14px; }
.card-title { font-size: 22px; margin-bottom: 6px; }
.section-title { display: flex; align-items: baseline; gap: 8px; font-size: 18px; margin-bottom: 12px; }
.section-title span { font: 600 13px/1 var(--sans); color: var(--gold); letter-spacing: .06em; }
.sub-title { font-size: 15px; margin: 14px 0 6px; }
.page-head { margin: 4px 2px 14px; }
.page-head h1 { font-size: 22px; }
.back { display: inline-block; margin-bottom: 6px; font-size: 14px; text-decoration: none; color: var(--muted); }
.muted { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.fine { color: var(--muted); font-size: 12.5px; line-height: 1.6; margin: 12px 2px; }
.note { margin: 10px 0 0; font-size: 13.5px; color: var(--brand); }

.kinds { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.kinds li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--info-bg);
}
.kinds span { color: var(--muted); font-size: 13px; text-align: right; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 12px; }
.timeline li::before {
  content: ""; position: absolute; left: -21px; top: 7px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid var(--card);
}
.timeline time { font-weight: 600; font-size: 14px; }
.timeline p { margin: 0; color: var(--muted); font-size: 13.5px; }

.rules { margin: 0; padding-left: 20px; }
.rules li { margin: 4px 0; font-size: 14px; }
.rules.dots { list-style: disc; }

.ways { display: grid; gap: 10px; }
.way { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.way p { margin: 4px 0 0; font-size: 14px; }

.orgs dl { margin: 0; display: grid; grid-template-columns: 5em 1fr; gap: 6px 10px; font-size: 13.5px; }
.orgs dt { color: var(--muted); }
.orgs dd { margin: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-deep); }
.btn-primary:disabled { background: #c9b8ab; cursor: not-allowed; }
.btn-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn-ghost { background: var(--card); color: var(--brand); border-color: var(--brand); white-space: nowrap; }
.btn-ghost:disabled { color: var(--muted); border-color: var(--line); }
.btn-block { width: 100%; margin-top: 8px; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }

/* alerts & tags */
.alert { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 0 0 12px; }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: var(--info-bg); color: var(--ink); }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; white-space: nowrap; text-decoration: none;
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-go { background: var(--brand); color: #fff; }
.tag-muted { background: #eee8de; color: var(--muted); }

/* forms */
.form { display: grid; gap: 14px; }
.form-section { font-size: 15px; color: var(--brand); padding-top: 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; }
.field-label i { color: var(--err); font-style: normal; }
.field-label small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.field input, .field textarea, .code-row input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: 16px/1.5 var(--sans); color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 220px; }
.field input:focus, .field textarea:focus { outline: 2px solid rgba(122, 46, 31, .25); border-color: var(--brand); }
.has-error input, .has-error textarea { border-color: var(--err); }
.field-error { color: var(--err); font-size: 13px; margin: 0; }
.code-row { display: flex; gap: 8px; }
.counter { justify-self: end; font-size: 12.5px; color: var(--muted); }
.counter.over { color: var(--err); font-weight: 600; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.agree input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.agree.has-error span { color: var(--err); }

/* category choices */
.choices { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
}
.choice-icon {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font: 600 18px/1 var(--serif);
}
.choice-body { flex: 1; display: grid; }
.choice-body span { color: var(--muted); font-size: 13px; }
.choice.is-closed { opacity: .7; }
.choice.is-closed .choice-icon { background: #b9aa9b; }
.choice.is-done .choice-icon { background: var(--ok); }

/* my submissions */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.list-item div { display: grid; min-width: 0; }
.list-item b { font-family: var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item small { color: var(--muted); font-size: 12.5px; }
.list-kind { font-size: 12px; color: var(--gold); }
.empty { text-align: center; padding: 36px 16px; }
.empty p { color: var(--muted); margin: 0 0 14px; }

.receipt-head { text-align: center; padding-bottom: 14px; border-bottom: 1px dashed var(--line); margin-bottom: 14px; }
.receipt-head h1 { font-size: 22px; margin-top: 10px; word-break: break-word; }
.kv { display: grid; grid-template-columns: 5em 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.body-text { margin-top: 16px; }
.body-text h2 { font-size: 15px; color: var(--brand); margin-bottom: 6px; }
.prose { font: 15.5px/1.9 var(--serif); word-break: break-word; }
.prose p { margin: 0 0 .8em; }

.footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.footer p { margin: 2px 0; }
.footer-logout { margin-top: 8px; display: flex; gap: 10px; justify-content: center; }

@media (min-width: 720px) {
  .page { padding-top: 24px; }
  .hero { margin: 0 0 18px; border-radius: var(--radius); }
  .ways { grid-template-columns: 1fr 1fr; }
}

/* attachment slots (image_text / video) */
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot, .dropzone {
  position: relative; overflow: hidden; cursor: pointer;
  display: grid; place-items: center; text-align: center;
  border: 1.5px dashed #d6c6ae; border-radius: 10px; background: #fff;
  color: var(--muted); font-size: 12.5px;
}
.slot { aspect-ratio: 3 / 4; }
.dropzone { min-height: 128px; padding: 16px; }
.slot-empty { display: grid; gap: 2px; }
.slot-empty b { font-size: 24px; font-weight: 300; color: var(--brand); line-height: 1; }
.slot-empty small { font-size: 12px; margin-top: 4px; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px;
  font-size: 11.5px; color: #fff; background: rgba(0, 0, 0, .5);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dropzone .slot-meta { position: static; background: none; color: var(--ink); font-size: 14px; white-space: normal; }
.slot-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.slot-bar i { display: block; width: 0; height: 100%; background: var(--gold); }
.slot.is-filled, .dropzone.is-filled { border-style: solid; border-color: var(--gold); }
.slot:active, .dropzone:active { background: var(--info-bg); }
.tips { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
