/* =========================================================
   CORTIS BIRTHDAY ARCHIVE — 全局样式
   深色 / 金属球 / 酸性绿 / Y2K 编辑感
   ========================================================= */

:root {
  --bg: #08080a;
  --bg-soft: #101014;
  --bone: #f4f1e9;
  --ink: #08080a;
  --acid: #d8ff3e;
  --pink: #ff5ea8;
  --blue: #4a5cff;
  --muted: #9a9aa4;
  --line: rgba(244, 241, 233, 0.14);
  --line-soft: rgba(244, 241, 233, 0.08);

  --font-display: "Arial Black", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --font-sans: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-hand: "Bradley Hand", "Chalkboard SE", "Marker Felt", "Hannotate SC", "HanziPen SC",
    "Kaiti SC", "STKaiti", "标准楷体简", "KaiTi", "楷体", cursive;

  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: calc(15px * var(--font-scale, 1));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--acid);
  color: var(--ink);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

/* ------------------------------- 背景层 -------------------------------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-glow {
  position: absolute;
  width: 70vw;
  aspect-ratio: 1;
  right: -20vw;
  top: -25vh;
  background: radial-gradient(circle, rgba(216, 255, 62, 0.16), transparent 62%);
  filter: blur(40px);
}

.orb {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 46% 18% at 38% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 72%),
    radial-gradient(
      circle at 30% 22%,
      #ffffff 0%,
      #f7fafd 5%,
      #d5dde7 13%,
      #98a3b2 25%,
      #4b525d 37%,
      #23272e 45%,
      #3f4650 51%,
      #8f99a7 60%,
      #dbe3ee 69%,
      #aab4c1 77%,
      #eef4fa 85%,
      #b3bcc8 92%,
      #59606b 100%
    );
  box-shadow:
    inset -70px -90px 170px rgba(0, 0, 0, 0.6),
    inset 40px 50px 120px rgba(255, 255, 255, 0.22),
    0 90px 200px rgba(0, 0, 0, 0.65);
  will-change: transform;
}

.orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    rgba(255, 255, 255, 0) 0deg,
    rgba(255, 255, 255, 0.5) 40deg,
    rgba(120, 255, 240, 0.16) 70deg,
    rgba(255, 255, 255, 0) 120deg,
    rgba(255, 92, 168, 0.18) 200deg,
    rgba(255, 255, 255, 0.35) 250deg,
    rgba(255, 255, 255, 0) 300deg
  );
  mix-blend-mode: screen;
  opacity: 0.32;
  filter: blur(18px);
  animation: orb-spin 34s linear infinite;
}

.orb::after {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 0 60px rgba(216, 255, 62, 0.18),
    inset -8px -14px 40px rgba(216, 255, 62, 0.22);
}

.orb-main {
  width: min(74vw, 860px);
  right: -15vw;
  top: -16vh;
  animation: float-slow 20s ease-in-out infinite;
}

.orb-small {
  width: min(26vw, 240px);
  left: -6vw;
  bottom: 6vh;
  opacity: 0.55;
  background:
    radial-gradient(
      circle at 34% 28%,
      #ffffff 0%,
      #dfe6ef 12%,
      #8d95a2 34%,
      #3a4048 58%,
      #7b8490 78%,
      #dfe5ee 94%
    );
  animation: float-slow 26s ease-in-out infinite reverse;
}

.orb-dot {
  width: 68px;
  height: 68px;
  left: 12vw;
  top: 22vh;
  opacity: 0.5;
  background: radial-gradient(circle at 32% 28%, #fff, #aab2bd 40%, #4a5058 80%);
  animation: float-dot 12s ease-in-out infinite;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 85% at 18% 42%, rgba(8, 8, 10, 0.94) 0%, rgba(8, 8, 10, 0.6) 42%, transparent 68%),
    linear-gradient(to top, rgba(8, 8, 10, 0.92) 0%, transparent 26%);
  pointer-events: none;
}

body.custom-orb .orb-main {
  background: var(--orb-image) center / contain no-repeat;
  border-radius: 0;
  box-shadow: none;
  animation: float-slow 22s ease-in-out infinite;
}

body.custom-orb .orb-main::before,
body.custom-orb .orb-main::after {
  display: none;
}

body.inner .orb-main {
  opacity: 0.5;
}

body.inner .bg::after {
  background:
    radial-gradient(120% 100% at 28% 18%, rgba(8, 8, 10, 0.9) 0%, rgba(8, 8, 10, 0.62) 48%, rgba(8, 8, 10, 0.3) 100%),
    linear-gradient(to top, rgba(8, 8, 10, 0.95) 0%, transparent 34%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 241, 233, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 233, 0.05) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at 60% 30%, #000 20%, transparent 78%);
  opacity: 0.7;
}

.bg-grain {
  position: absolute;
  inset: -50%;
  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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: overlay;
  animation: grain 8s steps(6) infinite;
}

@keyframes float-slow {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(-18px, 26px, 0) rotate(-1.2deg); }
}

@keyframes float-dot {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(14px, -22px, 0); }
}

@keyframes orb-spin {
  to { transform: rotate(360deg); }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 1%); }
  40% { transform: translate(1%, -2%); }
  60% { transform: translate(-1%, 2%); }
  80% { transform: translate(2%, 1%); }
  100% { transform: translate(0, 0); }
}

/* -------------------------------- 布局 --------------------------------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
}

.main {
  flex: 1;
  padding-bottom: 80px;
}

/* -------------------------------- 顶栏 --------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 0;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.92), rgba(8, 8, 10, 0.62));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: calc(17px * var(--font-scale, 1));
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.brand .spark {
  color: var(--acid);
  font-size: calc(14px * var(--font-scale, 1));
  animation: pulse 3s ease-in-out infinite;
}

.brand small {
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: calc(13px * var(--font-scale, 1));
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
  color: var(--ink);
  background: var(--acid);
  font-weight: 700;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--acid), #8fbf00);
  color: var(--ink);
  font-weight: 800;
  font-size: calc(13px * var(--font-scale, 1));
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.nav-user .who {
  display: grid;
  line-height: 1.2;
}

.nav-user .who b {
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
}

.nav-user .who span {
  font-size: calc(10px * var(--font-scale, 1));
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* -------------------------------- 跑马灯 -------------------------------- */

