/* Aru 信箱 · 提交页与后台共用的底层样式。
   手机优先。深浅色跟系统走。embed 模式下去掉自己的页头和背景，交给宿主。 */

:root {
  color-scheme: light dark;
  --bg: #f7f3f1;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #fffcfb;
  --surface-2: #f0eaf1;
  --line: rgba(74, 66, 112, 0.1);
  --line-strong: rgba(74, 66, 112, 0.18);
  --text: #343250;
  --text-dim: #7a7792;
  --accent: #756eae;
  --accent-strong: #5b5493;
  --accent-soft: rgba(117, 110, 174, 0.12);
  --pearl-pink: #f4b9d3;
  --pearl-lilac: #c3b5f2;
  --pearl-sky: #a9dcf0;
  --pearl-mint: #bfeedd;
  --pearl: linear-gradient(135deg, var(--pearl-pink), var(--pearl-lilac) 48%, var(--pearl-sky) 82%, var(--pearl-mint));
  --danger: #c0546c;
  --ok: #3f8466;
  --radius: 22px;
  --gap: 14px;
  --shadow: 0 22px 48px rgba(83, 70, 128, 0.08), 0 2px 8px rgba(83, 70, 128, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15131f;
    --surface: rgba(36, 32, 52, 0.78);
    --surface-solid: #1f1c2c;
    --surface-2: #2a2639;
    --line: rgba(236, 228, 255, 0.1);
    --line-strong: rgba(236, 228, 255, 0.18);
    --text: #f2eff9;
    --text-dim: #aba6c1;
    --accent: #c4b9f2;
    --accent-strong: #ddd4fb;
    --accent-soft: rgba(196, 185, 242, 0.14);
    --pearl-pink: #d98fb4;
    --pearl-lilac: #9d8de0;
    --pearl-sky: #79bcd8;
    --pearl-mint: #86ccb5;
    --danger: #f095aa;
    --ok: #8ccfad;
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(0, 0, 0, 0.22);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 10% -6%, color-mix(in srgb, var(--pearl-sky) 34%, transparent), transparent 32rem),
    radial-gradient(circle at 92% 6%, color-mix(in srgb, var(--pearl-pink) 30%, transparent), transparent 30rem),
    radial-gradient(circle at 60% 110%, color-mix(in srgb, var(--pearl-lilac) 22%, transparent), transparent 34rem);
  background-attachment: fixed;
}

button, input, textarea, select { -webkit-tap-highlight-color: transparent; }

body.embed { background: transparent; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px calc(120px + env(safe-area-inset-bottom));
}

body.embed .wrap { padding-top: 8px; }
body.embed .page-head { display: none; }

