/* 纸鸢 · 匿名许愿墙 —— 黄昏天空主题 */
:root {
  --ink: #f7f2e9;
  --ink-dim: #bdb6cc;
  --ink-faint: #9c97b4;
  --amber: #ffb86b;
  --pink: #ff8fb1;
  --sky: #7fd1ff;
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 18px 46px rgba(4, 6, 18, 0.45);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

/* 关键：modal / dot 上的 display 会覆盖 hidden 属性，必须显式兜住 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  background-color: #070a18;
  background-image:
    radial-gradient(1100px 780px at 50% 112%, rgba(255, 184, 107, 0.26), transparent 62%),
    radial-gradient(880px 620px at 12% 2%, rgba(127, 209, 255, 0.16), transparent 60%),
    radial-gradient(760px 560px at 92% 28%, rgba(255, 143, 177, 0.13), transparent 62%),
    linear-gradient(180deg, #070a18 0%, #111834 44%, #251c3a 72%, #42293b 100%);
  background-attachment: fixed;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* 跟随鼠标的柔光 */
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 184, 107, 0.15), rgba(255, 143, 177, 0.07) 42%, rgba(127, 209, 255, 0) 70%);
  mix-blend-mode: screen;
  transition: opacity 0.6s ease;
  will-change: transform;
}

body.pointer-active .cursor-glow { opacity: 1; }

/* 顶部滚动进度 */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 80;
  pointer-events: none;
  background: linear-gradient(90deg, var(--amber), var(--pink) 55%, var(--sky));
  box-shadow: 0 0 14px rgba(255, 184, 107, 0.55);
  transition: width 0.1s linear;
}

/* 交互特效层 */
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 65;
  pointer-events: none;
  overflow: hidden;
}

.fx-particle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe0b8 10%, rgba(255, 143, 177, 0.9) 45%, rgba(255, 143, 177, 0) 72%);
  animation: fx-particle 900ms cubic-bezier(0.18, 0.72, 0.3, 1) forwards;
}

@keyframes fx-particle {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  to { transform: translate3d(var(--tx, 0), var(--ty, -60px), 0) scale(0.15); opacity: 0; }
}

.fx-kite {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  animation: fx-kite 1600ms cubic-bezier(0.3, 0.62, 0.32, 1) forwards;
}

@keyframes fx-kite {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(0.5); opacity: 0; }
  16% { opacity: 1; }
  55% { transform: translate3d(calc(var(--tx, 0px) * 0.6), -34vh, 0) rotate(38deg) scale(1); }
  100% { transform: translate3d(var(--tx, 0px), -78vh, 0) rotate(86deg) scale(1.1); opacity: 0; }
}

@media (hover: none) {
  .cursor-glow { display: none; }
}

.shell {
  position: relative;
  z-index: 2;
  max-width: 940px;
  margin: 0 auto;
  padding: 20px 18px 72px;
}

/* ── 顶栏 ───────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 16, 34, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 12px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-mark {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 2px;
  background: linear-gradient(120deg, var(--amber), var(--pink) 45%, var(--sky) 70%, var(--amber));
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  animation: hueflow 11s linear infinite;
}

@keyframes hueflow {
  from { background-position: 0% 50%; }
  to { background-position: 240% 50%; }
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav { display: flex; gap: 4px; }

.nav a {
  position: relative;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 13.5px;
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}

.nav a:hover { color: var(--ink); background: var(--glass); }
.nav a.active { color: #14101f; background: linear-gradient(120deg, var(--amber), #ffd9a8); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 7px; }

/* 环境音开关：默认关闭，点了才出声 */
.music-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink-faint);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, background 0.25s, border-color 0.25s, transform 0.2s;
}