.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid rgba(0, 0, 0, 0.35);
  background: var(--acid);
  color: var(--ink);
  padding: 9px 0;
  font-family: var(--font-mono);
  font-size: calc(11px * var(--font-scale, 1));
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.marquee-track {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  white-space: nowrap;
}

.marquee-track span::after {
  content: "✦";
  font-size: calc(10px * var(--font-scale, 1));
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* -------------------------------- 排版 --------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: calc(11px * var(--font-scale, 1));
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--acid);
}

.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.display em {
  font-style: normal;
  color: var(--acid);
}

.lead {
  color: #c9c7c0;
  font-size: calc(16px * var(--font-scale, 1));
  line-height: 1.75;
  max-width: 46ch;
}

.mono {
  font-family: var(--font-mono);
  font-size: calc(11px * var(--font-scale, 1));
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -------------------------------- 按钮 --------------------------------- */

.btn {
  --btn-bg: var(--acid);
  --btn-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 800;
  font-size: calc(14px * var(--font-scale, 1));
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s, opacity 0.2s;
  box-shadow: 0 10px 30px rgba(216, 255, 62, 0.18);
  user-select: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(216, 255, 62, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--bone);
  border-color: var(--line);
  box-shadow: none;
  font-weight: 600;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.btn-ink {
  --btn-bg: var(--bone);
  --btn-fg: var(--ink);
  box-shadow: none;
}

.btn-sm {
  padding: 9px 16px;
  font-size: calc(12px * var(--font-scale, 1));
}

.btn-link {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: calc(12px * var(--font-scale, 1));
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.btn-link:hover {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.06);
}

/* -------------------------------- 表单 --------------------------------- */

.field {
  display: grid;
  gap: 8px;
}

.field > label,
.label {
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--bone);
  font-size: calc(15px * var(--font-scale, 1));
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input::placeholder {
  color: #6c6c76;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: rgba(216, 255, 62, 0.7);
  box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f4f1e9' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.select option {
  background: #16161b;
  color: var(--bone);
}

.hint {
  font-size: calc(12px * var(--font-scale, 1));
  color: var(--muted);
  line-height: 1.5;
}

.form-error {
  display: none;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 94, 168, 0.12);
  border: 1px solid rgba(255, 94, 168, 0.35);
  color: #ffb7d6;
  font-size: calc(12.5px * var(--font-scale, 1));
}

.form-error.show {
  display: block;
}

/* ------------------------------ 落地页 Hero ----------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 56px;
  align-items: center;
  min-height: 0;
  padding: 72px 0 78px;
}

.hero-copy {
  position: relative;
}

.hero-copy .eyebrow {
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(46px, 6.6vw, 92px);
  margin-bottom: 26px;
}

.hero h1 .line {
  display: block;
}

.hero h1 .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 241, 233, 0.55);
}

.hero .lead {
  margin-bottom: 34px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: calc(12px * var(--font-scale, 1));
  color: var(--muted);
}

.stat-pill b {
  font-family: var(--font-display);
  font-size: calc(16px * var(--font-scale, 1));
  color: var(--bone);
}

.sticker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-4deg);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
}

.hero .sticker {
  position: static;
  display: flex;
  width: max-content;
  margin-bottom: 22px;
  transform: rotate(-3deg);
}

/* 登录面板 */
.panel {
  position: relative;
  padding: 26px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(244, 241, 233, 0.16);
  background: linear-gradient(160deg, rgba(24, 24, 29, 0.9), rgba(10, 10, 13, 0.92));
  backdrop-filter: blur(20px);
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: calc(22px * var(--font-scale, 1));
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
  margin-bottom: 22px;
}

.tabs button {
  position: relative;
  z-index: 1;
  padding: 10px;
  border: 0;
  background: none;
  border-radius: 999px;
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s;
}

.tabs button.active {
  color: var(--ink);
}

.tabs .thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--acid);
  transition: transform 0.35s var(--ease);
}

