/* 品牌：LIVE 紫色方块 + 白色粗斜体字，延续小助手头像 */
@font-face { font-family: "Anton"; src: url("/fonts/anton.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("/fonts/dm-serif-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
:root {
  --live: #5B0F8E;        /* 头像紫 */
  --live-deep: #430A69;   /* 按下、深色文字 */
  --lilac: #F3EEF9;       /* 页面底色 */
  --lilac-line: #E2D6EF;  /* 分隔线 */
  --white: #FFFFFF;
  --ink: #1B0B2C;         /* 正文 */
  --muted: #6F6385;
  --danger: #B3261E;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mark: "Helvetica Neue", Arial, sans-serif; /* LIVE 字样的粗斜体 */
  --num: "Anton", "Helvetica Neue", "Arial Narrow", sans-serif; /* 编号：窄长粗体数字 */
  --deco: "DM Serif Display", Georgia, "Times New Roman", serif; /* 英文装饰：复古杂志斜体 */
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif; /* 中文标题：思源宋体 Medium */
  --w: 600px;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--lilac); color: var(--ink); overflow-x: clip;
  font: 16px/1.65 var(--sans); padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--live); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.live-mark { font-family: var(--mark); font-style: italic; font-weight: 800; letter-spacing: -.02em; }

/* ---------- 顶栏：整条紫色 ---------- */
.bar { background: var(--live); color: var(--white); }
.bar .in {
  max-width: var(--w); margin: 0 auto; padding: 12px 16px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 8px; color: var(--white); }
.brand .live-mark { font-size: 27px; line-height: 1; }
.brand .sub { font-size: 16px; font-weight: 500; }
.bar nav { display: flex; gap: 18px; font-size: 15px; font-weight: 400; }
.bar nav a, .bar nav button { text-decoration: none; color: rgba(255,255,255,.82); }

main { max-width: var(--w); margin: 0 auto; padding: 0 16px 96px; outline: none; }

/* ---------- 首页大标题区：紧接顶栏的紫色 ---------- */
.hero {
  position: relative; overflow: hidden; background: var(--live); color: var(--white);
  margin: 0 calc(50% - 50vw); padding: 6px calc(50vw - 50% + 16px) 18px;
}
.hero::after {
  content: "LIVE"; position: absolute; right: -0.12em; bottom: -0.3em;
  font: italic 800 150px/1 var(--mark); letter-spacing: -.04em; color: rgba(255,255,255,.08);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.deco { font-family: var(--deco); font-style: italic; font-weight: 400; letter-spacing: 0; }
.vol { display: flex; align-items: center; gap: 12px; }
.vol .deco { font-size: 28px; line-height: 1; }
.chip {
  display: inline-block; background: var(--white); color: var(--live);
  font-weight: 600; font-size: 12px; padding: 3px 9px; border-radius: 6px;
}
.hero h1 { font-family: var(--serif); font-size: 29px; line-height: 1.4; font-weight: 500; margin: 10px 0 6px; text-wrap: balance; letter-spacing: .02em; }
.hero .desc { margin: 0 0 12px; font-family: var(--serif); font-weight: 500; font-size: 16px; letter-spacing: .04em; color: rgba(255,255,255,.85); }
.hero .row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero .count { font-size: 14px; color: rgba(255,255,255,.85); }
.hero .next { font-size: 12px; color: rgba(255,255,255,.65); margin: 10px 0 0; line-height: 1.5; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: var(--live); color: var(--white); font-weight: 600;
  padding: 12px 22px; border-radius: 12px; text-decoration: none; cursor: pointer; font-size: 16px;
}
.btn:active { background: var(--live-deep); }
.btn.white { background: var(--white); color: var(--live); }
.btn.ghost { background: transparent; color: var(--live); box-shadow: inset 0 0 0 2px var(--live); }
.btn.small { padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: var(--danger); }
.btn[disabled] { opacity: .5; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* ---------- 标签 ---------- */
.filterbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 16px 0 12px; border-bottom: 1px solid var(--lilac-line); }
.scopes { display: flex; gap: 22px; }
.scopes a { text-decoration: none; color: var(--muted); font-size: 17px; padding-bottom: 8px; margin-bottom: -1px; }
.scopes a[aria-current="page"] { color: var(--live); font-weight: 600; box-shadow: inset 0 -3px 0 var(--live); }
.sorts { display: flex; align-items: center; gap: 6px; padding-bottom: 9px; font-size: 13px; }
.sorts a { text-decoration: none; color: var(--muted); }
.sorts a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.sorts .dot { color: var(--lilac-line); }
.hero a.count { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.4); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 10px 0 2px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--lilac-line); }
.tabs { display: flex; gap: 26px; margin: 12px 0 10px; }
.tabs a { text-decoration: none; color: var(--muted); font-size: 17px; font-weight: 400; padding-bottom: 4px; }
.tabs a[aria-current="page"] { color: var(--live); font-weight: 600; box-shadow: inset 0 -3px 0 var(--live); }