.music-btn:hover { color: var(--ink); transform: translateY(-1px); }
.music-btn[aria-pressed='true'] {
  color: #17121f;
  background: linear-gradient(120deg, var(--amber), #ffd9a8);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(255, 184, 107, 0.35);
}

.music-icon { font-size: 12px; line-height: 1; }
.music-waves { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.music-waves i { width: 2px; height: 3px; border-radius: 2px; background: currentColor; opacity: 0.55; }

.music-btn[aria-pressed='true'] .music-waves i {
  opacity: 1;
  animation: wave 1.1s ease-in-out infinite;
}

.music-waves i:nth-child(2) { animation-delay: 0.18s; }
.music-waves i:nth-child(3) { animation-delay: 0.36s; }

@keyframes wave {
  0%, 100% { height: 3px; }
  50% { height: 11px; }
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: #ff5f6d;
  box-shadow: 0 0 0 3px rgba(255, 95, 109, 0.22);
  vertical-align: middle;
}

/* ── 通用卡片 ───────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  /* 比纯玻璃再实一点，保证背后的灯笼光晕不会压住文字 */
  background: linear-gradient(180deg, rgba(26, 30, 56, 0.68), rgba(13, 16, 32, 0.74));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* 悬停时一道柔光斜着扫过 */
.card::after {
  content: '';
  position: absolute;
  inset: -60% -30%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(112deg, transparent 40%, rgba(255, 255, 255, 0.09) 50%, transparent 60%);
  transform: translateX(-65%);
}

.card:hover::after {
  opacity: 1;
  animation: sheen 1.15s cubic-bezier(0.3, 0.6, 0.3, 1);
}

@keyframes sheen {
  from { transform: translateX(-72%); }
  to { transform: translateX(72%); }
}

.hero { margin: 8px 0 22px; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: 1px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--amber), var(--pink) 38%, var(--sky) 62%, var(--amber) 92%);
  background-size: 260% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hueflow 9s linear infinite;
}

.hero p { margin: 0; color: var(--ink-dim); font-size: 15px; }

/* ── 发帖框 ─────────────────────────────── */
.composer { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }

.composer textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 24, 0.45);
  color: var(--ink);
  padding: 14px 15px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.7;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.composer textarea::placeholder { color: var(--ink-faint); }
.composer textarea:focus { border-color: rgba(255, 184, 107, 0.55); box-shadow: 0 0 0 3px rgba(255, 184, 107, 0.12); }

.composer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grow { flex: 1 1 auto; }

.counter { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.counter.warn { color: var(--amber); }

.hint { margin: 0; font-size: 12.5px; color: var(--ink-faint); }

/* ── 小部件 ─────────────────────────────── */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.16s;
  font-family: inherit;
}