.tabs[data-tab="register"] .thumb {
  transform: translateX(100%);
}

.tab-pane {
  display: none;
  gap: 14px;
  flex-direction: column;
}

.tab-pane.active {
  display: flex;
}

.panel .btn-block {
  margin-top: 4px;
}

.panel-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--muted);
}

.panel-foot .mono {
  font-size: calc(10px * var(--font-scale, 1));
}

/* 生日选择 */
.dob {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.9fr;
  gap: 8px;
}

/* ------------------------------- 卡片 ---------------------------------- */

.card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: #16161b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
}

.card::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--img, none);
  background-size: cover;
  background-position: center;
  filter: blur(34px) brightness(0.62) saturate(1.35);
  transform: scale(1.08);
  z-index: 0;
}

.card img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    112deg,
    transparent 28%,
    rgba(255, 255, 255, 0.3) 44%,
    rgba(170, 255, 235, 0.22) 50%,
    rgba(255, 170, 220, 0.18) 55%,
    transparent 66%
  );
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-20%);
  transition: opacity 0.45s, transform 0.9s var(--ease);
  pointer-events: none;
}

.card:hover::after {
  opacity: 0.85;
  transform: translateX(12%);
}

.card-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--font-mono);
  font-size: calc(9px * var(--font-scale, 1));
  letter-spacing: 0.14em;
  color: var(--bone);
  text-transform: uppercase;
}

/* 卡背 */
.card-back {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(216, 255, 62, 0.16), transparent 55%),
    repeating-radial-gradient(circle at 50% 50%, rgba(244, 241, 233, 0.1) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, #14140f, #08080a 70%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-back .bw {
  position: absolute;
  font-family: var(--font-display);
  font-size: calc(74px * var(--font-scale, 1));
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 241, 233, 0.18);
  white-space: nowrap;
  transform: rotate(-24deg);
}

.card-back .bw:nth-child(1) { top: 4%; left: -30%; }
.card-back .bw:nth-child(2) { top: 26%; left: -10%; }
.card-back .bw:nth-child(3) { bottom: 6%; right: -25%; }
.card-back .bw:nth-child(4) { top: 55%; right: -5%; }

.card-back .mark {
  position: relative;
  z-index: 2;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
}

.card-back .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.65));
}

.card-back .note {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: calc(8.5px * var(--font-scale, 1));
  letter-spacing: 0.2em;
  color: rgba(244, 241, 233, 0.6);
  text-transform: uppercase;
}

/* 3D 翻牌 */
.flip {
  perspective: 1600px;
  width: 100%;
}

.flip-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(0.4, 0.05, 0.15, 1);
}

.flip.revealed .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.flip-face.front {
  transform: rotateY(180deg);
  background: #0b0b0e;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.flip-face.front::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--img, none);
  background-size: cover;
  background-position: center;
  filter: blur(44px) brightness(0.58) saturate(1.4);
  transform: scale(1.08);
  z-index: 0;
}

.flip-face.back {
  border-radius: 16px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7);
}

.flip-face.front img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