/* ---------- 纸条 ---------- */
.slips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.slip { position: relative; min-width: 0; background: var(--white); border-radius: 6px; padding: 14px 18px 12px; box-shadow: inset 0 3px 0 var(--live); }
.slip a.cover { position: absolute; inset: 0; z-index: 1; border-radius: 6px; }
.letter-head { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 4px; }
.dear { font-family: var(--deco); font-style: italic; font-size: 20px; color: var(--live); line-height: 1; }
.pick { display: inline-flex; align-items: baseline; gap: 3px; background: var(--lilac); color: var(--live); font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 5px; }
.pick .live-mark { font-size: 11px; }
.postmark {
  margin-left: auto; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--live); color: var(--live);
  display: grid; place-items: center; transform: rotate(-8deg);
}
.postmark span { width: 38px; height: 38px; border-radius: 50%; border: 1px dashed var(--live); display: grid; place-items: center; font: 400 17px/1 var(--num); letter-spacing: .02em; padding-top: 1px; }
.slip .text { font-size: 17px; line-height: 1.85; font-weight: 400; letter-spacing: .01em; color: #2a1d3b; margin: 0 0 12px; white-space: pre-wrap; word-break: break-word; }
.letter-foot { border-top: 1px solid var(--lilac-line); padding-top: 9px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.from { min-width: 0; flex: 1 1 160px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.from b { min-width: 0; font-family: var(--serif); font-weight: 500; font-size: 13px; color: var(--live); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.from span { flex: none; }
.slip .counts { display: flex; gap: 14px; font-size: 13px; color: var(--muted); font-family: var(--serif); font-weight: 500; }
.slip .counts i { font: italic 400 16px/1 var(--deco); color: var(--live); margin-left: 3px; }
.no {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px;
  background: var(--live); color: var(--white); font: 400 23px/1 var(--num); letter-spacing: .03em; padding-top: 2px;
}
.more { display: block; margin: 18px auto 0; }
.empty-note { color: var(--muted); text-align: center; padding: 44px 0; font-size: 16px; }

.hero .btn.white { padding: 9px 18px; font-size: 15px; }
.fab {
  position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 5;
  height: 48px; padding: 0 18px 0 14px; gap: 6px; border-radius: 24px; font-size: 15px; overflow: hidden; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(67,10,105,.32); transition: width .2s ease, padding .2s ease;
}
.fab .plus { font-size: 24px; line-height: 1; font-weight: 400; }
.fab.mini { width: 48px; padding: 0; justify-content: center; }
.fab.mini .label { display: none; }
@media (min-width: 640px) { .fab { right: calc(50% - 300px + 16px); } }

/* ---------- 详情 ---------- */
.reader-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 12px; font-size: 15px; color: var(--muted); font-weight: 400; }
.reader-top a { text-decoration: none; color: var(--live); }
.reader .slip { padding: 18px 20px 14px; min-height: 240px; touch-action: pan-y; }
.reader .dear { font-size: 26px; }
.reader .postmark { width: 58px; height: 58px; }
.reader .postmark span { width: 48px; height: 48px; font-size: 22px; }
.reader .slip .text { font-size: 19px; line-height: 1.9; margin-top: 6px; }
.reply { margin: 16px 0 0; padding: 12px 14px; background: var(--lilac); border-radius: 10px; font-size: 15px; }
.reply { font-family: var(--serif); font-weight: 500; margin-bottom: 14px; }
.reply .live-mark { color: var(--live); font-size: 16px; margin-right: 6px; }
.stamp-time { font-size: 13px; color: var(--muted); margin-top: 14px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; color: var(--muted); font-size: 14px; }
.pager button {
  background: var(--white); border: 0; border-radius: 12px; width: 48px; height: 48px; cursor: pointer;
  font-size: 22px; color: var(--live); font-weight: 800;
}
.pager button[disabled] { opacity: .35; cursor: default; }
.reacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.react {
  border: 0; background: var(--white); border-radius: 12px; padding: 12px 0 10px; cursor: pointer;
  font-size: 14px; font-weight: 500; font-family: var(--serif); color: var(--muted); display: grid; gap: 4px; line-height: 1.2;
}
.react .n { font: italic 400 24px/1 var(--deco); color: var(--live); min-height: 24px; }
.react[aria-pressed="true"] { background: var(--live); color: rgba(255,255,255,.85); }
.react[aria-pressed="true"] .n { color: var(--white); }
.reader-actions { display: flex; gap: 10px; margin-top: 12px; }
.reader-actions .share { flex: 1; }
.reader-actions .report { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 8px; font-size: 14px; }

/* ---------- 表单页 ---------- */
.page-title { font-family: var(--serif); font-size: 30px; font-weight: 500; margin: 4px 0 8px; line-height: 1.4; letter-spacing: .02em; }
.page-deco { font-family: var(--deco); font-style: italic; font-size: 30px; color: var(--live); margin: 22px 0 0; line-height: 1.1; }
.lead { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--white); padding: 5px; border-radius: 14px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; padding: 10px 0; cursor: pointer; border-radius: 10px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--live); color: var(--white); }
.prompt { font-family: var(--serif); font-size: 19px; font-weight: 500; margin: 6px 0 12px; line-height: 1.5; letter-spacing: .02em; }
.letterbox { background: var(--white); border-radius: 6px; box-shadow: inset 0 3px 0 var(--live); padding: 16px 18px 6px; }
.letterbox:focus-within { box-shadow: inset 0 3px 0 var(--live), 0 0 0 2px var(--live); }
.letterbox .dear { font-size: 26px; display: block; margin-bottom: 6px; }
textarea {
  width: 100%; min-height: 200px; resize: vertical; border: 0; background: transparent; padding: 0;
  font-size: 17px; line-height: 1.85; color: #2a1d3b;
}
textarea:focus { outline: none; }
input[type=text], input[type=password], input[type=date], select {
  width: 100%; border: 2px solid transparent; background: var(--white); border-radius: 12px; padding: 11px 13px; font-size: 16px;
}
input:focus { border-color: var(--live); outline: none; }
.counter { text-align: right; font-size: 13px; color: var(--muted); margin: 6px 0 16px; font-weight: 400; }
.counter.bad { color: var(--danger); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0 0 18px; color: #4a3d5e; }
.agree input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--live); flex: none; }
.err { color: var(--danger); font-size: 14px; margin: 0 0 12px; min-height: 1em; font-weight: 600; }
.wide { width: 100%; }