.page-head { margin: 4px 2px 26px; }
.page-head h1 {
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.08;
  margin: 5px 0 10px;
  letter-spacing: -0.045em;
}
.page-head p { margin: 0; color: var(--text-dim); font-size: 14.5px; max-width: 34rem; }
.eyebrow {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.category-page-head { margin-bottom: 18px; }
.category-identity { display: flex; align-items: center; gap: 14px; }
.category-title { min-width: 0; }
.category-title h1 { font-size: 27px; margin: 3px 0 3px; }
.category-title p { font-size: 13.5px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: var(--gap);
}

/* 表单分组不再套卡片：只留输入框自己的边，分组靠标题和留白区分。 */
.form-section { margin-bottom: 8px; }
.form-section .field:last-child { margin-bottom: 0; }

.section-title {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 34px 2px 14px;
  text-transform: none;
}

/* ---------- 第一屏：分类卡片墙 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 纸质票根（信箱分类、官网讲解与入口共用） ----------
   纸面画在 ::before 上再用遮罩挖出两侧半圆缺口，::after 是缺口之间的虚线撕口；
   阴影用 filter 加在元素本身，才能跟着票根轮廓走。--notch 是撕口离顶部的距离。 */
.ticket {
  --notch: 66px;
  --paper: #fffaf2;
  --paper-glow: transparent;
  position: relative;
  isolation: isolate;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  counter-increment: ticket;
  filter: drop-shadow(0 10px 18px rgba(83, 70, 128, 0.09)) drop-shadow(0 1px 2px rgba(83, 70, 128, 0.08));
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
}
.ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 8px;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 100% 0, var(--paper-glow), transparent 60%),
    linear-gradient(170deg, rgba(255, 255, 255, 0.6), transparent 55%);
  -webkit-mask:
    radial-gradient(circle at 0 var(--notch), transparent 8px, #000 8.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--notch), transparent 8px, #000 8.5px) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle at 0 var(--notch), transparent 8px, #000 8.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--notch), transparent 8px, #000 8.5px) right / 51% 100% no-repeat;
}
.ticket::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  top: var(--notch);
  border-top: 1.5px dashed rgba(120, 100, 150, 0.28);
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .ticket { --paper: #272335; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.35)); }
  .ticket::before {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
      radial-gradient(circle at 100% 0, var(--paper-glow), transparent 60%),
      linear-gradient(170deg, rgba(255, 255, 255, 0.05), transparent 55%);
  }
  .ticket::after { border-top-color: rgba(236, 228, 255, 0.18); }
}
:is(a, button).ticket { cursor: pointer; }
:is(a, button).ticket:hover { transform: translateY(-3px) rotate(-0.6deg); }
:is(a, button).ticket:nth-child(even):hover { transform: translateY(-3px) rotate(0.6deg); }
:is(a, button).ticket:active { transform: scale(0.98); }
.ticket-no {
  position: absolute;
  top: 19px;
  right: 17px;
  font: 600 10.5px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  opacity: 0.75;
}
.ticket-no::before { content: "No." counter(ticket, decimal-leading-zero); }
.ticket-no[data-fixed]::before { content: attr(data-fixed); }
.ticket-set { counter-reset: ticket; }

/* 撕票：脚本把票根复制成上下两片盖在原位，上片沿锯齿撕口翻落，下片轻轻一顿。 */
.ticket.ticket-torn { visibility: hidden; }
.ticket-piece { transition: none !important; }