/* -------------------------------- 抽卡页 ------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  gap: 64px;
  align-items: center;
  padding: 56px 0 40px;
}

.today-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: calc(11px * var(--font-scale, 1));
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.today-line .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 4px rgba(216, 255, 62, 0.16);
  animation: pulse 2.4s ease-in-out infinite;
}

.app-shell h1 {
  font-size: clamp(40px, 5vw, 66px);
  margin-bottom: 18px;
}

.app-shell .lead {
  margin-bottom: 30px;
  font-size: calc(15px * var(--font-scale, 1));
}

.draw-box {
  display: grid;
  gap: 14px;
  max-width: 440px;
}

.draw-box .dob {
  margin-bottom: 2px;
}

.draw-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.draw-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: calc(12px * var(--font-scale, 1));
  color: var(--muted);
}

.draw-note svg {
  flex: none;
  opacity: 0.7;
}

.limit-banner {
  display: none;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(216, 255, 62, 0.3);
  background: rgba(216, 255, 62, 0.07);
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.limit-banner.show {
  display: flex;
}

.limit-banner .count {
  font-family: var(--font-mono);
  font-size: calc(22px * var(--font-scale, 1));
  letter-spacing: 0.06em;
  color: var(--acid);
}

.stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 30px 30px;
  perspective: 1500px;
}

.stage-glow {
  position: absolute;
  inset: 10% 0 0;
  background: radial-gradient(circle at 50% 50%, rgba(216, 255, 62, 0.18), transparent 65%);
  filter: blur(30px);
}

.stage-inner {
  position: relative;
  width: min(100%, 380px);
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out;
}

.stage .card-back .mark {
  transition: transform 0.4s;
}

.stage:hover .card-back .mark {
  transform: scale(1.06) rotate(-4deg);
}

.stage-caption {
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: calc(9.5px * var(--font-scale, 1));
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.result-meta {
  display: none;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  gap: 22px;
  align-items: flex-end;
}

.result-meta.show {
  display: flex;
}

.result-meta .big {
  font-family: var(--font-display);
  font-size: calc(40px * var(--font-scale, 1));
  line-height: 1;
  letter-spacing: -0.02em;
}

.result-meta .meta-col {
  display: grid;
  gap: 4px;
}

.result-meta .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ------------------------------- 卡册 ---------------------------------- */

.page-head {
  padding: 52px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: clamp(34px, 4.4vw, 56px);
}

.page-head .lead {
  margin-top: 12px;
  font-size: calc(14px * var(--font-scale, 1));
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.stat-card .k {
  font-family: var(--font-mono);
  font-size: calc(9.5px * var(--font-scale, 1));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card .v {
  font-family: var(--font-display);
  font-size: calc(30px * var(--font-scale, 1));
  line-height: 1;
}

.stat-card .v small {
  font-family: var(--font-sans);
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}

.profile-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.profile-strip .avatar {
  width: 46px;
  height: 46px;
  font-size: calc(16px * var(--font-scale, 1));
}

.profile-strip .who b {
  font-size: calc(15px * var(--font-scale, 1));
}

.profile-strip .who span {
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--muted);
}

.profile-strip .spacer {
  flex: 1;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: calc(20px * var(--font-scale, 1));
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-head .mono {
  font-size: calc(10px * var(--font-scale, 1));
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 52px;
}

.card-grid .card {
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}

.card-grid .card:hover {
  transform: translateY(-6px) rotate(-0.6deg);
  box-shadow: 0 34px 60px rgba(0, 0, 0, 0.65);
}

.card-grid .card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: calc(9.5px * var(--font-scale, 1));
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 52px;
}

.empty h3 {
  font-family: var(--font-display);
  font-size: calc(20px * var(--font-scale, 1));
  margin-bottom: 8px;
}

.empty p {
  color: var(--muted);
  font-size: calc(13px * var(--font-scale, 1));
  margin-bottom: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 60px;
}

.list {
  display: grid;
  gap: 2px;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: calc(13px * var(--font-scale, 1));
}

.list-row .when {
  font-family: var(--font-mono);
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--muted);
  white-space: nowrap;
}

.list-row .device {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.list-row .device .ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
  font-size: calc(12px * var(--font-scale, 1));
  flex: none;
}

.list-row .device .txt {
  min-width: 0;
}