.code-box { background: var(--live); color: var(--white); border-radius: var(--r); padding: 22px 18px 16px; text-align: center; margin: 16px 0; }
.code-box .label { font-size: 13px; opacity: .8; }
.code-box .code { font: 400 44px/1.3 var(--num); letter-spacing: .08em; }
.code-box .linkish { color: var(--white); }
.follow { margin-top: 26px; background: var(--white); border-radius: var(--r); padding: 20px; text-align: center; }
.follow p { margin: 0 0 6px; }
.follow img { width: 150px; height: 150px; display: block; margin: 12px auto 0; }

.rules h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 28px 0 8px; }
.rules p, .rules li { color: #3b3050; }
.rules ul { padding-left: 20px; }
.support { background: var(--white); padding: 14px 16px; border-radius: 12px; border-left: 0; }

.archive { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.archive a { display: flex; gap: 14px; align-items: center; padding: 14px; text-decoration: none; background: var(--white); border-radius: var(--r); }
.archive .t { font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.5; }
.archive .m { font-size: 13px; color: var(--muted); }
.tagline { text-align: center; margin: 40px 0 0; font: italic 400 22px/1.2 var(--deco); color: var(--live); }
.foot { margin: 12px 0 0; text-align: center; font-size: 14px; color: var(--muted); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

/* ---------- 弹窗 ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(27,11,44,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: var(--lilac); width: 100%; max-width: var(--w); max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.sheet img.card { width: 100%; display: block; border-radius: 12px; }
.sheet .hint { text-align: center; font-size: 15px; font-weight: 500; margin: 14px 0; color: var(--live); }
.reasons { display: grid; gap: 8px; margin-bottom: 14px; }
.reasons label { display: flex; gap: 10px; align-items: center; background: var(--white); padding: 12px 14px; border-radius: 12px; font-weight: 400; }
.reasons input { accent-color: var(--live); }
.sheet-btns { display: flex; gap: 10px; }
.sheet-btns .btn { flex: 1; }

#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 9px 18px; border-radius: 10px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30;
}
#toast.on { opacity: 1; }
