/* ============================================================
   时间胶囊 · 二次元风格全站样式
   ============================================================ */
:root {
  --pink: #e06c9f;
  --pink-soft: #ffd9ea;
  --purple: #7f6fd1;
  --purple-soft: #e8e3ff;
  --accent: #ffd166;
  --ink: #4a3b52;
  --ink-light: #8b7a94;
  --bg: #fdf3f7;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(224, 108, 159, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 樱花飘落层 */
.sakura-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
  background-image:
    radial-gradient(circle at 10% 20%, #ffd9ea 0 6px, transparent 7px),
    radial-gradient(circle at 30% 70%, #e8e3ff 0 5px, transparent 6px),
    radial-gradient(circle at 70% 30%, #ffe9f3 0 7px, transparent 8px),
    radial-gradient(circle at 85% 80%, #ffd9ea 0 5px, transparent 6px),
    radial-gradient(circle at 55% 90%, #f3e8ff 0 6px, transparent 7px),
    radial-gradient(circle at 92% 12%, #ffe0ec 0 5px, transparent 6px);
  background-size: 320px 320px;
  animation: drift 60s linear infinite;
}
@keyframes drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 320px 640px, 320px 640px, 320px 640px, 320px 640px, 320px 640px, 320px 640px; }
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 5vw;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(224, 108, 159, .10);
}
.nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  margin-right: 24px;
  color: var(--pink);
  text-decoration: none;
  white-space: nowrap;
}
.nav .logo img { width: 36px; height: 36px; }
.nav a.link {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  transition: .25s;
  white-space: nowrap;
}
.nav a.link:hover { background: var(--pink-soft); color: var(--pink); transform: translateY(-2px); }
.nav a.link.active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; font-weight: 600; }
.nav .spacer { flex: 1; }
.nav .user-zone { display: flex; align-items: center; gap: 10px; }
.nav .user-zone .hello { color: var(--ink-light); font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 10px 26px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: .25s;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(224, 108, 159, .35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(127, 111, 209, .4); }
.btn-ghost { background: #fff; color: var(--pink); border: 2px solid var(--pink-soft); }
.btn-ghost:hover { border-color: var(--pink); background: var(--pink-soft); }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 主体容器 ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 30px 5vw 80px; position: relative; z-index: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 64px 20px 40px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  background: linear-gradient(120deg, var(--pink) 20%, var(--purple) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}
.hero p.sub { color: var(--ink-light); font-size: 17px; }
.hero .actions { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- 轮播 ---------- */
.carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 320px;
}
.carousel .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
}
.carousel .slide.on { opacity: 1; }
.carousel .slide.linkable { cursor: pointer; text-decoration: none; color: inherit; }
.carousel .slide .info {
  padding: 26px 34px;
  width: 100%;
  background: linear-gradient(transparent, rgba(60, 20, 50, .72));
  color: #fff;
}
.carousel .slide .info h3 { font-size: 26px; margin-bottom: 6px; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.carousel .slide .info p { font-size: 14px; opacity: .92; }
.carousel .dots { position: absolute; right: 22px; bottom: 84px; display: flex; gap: 8px; }
.carousel .dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.5); cursor: pointer; transition: .3s;
}
.carousel .dots i.on { background: #fff; width: 26px; border-radius: 99px; }
.carousel .arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.75); border: none; cursor: pointer;
  font-size: 18px; color: var(--pink); transition: .25s; z-index: 5;
}
.carousel .arrow:hover { background: #fff; }
.carousel .arrow.prev { left: 14px; }
.carousel .arrow.next { right: 14px; }

/* ---------- 分区标题 ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 44px 0 22px;
  font-size: 22px;
  font-weight: 800;
}
.section-title::before { content: "✦"; color: var(--accent); font-size: 18px; }
.section-title .more { margin-left: auto; font-size: 14px; font-weight: 400; color: var(--pink); text-decoration: none; }

/* ---------- 特性卡片 ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.feature { text-align: center; padding: 30px 20px; transition: .3s; }
.feature:hover { transform: translateY(-6px); }
.feature .emoji { font-size: 40px; margin-bottom: 12px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { font-size: 13px; color: var(--ink-light); line-height: 1.7; }

/* ---------- 广场卡片 ---------- */
.plaza-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.plaza-item { padding: 22px; transition: .3s; position: relative; overflow: hidden; }
.plaza-item:hover { transform: translateY(-5px); }
.plaza-item h4 { font-size: 16px; margin-bottom: 8px; color: var(--purple); }
.plaza-item .meta { font-size: 12px; color: var(--ink-light); }
.plaza-item .excerpt { font-size: 13px; color: var(--ink-light); margin-top: 10px; line-height: 1.7; }
.plaza-item .badge {
  position: absolute; top: 14px; right: -30px; transform: rotate(38deg);
  padding: 4px 34px; font-size: 11px; color: #fff;
}
.badge.open { background: linear-gradient(135deg, #52c41a, #7ed957); }
.badge.sealed { background: linear-gradient(135deg, var(--purple), #a08cf0); }
.plaza-item.sealed::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(127,111,209,.05) 12px 24px);
}

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 20px; }
.form-item label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-item label .req { color: #ff5c8a; }
.form-item input[type=text], .form-item input[type=email], .form-item input[type=password],
.form-item input[type=datetime-local], .form-item select, .form-item textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #f3e3ec;
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fffdfa;
  color: var(--ink);
  transition: .25s;
  outline: none;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(224, 108, 159, .12);
}
.form-item textarea { min-height: 120px; resize: vertical; }
.form-item .tip { font-size: 12px; color: var(--ink-light); margin-top: 6px; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }

/* 单选胶囊样式 */
.radio-pill { display: none; }
.radio-pill + .pill {
  display: inline-block;
  padding: 8px 20px;
  border: 2px solid #f3e3ec;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  margin-right: 8px;
  transition: .2s;
  user-select: none;
}
.radio-pill:checked + .pill {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-color: transparent;
  color: #fff;
}

/* 开关 */
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.switch-row input[type=checkbox] {
  appearance: none;
  width: 46px; height: 26px; border-radius: 99px;
  background: #eee0ea; position: relative; cursor: pointer; transition: .3s;
}
.switch-row input[type=checkbox]:checked { background: var(--pink); }
.switch-row input[type=checkbox]::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .3s;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.switch-row input[type=checkbox]:checked::after { left: 23px; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 26px; background: var(--pink-soft); padding: 6px; border-radius: 999px; }
.tabs button {
  flex: 1; border: none; background: transparent; padding: 10px;
  border-radius: 999px; font-size: 15px; cursor: pointer; color: var(--ink-light);
  font-family: inherit; transition: .25s;
}
.tabs button.on { background: #fff; color: var(--pink); font-weight: 700; box-shadow: 0 4px 12px rgba(224,108,159,.2); }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fadeUp .4s; }

/* ---------- 结果/秘钥展示 ---------- */
.key-box {
  background: linear-gradient(135deg, #fff6fa, #f3eeff);
  border: 2px dashed var(--pink);
  border-radius: 18px;
  padding: 22px;
  text-align: center;
}
.key-box .key {
  font-family: Consolas, monospace;
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--purple);
  word-break: break-all;
  margin: 12px 0;
  user-select: all;
}
.result-open { line-height: 1.9; font-size: 15px; }
.result-open img, .result-open video { max-width: 100%; border-radius: 12px; }
.result-meta { color: var(--ink-light); font-size: 13px; margin-bottom: 14px; }

/* 倒计时 */
.countdown { display: flex; gap: 14px; justify-content: center; margin: 20px 0; }
.countdown .cell {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; border-radius: 16px; padding: 14px 10px; min-width: 72px; text-align: center;
}
.countdown .cell b { display: block; font-size: 26px; }
.countdown .cell span { font-size: 12px; opacity: .85; }

/* ---------- FAQ ---------- */
.faq-item { margin-bottom: 14px; overflow: hidden; }
.faq-item .q {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px; cursor: pointer; font-weight: 600; font-size: 15px;
}
.faq-item .q::before { content: "🎀"; }
.faq-item .q .arrow { margin-left: auto; color: var(--pink); transition: .3s; }
.faq-item.open .q .arrow { transform: rotate(180deg); }
.faq-item .a { max-height: 0; overflow: hidden; transition: max-height .4s; padding: 0 22px; }
.faq-item.open .a { max-height: 400px; padding: 0 22px 18px; }
.faq-item .a { font-size: 14px; color: var(--ink-light); line-height: 1.9; }

/* ---------- 列表(我的胶囊) ---------- */
.mine-item { display: flex; gap: 16px; align-items: center; padding: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.mine-item .info { flex: 1; min-width: 220px; }
.mine-item .info h4 { font-size: 16px; margin-bottom: 6px; }
.mine-item .info .meta { font-size: 12px; color: var(--ink-light); line-height: 1.8; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11px; margin-right: 6px; }
.tag.pending { background: #fff3d6; color: #b8860b; }
.tag.sent { background: #e3f9e5; color: #2e9e44; }
.tag.revoked { background: #ffe3e3; color: #d9534f; }
.tag.pri { background: var(--purple-soft); color: var(--purple); }
.key-inline { font-family: Consolas, monospace; font-size: 12px; color: var(--purple); user-select: all; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: rgba(74, 59, 82, .92); color: #fff; padding: 12px 28px;
  border-radius: 999px; font-size: 14px; z-index: 999;
  opacity: 0; pointer-events: none; transition: .35s;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(217, 83, 79, .92); }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  padding: 34px 20px 40px;
  color: var(--ink-light);
  font-size: 13px;
  position: relative;
  z-index: 1;
}
.footer a { color: var(--pink); text-decoration: none; }

/* 富文本内容排版 */
.rich { line-height: 1.9; font-size: 15px; }
.rich h3 { margin: 18px 0 8px; color: var(--purple); }
.rich p { margin-bottom: 10px; }

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .6s both; }

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; }
  .carousel { height: 240px; }
  .form-row { flex-direction: column; }
}