.list-row .device .txt b {
  display: block;
  font-weight: 500;
  font-size: calc(12.5px * var(--font-scale, 1));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row .device .txt span {
  font-size: calc(10px * var(--font-scale, 1));
  color: var(--muted);
  font-family: var(--font-mono);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: calc(9px * var(--font-scale, 1));
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
}

.badge.acid {
  border-color: rgba(216, 255, 62, 0.4);
  color: var(--acid);
  background: rgba(216, 255, 62, 0.07);
}

.side-panel {
  padding: 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.side-panel h3 {
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.side-panel + .side-panel {
  margin-top: 14px;
}

/* -------------------------------- 后台 --------------------------------- */

.admin-head {
  padding: 46px 0 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-head h1 {
  font-size: clamp(30px, 4vw, 46px);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 44px;
}

.dropzone {
  position: relative;
  padding: 34px 24px;
  border-radius: var(--r-md);
  border: 1.5px dashed rgba(244, 241, 233, 0.24);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--acid);
  background: rgba(216, 255, 62, 0.06);
}

.dropzone .big {
  font-family: var(--font-display);
  font-size: calc(18px * var(--font-scale, 1));
  margin-bottom: 6px;
}

.dropzone .mono {
  font-size: calc(10px * var(--font-scale, 1));
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  font-size: calc(12px * var(--font-scale, 1));
}

.upload-row .state {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  color: var(--acid);
}

.upload-row.err .state {
  color: #ff9dc4;
}

.coverage {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.coverage-months {
  display: grid;
  grid-template-columns: 26px repeat(31, 1fr);
  gap: 3px;
  min-width: 560px;
}

.cov-cell {
  aspect-ratio: 1;
  min-width: 9px;
  border-radius: 2.5px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.cov-cell.real {
  background: var(--acid);
  border-color: var(--acid);
  box-shadow: 0 0 8px rgba(216, 255, 62, 0.35);
}

.cov-cell.gen {
  background: rgba(216, 255, 62, 0.22);
  border-color: rgba(216, 255, 62, 0.3);
}

.cov-cell:hover {
  outline: 2px solid var(--bone);
  outline-offset: 1px;
}

.cov-label {
  font-family: var(--font-mono);
  font-size: calc(9px * var(--font-scale, 1));
  color: var(--muted);
  display: grid;
  place-items: center;
}

.legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: calc(10.5px * var(--font-scale, 1));
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .input {
  padding: 9px 13px;
  font-size: calc(13px * var(--font-scale, 1));
  border-radius: 9px;
  width: auto;
  min-width: 190px;
}

.chip {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: calc(12px * var(--font-scale, 1));
  color: var(--muted);
  cursor: pointer;
}

.chip.active {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone);
  font-weight: 700;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.photo-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: #131317;
}

.photo-tile img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #0a0a0c;
}

.photo-tile .cap {
  padding: 7px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: calc(9px * var(--font-scale, 1));
  letter-spacing: 0.08em;
  color: var(--muted);
}

.photo-tile .cap b {
  color: var(--bone);
  font-weight: 500;
}

.photo-tile .tools {
  position: absolute;
  inset: auto 0 0;
  padding: 8px;
  display: flex;
  gap: 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-tile:hover .tools {
  opacity: 1;
}

.photo-tile .tools button {
  flex: 1;
  border: 0;
  border-radius: 5px;
  padding: 6px 4px;
  font-size: calc(10px * var(--font-scale, 1));
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}

.photo-tile .tools button.danger {
  background: rgba(255, 94, 168, 0.9);
  color: #fff;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(12.5px * var(--font-scale, 1));
}

th {
  text-align: left;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: calc(9.5px * var(--font-scale, 1));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: 0;
}

td .sub {
  display: block;
  font-size: calc(10.5px * var(--font-scale, 1));
  color: var(--muted);
}

/* -------------------------------- 弹窗 --------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 4, 6, 0.82);
  backdrop-filter: blur(10px);
}

.modal.open {
  display: flex;
  animation: fade 0.25s ease;
}

.modal-box {
  position: relative;
  width: min(880px, 100%);
  max-height: 90vh;
  overflow: auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 30px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(244, 241, 233, 0.16);
  background: linear-gradient(160deg, #17171c, #0b0b0e);
  box-shadow: 0 60px 140px rgba(0, 0, 0, 0.8);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  color: var(--bone);
  cursor: pointer;
  font-size: calc(16px * var(--font-scale, 1));
  line-height: 1;
}

.modal-box [data-modal-content] {
  display: contents;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: calc(30px * var(--font-scale, 1));
  line-height: 1;
  margin-bottom: 6px;
}

.modal .detail-list {
  display: grid;
  gap: 0;
  margin-top: 20px;
}

.modal .detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: calc(12.5px * var(--font-scale, 1));
}

.modal .detail-list span:first-child {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes fade {
  from { opacity: 0; }
}

/* -------------------------------- Toast -------------------------------- */

.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100% - 32px));
}

.toast {
  padding: 13px 18px;
  border-radius: 12px;
  background: rgba(20, 20, 24, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  font-size: calc(13px * var(--font-scale, 1));
  color: var(--bone);
  animation: toast-in 0.3s var(--ease);
}

.toast.ok {
  border-color: rgba(216, 255, 62, 0.5);
}

.toast.err {
  border-color: rgba(255, 94, 168, 0.55);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
}

/* -------------------------------- 页脚 --------------------------------- */

.footer {
  margin-top: auto;
  padding: 30px 0 40px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: calc(11px * var(--font-scale, 1));
  color: #6d6d77;
}

.footer .mono {
  font-size: calc(9.5px * var(--font-scale, 1));
}

/* ------------------------------ 展示区块 -------------------------------- */

.showcase {
  padding: 84px 0;
  border-top: 1px solid var(--line-soft);
}

.showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.showcase-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.showcase-head p {
  color: var(--muted);
  max-width: 40ch;
  font-size: calc(13px * var(--font-scale, 1));
}

.preview-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.preview-row .card {
  transform: rotate(var(--r, 0deg));
  transition: transform 0.4s var(--ease);
}

.preview-row .card:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.02);
  z-index: 2;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 84px 0;
  border-top: 1px solid var(--line-soft);
}