.chip:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.22); }
.chip.on {
  color: #17121f;
  background: linear-gradient(120deg, var(--amber), #ffd9a8);
  border-color: transparent;
  font-weight: 600;
}

.chip.ghost.on { background: linear-gradient(120deg, var(--sky), #cdefff); }

.btn {
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn.primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--amber), #ff9f7a 70%, var(--pink));
  color: #1a1020;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(255, 143, 177, 0.22);
}

.btn.small { padding: 6px 14px; font-size: 12.5px; }
.btn.danger { color: #ff9aa4; }

/* ── 列表 ───────────────────────────────── */
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.list { display: flex; flex-direction: column; gap: 13px; }

.post {
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: border 0.2s, transform 0.2s;
  /* backwards 而不是 forwards：动画结束后交还给 hover 的 transform */
  animation: rise 0.55s cubic-bezier(0.22, 0.9, 0.28, 1) backwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.post:hover { border-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.post.unread { border-color: rgba(255, 95, 109, 0.45); }

.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-faint); }

.badge {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
}

.badge.tag { color: #ffe0bd; border-color: rgba(255, 184, 107, 0.35); background: rgba(255, 184, 107, 0.12); }
.badge.private { color: #cfe9ff; border-color: rgba(127, 209, 255, 0.35); background: rgba(127, 209, 255, 0.12); }
.badge.mine { color: #ffd6e3; border-color: rgba(255, 143, 177, 0.4); background: rgba(255, 143, 177, 0.14); }

.post-content {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f2ede3;
}

.post-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s;
  font-variant-numeric: tabular-nums;
}

.act:hover { color: var(--ink); background: var(--glass); }
.act.on { color: var(--pink); }
.act.danger:hover { color: #ff8b96; }
.act.push { margin-left: auto; }

/* ── 详情 ───────────────────────────────── */
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

.back {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
}

.back:hover { color: var(--ink); }

.reply-form { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }

/* 统一输入框外观：不写的话 Chrome 暗色模式会给一个发绿的默认样式 */
.card input,
.reply-form textarea,
.reply-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 24, 0.5);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.card input::placeholder, .reply-form textarea::placeholder { color: var(--ink-faint); }
.reply-form textarea { min-height: 88px; line-height: 1.7; }
.card input:focus,
.reply-form textarea:focus,
.reply-form input:focus {
  border-color: rgba(255, 184, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 184, 107, 0.12);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 17px;
  margin: 26px 0 12px;
  color: #f4efe6;
}

.section-title span.count { font-family: var(--sans); font-size: 13px; color: var(--ink-faint); }

.replies { display: flex; flex-direction: column; gap: 11px; }

.reply {
  border-left: 2px solid rgba(255, 184, 107, 0.4);
  padding: 10px 0 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reply-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-faint); }
.reply-content { margin: 0; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.reply-contact {
  font-size: 13px;
  color: #ffe2c0;
  background: rgba(255, 184, 107, 0.1);
  border: 1px dashed rgba(255, 184, 107, 0.4);
  border-radius: 10px;
  padding: 6px 11px;
  word-break: break-all;
}

.locked-note {
  border: 1px dashed rgba(127, 209, 255, 0.4);
  background: rgba(127, 209, 255, 0.08);
  color: #cfe9ff;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.7;
}

/* ── 我的身份 ───────────────────────────── */
.id-grid { display: grid; gap: 13px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12.5px; color: var(--ink-faint); letter-spacing: 0.5px; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  letter-spacing: 1px;
  word-break: break-all;
  color: #ffe6c8;
}

.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px dashed rgba(255, 184, 107, 0.45);
  background: rgba(255, 184, 107, 0.09);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}

.code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 3px;
  color: #ffd7a3;
  font-weight: 700;
}

.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-family: var(--serif); font-size: 24px; color: var(--amber); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--ink-faint); }

/* ── 提示 / 弹窗 ────────────────────────── */
.loading, .empty {
  text-align: center;
  color: var(--ink-faint);
  padding: 46px 16px;
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  z-index: 60;
  background: rgba(16, 20, 40, 0.94);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
  backdrop-filter: blur(12px);
  max-width: min(88vw, 520px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(4, 6, 16, 0.72); backdrop-filter: blur(4px); }

.modal-card {
  position: relative;
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 22, 46, 0.98), rgba(14, 16, 34, 0.98));
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pop 0.22s ease-out;
}

@keyframes pop { from { transform: translateY(12px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-title { font-family: var(--serif); font-size: 21px; margin: 0; }
.modal-text { margin: 0; font-size: 14px; color: var(--ink-dim); line-height: 1.75; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-faint);
}

.stat-line { font-variant-numeric: tabular-nums; }

.sentinel { height: 40px; }

.skeleton {
  height: 96px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255,255,255,0.04), rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  background-size: 220% 100%;
  animation: shine 1.6s infinite;
}

@keyframes shine { from { background-position: 120% 0; } to { background-position: -60% 0; } }

@media (max-width: 640px) {
  .shell { padding: 14px 13px 64px; }
  .topbar { padding: 9px 12px; gap: 8px; border-radius: 18px; }
  .brand-sub { display: none; }
  .nav a { padding: 6px 10px; font-size: 12.5px; }
  .card { padding: 15px; }
  .code-value { font-size: 17px; letter-spacing: 2px; }
  .modal-card { padding: 19px; }
  .stat-num { font-size: 20px; }
  .music-waves { display: none; }
  .music-btn { padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