.cat {
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  font: inherit;
  color: inherit;
  min-width: 0;
  min-height: 150px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
/* 图标直接坐在卡片上，不再套底框；颜色来自图标自带的 Aru 渐变。 */
.cat-icon { display: inline-flex; align-items: center; justify-content: center; }
.cat .cat-icon { height: 34px; }
.cat-icon .icon { width: 34px; height: 34px; }
.cat-icon.large { flex: 0 0 auto; }
.cat-icon.large .icon { width: 46px; height: 46px; }
.cat .name { display: block; font-weight: 650; margin-top: 28px; font-size: 15px; letter-spacing: -0.01em; }
.cat .blurb { display: block; color: var(--text-dim); font-size: 11.5px; line-height: 1.45; margin-top: 4px; }


/* ---------- 信箱页头 ---------- */
.mailbox-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mailbox-header .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  background: none;
  box-shadow: 0 5px 14px rgba(150, 128, 210, 0.3);
}
.mailbox-header .brand { font-family: "Didot", "Bodoni 72", "Iowan Old Style", Georgia, serif; font-weight: 500; font-size: 21px; letter-spacing: 0; }
.mailbox-guides { color: var(--text-dim); font-size: 14px; text-decoration: none; }
.mailbox-guides:hover { color: var(--text); }
body.embed .mailbox-header { display: none; }
.page-head h1 { font-family: "Didot", "Bodoni 72", "Iowan Old Style", "Songti SC", Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.category-title h1 { font-family: inherit; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field > label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
.req { color: var(--accent); margin-left: 3px; }
.hint { color: var(--text-dim); font-size: 12.5px; margin: -2px 0 7px; }

input[type="text"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
textarea { resize: none; overflow: hidden; min-height: 44px; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: var(--surface-solid);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.chip-other { width: 100%; margin-top: 8px; }

.notice {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 15px;
  padding: 12px 14px;
  font-size: 13.5px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: var(--gap);
}
.notice.warn { background: rgba(179, 38, 30, 0.1); color: var(--danger); }

.env-summary {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
}

/* ---------- 附件 ---------- */
.drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop.hot { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { color: var(--text); display: block; font-size: 15px; margin-bottom: 3px; }

.media-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.media-item {
  display: flex;
  gap: 11px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px;
}
.media-thumb {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 9px;
  background: var(--line) center/cover no-repeat;
  position: relative;
  overflow: hidden;
}
.media-thumb .badge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 1px 0;
}
.media-body { flex: 1; min-width: 0; }
.media-body .meta { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; gap: 8px; }
.media-body .meta .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-body input[type="text"], .media-body select { padding: 8px 10px; font-size: 14px; margin-top: 6px; background: var(--surface); }
.media-row { display: flex; gap: 7px; }
.media-row select { flex: 0 0 40%; }

.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 7px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.media-item.failed { outline: 1px solid var(--danger); }

.link-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn.danger { color: var(--danger); }

/* ---------- 底部提交条 ---------- */
.footbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(150%) blur(22px);
  -webkit-backdrop-filter: saturate(150%) blur(22px);
  border-top: 1px solid var(--line);
}
.footbar .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 15px;
  border: 1px solid transparent;
  padding: 13px 18px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  flex: 1;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: 0.5; cursor: default; }
@media (prefers-color-scheme: dark) { .btn:not(.ghost) { color: #211d33; } }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: none; flex: 0 0 auto; }
.btn.small { padding: 8px 13px; font-size: 14px; flex: 0 0 auto; border-radius: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 40;
  max-width: 90vw;
  text-align: center;
}

.done { text-align: center; max-width: 460px; margin: 11vh auto 0; padding: 34px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.done .mark {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.done .mark .icon { width: 56px; height: 56px; }
.done h2 { margin: 12px 0 6px; }
.done .code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 9px 15px;
  margin: 10px 0 4px;
  font-size: 17px;
  letter-spacing: 0.04em;
}
.done p { color: var(--text-dim); font-size: 14px; }

.hidden { display: none !important; }
.shake { animation: shake 0.3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---------- 后台 ---------- */
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }
.admin-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-head h1 { font-size: 20px; margin: 0; }
.admin-head .muted { color: var(--text-dim); font-size: 13px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input[type="text"] { width: auto; flex: 1 1 150px; padding: 9px 11px; font-size: 14px; }
.filters select { flex: 0 1 auto; }

.pills { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-dim); border-radius: 999px; padding: 6px 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill-icon { width: 14px; height: 14px; }
.pill[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.split { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(320px, 380px) 1fr; align-items: start; } }

.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 11px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%;
}
.row.active { border-color: var(--accent); background: var(--accent-soft); }
.row-cat-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.row-cat-icon .icon { width: 16px; height: 16px; }
.row .row-main { flex: 1; min-width: 0; }
.row .row-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .row-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.row input[type="checkbox"] { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); }

.tag { display: inline-block; font-size: 11px; border-radius: 5px; padding: 1px 6px; background: var(--surface-2); color: var(--text-dim); margin-left: 5px; }
.tag.new { background: var(--accent-soft); color: var(--accent); }
.tag.fixed { background: rgba(47, 111, 79, 0.14); color: var(--ok); }

.detail h2 { font-size: 18px; margin: 0 0 4px; }
.detail .sub { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.detail-meta { display: flex; align-items: flex-start; gap: 7px; }
.detail-meta-icon { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }
.detail .kv { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; gap: 5px 12px; font-size: 14px; }
.detail .kv dt { color: var(--text-dim); }
.detail .kv dd { margin: 0; overflow-wrap: anywhere; }
.detail pre {
  background: var(--surface-2); border-radius: 10px; padding: 11px;
  font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0;
}
.detail .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shot { background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.shot img, .shot video { width: 100%; display: block; background: #000; }
.shot img { cursor: zoom-in; }
.shot .cap { padding: 7px 9px; font-size: 12px; color: var(--text-dim); }
.shot .cap b { color: var(--text); font-weight: 600; }

.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9);
  display: flex; align-items: center; justify-content: center; z-index: 60; cursor: zoom-out;
}
.lightbox img { max-width: 96vw; max-height: 92vh; }

.login { max-width: 380px; margin: 14vh auto; }
.empty { color: var(--text-dim); font-size: 14px; padding: 26px 6px; text-align: center; }

@media (max-width: 370px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .cat-grid { gap: 9px; }
  .cat { min-height: 142px; padding: 13px 12px; }
  .cat .name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 官方支持与隐私页 ---------- */
.site-header,
.site-footer,
.info-wrap,
.policy-wrap {
  width: min(1080px, calc(100% - 36px));
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(150, 128, 210, 0.3);
}

.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav a,
.language-switch,
.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
}
.site-nav a:hover,
.site-footer a:hover { color: var(--text); }
.language-switch {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 7px 12px;
  cursor: pointer;
}

.info-wrap { padding: 54px 0 90px; }
.policy-head h1 {
  margin: 12px 0 16px;
  font-size: clamp(42px, 8vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.policy-lead {
  max-width: 670px;
  margin: 0;
  color: var(--text-dim);
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.55;
}
.primary-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 12px 19px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 9px 20px color-mix(in srgb, var(--accent) 22%, transparent);
}
.primary-link.inline { margin-top: 8px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.info-card,
.policy-body {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.info-card { padding: 24px; }
.info-card-number { color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: 0.1em; }
.info-card h2 { margin: 28px 0 9px; font-size: 20px; letter-spacing: -0.025em; }
.info-card p { color: var(--text-dim); font-size: 14px; margin: 0 0 16px; }
.text-link { color: var(--accent); font-size: 14px; font-weight: 600; text-underline-offset: 3px; }

.home-links { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.home-link-card { display: block; color: var(--text); text-decoration: none; transition: transform 0.16s ease, border-color 0.16s ease; }
a.home-link-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.home-link-card .text-link { display: inline-block; text-decoration: underline; }

.policy-wrap { max-width: 860px; padding: 70px 0 90px; }
.policy-head { padding: 0 clamp(4px, 3vw, 24px) 34px; }
.policy-head h1 { font-size: clamp(40px, 7vw, 66px); }
.policy-date { color: var(--accent); font-size: 13px; font-weight: 650; }
.policy-body { padding: clamp(25px, 6vw, 58px); }
.policy-body section + section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 28px; }
.policy-body h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -0.02em; }
.policy-body p { margin: 0 0 12px; color: var(--text-dim); }
.about-body .section-number { display: block; margin-bottom: 14px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; }

.site-footer {
  min-height: 82px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-dim);
  font-size: 13px;
}

@media (max-width: 760px) {
  .info-wrap { padding-top: 26px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-card h2 { margin-top: 15px; }
  .policy-wrap { padding-top: 38px; }
}

@media (max-width: 430px) {
  .site-header, .site-footer, .info-wrap, .policy-wrap { width: min(100% - 28px, 1080px); }
  .site-nav { gap: 10px; }
  .policy-body { border-radius: 22px; }
}

/* ---------- 填写页：一张信纸 ----------
   信纸上下边是邮票式的齿孔；分类图标做成贴在角上的邮票；
   输入框不再是盒子，单行是一道墨线，多行是横格纸。 */
.wrap.letter {
  --paper: #fffaf2;
  --rule: rgba(120, 100, 150, 0.16);
  --ink-line: rgba(90, 76, 130, 0.28);
  position: relative;
  isolation: isolate;
  padding-left: 34px;
  padding-right: 34px;
  padding-top: 44px;
  margin-top: 10px;
}
.wrap.letter::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 12px calc(96px + env(safe-area-inset-bottom)) 12px;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(175deg, rgba(255, 255, 255, 0.7), transparent 40%);
  -webkit-mask:
    radial-gradient(circle 6px at 50% 0, transparent 96%, #000) top / 18px 51% repeat-x,
    radial-gradient(circle 6px at 50% 100%, transparent 96%, #000) bottom / 18px 51% repeat-x;
  mask:
    radial-gradient(circle 6px at 50% 0, transparent 96%, #000) top / 18px 51% repeat-x,
    radial-gradient(circle 6px at 50% 100%, transparent 96%, #000) bottom / 18px 51% repeat-x;
  filter: drop-shadow(0 18px 30px rgba(83, 70, 128, 0.12));
}
@media (prefers-color-scheme: dark) {
  .wrap.letter {
    --paper: #252132;
    --rule: rgba(236, 228, 255, 0.1);
    --ink-line: rgba(236, 228, 255, 0.24);
  }
  .wrap.letter::before {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
      linear-gradient(175deg, rgba(255, 255, 255, 0.04), transparent 40%);
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.4));
  }
}

/* 分类图标：一枚贴在信纸上的邮票 */
.letter .category-identity { gap: 18px; }
.letter .cat-icon.large {
  width: 68px;
  height: 80px;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--paper) 82%, var(--pearl-lilac) 18%);
  -webkit-mask:
    linear-gradient(#000 0 0) center / calc(100% - 10px) calc(100% - 10px) no-repeat,
    radial-gradient(circle 3.4px, transparent 96%, #000) 0 0 / 10px 10px round;
  mask:
    linear-gradient(#000 0 0) center / calc(100% - 10px) calc(100% - 10px) no-repeat,
    radial-gradient(circle 3.4px, transparent 96%, #000) 0 0 / 10px 10px round;
  outline: 1px solid var(--ink-line);
  outline-offset: -9px;
  rotate: -4deg;
  filter: drop-shadow(0 4px 8px rgba(83, 70, 128, 0.14));
}
.letter .cat-icon.large .icon { width: 38px; height: 38px; }

/* 分组标题：小号字后面拖一道虚线，像信纸上的栏目 */
.letter .section-title { display: flex; align-items: center; gap: 12px; margin-left: 0; margin-right: 0; }
.letter .section-title::after { content: ""; flex: 1; border-top: 1.5px dashed var(--ink-line); }

/* 输入：墨线与横格 */
.letter input[type="text"],
.letter select,
.letter textarea {
  background-color: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink-line);
  border-radius: 0;
  padding: 8px 2px 7px;
}
.letter select { padding-right: 30px; }
.letter textarea {
  border-bottom: 0;
  padding: 0 2px;
  line-height: 32px;
  min-height: 128px;
  background-image: linear-gradient(transparent 31px, var(--rule) 31px, var(--rule) 32px);
  background-size: 100% 32px;
  background-attachment: local;
}
.letter input[type="text"]:focus,
.letter select:focus { border-bottom-color: var(--accent); background-color: transparent; }
.letter textarea:focus { background-color: transparent; }
.letter input::placeholder, .letter textarea::placeholder { color: color-mix(in srgb, var(--text-dim) 70%, transparent); }

/* 选项像纸签，附件区像一块待贴照片的位置 */
.letter .chip { background: transparent; border: 1.2px dashed var(--ink-line); border-radius: 6px; }
.letter .chip[aria-pressed="true"] { border-style: solid; }
.letter .drop { border-radius: 6px; border-color: var(--ink-line); background: transparent; }

/* 底栏：一条撕下来的纸边 */
body:has(.wrap.letter) .footbar {
  border-top: 0;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  -webkit-mask: radial-gradient(circle 5px at 50% 0, transparent 96%, #000) top / 14px 100% repeat-x;
  mask: radial-gradient(circle 5px at 50% 0, transparent 96%, #000) top / 14px 100% repeat-x;
  padding-top: 18px;
}
@media (max-width: 480px) {
  .wrap.letter { padding-left: 26px; padding-right: 26px; }
  .wrap.letter::before { left: 6px; right: 6px; }
}

/* Touch feedback follows each control's shape, without WebKit's tap rectangle. */
:where(a, button, [role="button"], summary) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
:where(button, .soft-button, .store-link, .guide-card, .entry, .site-nav a, .mailbox-guides) {
  transition: scale 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}
:where(button, .soft-button, .store-link, .guide-card, .entry, .site-nav a, .mailbox-guides):active {
  scale: .975;
  filter: brightness(1.06);
}
:where(button, a):focus:not(:focus-visible) { outline: none; }
:where(button, a):focus-visible { outline: 2px solid #aa96df; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  :where(button, a) { transition: none !important; }
  :where(button, a):active { scale: 1; }
}