.step {
  padding: 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.step .num {
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  letter-spacing: 0.2em;
  color: var(--acid);
  margin-bottom: 26px;
}

.step h3 {
  font-family: var(--font-display);
  font-size: calc(20px * var(--font-scale, 1));
  line-height: 1.15;
  margin-bottom: 8px;
}

.step p {
  color: var(--muted);
  font-size: calc(12.5px * var(--font-scale, 1));
  line-height: 1.7;
}

/* ---------------------------- 生日卡 / 日历 ----------------------------- */

.birthday-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  max-width: 440px;
}

.mini-card {
  position: relative;
  width: 58px;
  aspect-ratio: 3 / 4;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #15151a;
}

.mini-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--img, none);
  background-size: cover;
  background-position: center;
  filter: blur(12px) brightness(0.5);
}

.mini-card img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mini-card.empty {
  display: grid;
  place-items: center;
  background: #101014;
}

.mini-card.empty::before {
  display: none;
}

.mini-card.empty::after {
  content: "?";
  font-family: var(--font-display);
  font-size: calc(20px * var(--font-scale, 1));
  color: var(--muted);
}

.birthday-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.birthday-meta .mono {
  font-size: calc(9px * var(--font-scale, 1));
}

.birthday-title {
  font-size: calc(13px * var(--font-scale, 1));
  color: var(--bone);
  line-height: 1.4;
}

.birthday-meta .btn-link {
  font-size: calc(11px * var(--font-scale, 1));
  padding: 2px 0;
}

/* 日历 */
.cal-section {
  margin-bottom: 48px;
}

.cal-body {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(216, 255, 62, 0.05), transparent 60%),
    rgba(255, 255, 255, 0.025);
}

.cal-body.collapsed {
  display: none;
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cal-start {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-start .input {
  width: 148px;
  padding: 8px 10px;
  font-size: calc(12px * var(--font-scale, 1));
  border-radius: 8px;
}

.cal-start .btn-sm {
  padding: 8px 14px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-month {
  font-family: var(--font-display);
  font-size: calc(17px * var(--font-scale, 1));
  letter-spacing: 0.02em;
  min-width: 116px;
  text-align: center;
}

.cal-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--bone);
  cursor: pointer;
  font-size: calc(13px * var(--font-scale, 1));
  transition: background 0.2s, border-color 0.2s;
}

.cal-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(216, 255, 62, 0.4);
}

.cal-arrow:disabled {
  opacity: 0.28;
  cursor: default;
}

.cal-weekdays,
.cal-grid {
  max-width: 980px;
  margin-inline: auto;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.cal-weekdays span {
  text-align: center;
  font-family: var(--font-mono);
  font-size: calc(9px * var(--font-scale, 1));
  letter-spacing: 0.14em;
  color: var(--muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}

.cal-cell-wrap {
  position: relative;
  aspect-ratio: 1.15;
}

.cal-cell-wrap > .cal-cell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.cal-cell {
  position: relative;
  aspect-ratio: 1.15;
  display: block;
  width: 100%;
  padding: 7px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.022);
  color: var(--bone);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.25s var(--ease), background 0.2s;
}

.cal-cell:hover {
  border-color: rgba(216, 255, 62, 0.45);
  transform: translateY(-2px);
  background: rgba(216, 255, 62, 0.04);
}

.cal-cell.is-blank {
  border: 0;
  background: transparent;
  pointer-events: none;
  margin: 0;
}

.cal-cell.today {
  box-shadow: inset 0 0 0 1.5px var(--acid);
}

.cal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: opacity 0.25s, transform 0.4s var(--ease);
}

.cal-cell:hover .cal-img {
  opacity: 0.82;
  transform: scale(1.03);
}

.cal-ball {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 46%;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.14;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.4s var(--ease);
}

.cal-cell:hover .cal-ball {
  opacity: 0.28;
  transform: translate(-50%, -50%) scale(1.05) rotate(-3deg);
}

.cell-ball {
  position: absolute;
  width: clamp(9px, calc(var(--p, 19) * 1%), 26px);
  height: auto;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  z-index: 3;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7));
}

.cal-cell.has-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.28) 42%, transparent 70%);
  pointer-events: none;
}

.cal-day {
  position: absolute;
  left: 7px;
  top: 5px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: calc(10.5px * var(--font-scale, 1));
  letter-spacing: 0.04em;
  color: rgba(244, 241, 233, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 14px rgba(0, 0, 0, 0.7);
}

.cal-cell.today .cal-day {
  color: var(--acid);
  font-weight: 700;
}

.cal-mood {
  position: absolute;
  right: 5px;
  top: 4px;
  z-index: 2;
  font-size: calc(15px * var(--font-scale, 1));
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.cal-dot {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 2;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px rgba(216, 255, 62, 0.7);
}

.cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  max-width: 980px;
  margin-inline: auto;
}

.cal-foot .hint {
  font-size: calc(11.5px * var(--font-scale, 1));
}

.cal-foot .mono {
  font-size: calc(9.5px * var(--font-scale, 1));
}

/* 日记录弹窗 */
.day-empty-card {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
}

.day-empty-card img {
  width: 62%;
  max-width: 190px;
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
  opacity: 0.9;
}

.mood-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.mood-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: calc(19px * var(--font-scale, 1));
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.mood-btn:hover {
  transform: translateY(-2px);
}

.mood-btn.active {
  border-color: var(--acid);
  background: rgba(216, 255, 62, 0.12);
  box-shadow: 0 0 0 2px rgba(216, 255, 62, 0.12);
}

.task-list {
  display: grid;
  gap: 0;
  margin: 0;
  max-height: 264px;
  overflow-y: auto;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 241, 233, 0.18) transparent;
}

.task-list::-webkit-scrollbar {
  width: 6px;
}

.task-list::-webkit-scrollbar-thumb {
  background: rgba(244, 241, 233, 0.16);
  border-radius: 99px;
}

.task-empty {
  padding: 20px 4px;
  font-family: var(--font-hand);
  font-size: calc(17px * var(--font-scale, 1));
  color: rgba(244, 241, 233, 0.32);
}

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px dashed rgba(244, 241, 233, 0.16);
}

.task-index {
  width: 24px;
  flex: none;
  font-family: var(--font-mono);
  font-size: calc(10px * var(--font-scale, 1));
  letter-spacing: 0.06em;
  color: var(--muted);
}

.task-check {
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: rgba(244, 241, 233, 0.62);
  transition: color 0.2s, transform 0.2s;
}

.task-check:hover {
  color: var(--acid);
  transform: scale(1.08) rotate(-4deg);
}

.task-circle {
  width: 16px;
  height: 16px;
  display: block;
}

.task-check img {
  width: 30px;
  height: 30px;
  max-width: none;
  object-fit: contain;
}

.task-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-hand);
  font-size: calc(19px * var(--font-scale, 1));
  line-height: 1.45;
  color: var(--bone);
  overflow-wrap: anywhere;
}

.task-row.done .task-text {
  color: rgba(154, 154, 164, 0.85);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(154, 154, 164, 0.5);
}

.task-del {
  flex: none;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: calc(16px * var(--font-scale, 1));
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  opacity: 0.45;
}

.task-del:hover {
  color: var(--pink);
  opacity: 1;
}

.task-add {
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px dashed rgba(244, 241, 233, 0.18);
  padding: 2px 0 4px;
}

.task-add input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  padding: 8px 4px;
  font-family: var(--font-hand);
  font-size: calc(17px * var(--font-scale, 1));
  color: var(--bone);
}

.task-add input::placeholder {
  color: rgba(244, 241, 233, 0.35);
  font-family: var(--font-hand);
}

.task-add input:focus {
  outline: none;
}

.task-add .btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: calc(18px * var(--font-scale, 1));
  flex: none;
}

.modal-box.day-modal {
  width: min(980px, 100%);
  grid-template-columns: 0.78fr 1.22fr;
  overflow: hidden;
}

.day-editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(90vh - 56px);
}

.day-editor > * {
  flex: 0 0 auto;
}

.day-editor .task-field {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.day-editor .task-field .task-list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 320px;
}

/* ------------------------------- 响应式 -------------------------------- */

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: 0;
    padding-top: 44px;
  }

  .hero-copy .eyebrow {
    margin-top: 0;
  }

  .orb-main {
    width: 120vw;
    right: -50vw;
    top: -14vh;
    opacity: 0.8;
  }

  .bg::after {
    background:
      radial-gradient(100% 70% at 50% 30%, rgba(8, 8, 10, 0.7) 0%, rgba(8, 8, 10, 0.35) 55%, transparent 80%),
      linear-gradient(to top, rgba(8, 8, 10, 0.9) 0%, transparent 22%);
  }

  .panel {
    max-width: 520px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .stage {
    order: -1;
  }

  .stage-inner {
    width: min(72%, 340px);
  }

  .two-col,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .preview-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .topbar {
    padding: 11px 0;
  }

  .topbar .wrap {
    gap: 10px;
  }

  .brand {
    font-size: calc(13px * var(--font-scale, 1));
    letter-spacing: 0.04em;
  }

  .brand small,
  .brand-word {
    display: none;
  }

  .nav-links {
    gap: 0;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    padding: 7px 8px;
    font-size: calc(11.5px * var(--font-scale, 1));
    white-space: nowrap;
  }

  .nav-user {
    gap: 6px;
  }

  .nav-user .who {
    display: none;
  }

  .nav-user .btn-sm {
    padding: 7px 11px;
    font-size: calc(11px * var(--font-scale, 1));
    white-space: nowrap;
  }

  .nav-user .avatar {
    width: 30px;
    height: 30px;
    font-size: calc(12px * var(--font-scale, 1));
  }

  .nav-user .btn-link {
    padding: 6px 4px;
    font-size: calc(11px * var(--font-scale, 1));
  }

  .hero {
    padding: 34px 0 50px;
  }

  .hero h1 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .lead {
    font-size: calc(14.5px * var(--font-scale, 1));
  }

  .steps {
    grid-template-columns: 1fr;
    padding: 56px 0;
  }

  .showcase {
    padding: 56px 0;
  }

  .preview-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .preview-row .card:nth-child(n + 5) {
    display: none;
  }

  .app-shell {
    padding-top: 32px;
  }

  .stage-inner {
    width: min(78%, 300px);
  }

  .page-head {
    padding: 34px 0 24px;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .birthday-slot {
    gap: 10px;
    padding: 10px 12px;
  }

  .mini-card {
    width: 48px;
  }

  .cal-body {
    padding: 12px;
  }

  .cal-grid,
  .cal-weekdays {
    gap: 8px;
  }

  .modal-box.day-modal {
    overflow: auto;
  }

  .day-editor {
    max-height: none;
  }

  .cal-cell {
    padding: 5px;
    border-radius: 7px;
  }

  .cal-day {
    font-size: calc(9px * var(--font-scale, 1));
  }

  .cal-mood {
    font-size: calc(10px * var(--font-scale, 1));
    right: 3px;
    top: 3px;
  }

  .cal-dot {
    right: 5px;
    bottom: 4px;
  }

  .cal-start .input {
    width: 132px;
  }

  .toast-wrap {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .cal-month {
    font-size: calc(15px * var(--font-scale, 1));
    min-width: 100px;
  }

  .modal-box {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .stat-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .stat-card .v {
    font-size: calc(24px * var(--font-scale, 1));
  }

  .modal-box.day-modal {
    grid-template-columns: 1fr;
  }

  .task-list {
    max-height: 220px;
  }

  .task-text {
    font-size: calc(17px * var(--font-scale, 1));
  }

  .result-meta.show {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 14px;
    align-items: start;
  }

  .result-meta .big {
    font-size: calc(34px * var(--font-scale, 1));
  }

  .result-meta .actions {
    grid-column: 1 / -1;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-meta .actions .btn {
    width: 100%;
    white-space: nowrap;
  }

  .app-shell h1 {
    line-height: 0.94;
  }

  .footer {
    font-size: calc(10px * var(--font-scale, 1));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
