/* =========================================================
   天之川沙夜 · Starfield × Heterochromia design system
   Blue (left eye) + Amber (right eye) over deep night sky
   ========================================================= */

:root {
  color-scheme: dark;
  --bg-0: #050a18;
  --bg-1: #0a1228;
  --bg-2: #101a34;
  --text: #eef3ff;
  --text-soft: #c5d0ea;
  --muted: #8b9bbf;
  --line: rgba(180, 205, 255, 0.12);
  --glass: rgba(12, 20, 42, 0.55);
  --glass-border: rgba(190, 210, 255, 0.14);
  --blue: #6ea8ff;
  --blue-deep: #3d7ef0;
  --blue-glow: rgba(110, 168, 255, 0.35);
  --amber: #e8a85c;
  --amber-soft: #ffd4a0;
  --amber-glow: rgba(232, 168, 92, 0.32);
  --white-glow: rgba(230, 240, 255, 0.08);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-sans: "Noto Sans SC", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", serif;
  --font-display: "Cormorant Garamond", "Noto Serif SC", serif;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  background: var(--bg-0);
  overflow-x: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

/* ---------- ambient layers ---------- */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 18% 8%, rgba(61, 126, 240, 0.16), transparent 60%),
    radial-gradient(ellipse 55% 40% at 82% 12%, rgba(232, 168, 92, 0.12), transparent 58%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(70, 90, 160, 0.14), transparent 55%),
    linear-gradient(180deg, #050a18 0%, #070f22 45%, #0b1020 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

#app {
  position: relative;
  z-index: 2;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 clamp(18px, 4vw, 40px);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(5, 10, 24, 0.72);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--blue) 0 50%, var(--amber) 50% 100%);
  box-shadow:
    0 0 18px var(--blue-glow),
    0 0 28px var(--amber-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-display);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.is-current {
  color: var(--text);
}

.site-nav a.is-current {
  position: relative;
}

.site-nav a.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--amber));
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  flex-direction: column;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text-soft);
  transition: transform 0.25s var(--ease);
}

/* ---------- layout ---------- */

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.section {
  padding: clamp(48px, 8vw, 88px) 0 0;
}

.section-head {
  margin-bottom: clamp(24px, 4vw, 36px);
  max-width: 40rem;
}

.section-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-display);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dot.blue {
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue-glow);
}

.dot.amber {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber-glow);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  min-height: calc(100vh - var(--header-h) - 24px);
  padding: clamp(20px, 4vw, 40px) 0 clamp(32px, 5vw, 48px);
}

.hero-bg-glow {
  position: absolute;
  inset: 10% -10% auto;
  height: 60%;
  background:
    radial-gradient(circle at 30% 40%, var(--blue-glow), transparent 45%),
    radial-gradient(circle at 75% 50%, var(--amber-glow), transparent 40%);
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
}

.hero-copy {
  position: relative;
}

.hero-title {
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-title-ja {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.hero-title-zh {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, #f4f7ff 20%, #b8d0ff 48%, #ffd9b0 78%, #f4f7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 500;
  color: var(--text-soft);
  line-height: 1.55;
}

.hero-lede {
  margin: 0 0 28px;
  color: var(--muted);
  max-width: 34ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

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

.btn-primary {
  color: #0a1020;
  background: linear-gradient(135deg, #dce8ff 0%, #9ec0ff 40%, #ffd4a0 100%);
  box-shadow: 0 10px 30px rgba(110, 168, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 14px 36px rgba(232, 168, 92, 0.28);
}

.btn-ghost {
  color: var(--text-soft);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(190, 210, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hero-meta li {
  display: flex;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.hero-meta span {
  min-width: 2.5rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-frame {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 3 / 4;
  border-radius: calc(var(--radius-lg) + 4px);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  background:
    radial-gradient(ellipse 70% 50% at 50% 18%, rgba(110, 168, 255, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 40% at 62% 42%, rgba(232, 168, 92, 0.1), transparent 50%),
    linear-gradient(180deg, #121c38 0%, #0a1228 55%, #070d1c 100%);
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  /* 保留浏览器高质量缩放，避免发糊 */
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.hero-ring {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  border: 1px solid rgba(158, 192, 255, 0.15);
  box-shadow:
    0 0 60px rgba(110, 168, 255, 0.08),
    inset 0 0 60px rgba(232, 168, 92, 0.05);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite;
  z-index: 0;
}

.hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 48%, rgba(5, 10, 24, 0.72) 100%),
    radial-gradient(circle at 30% 25%, rgba(110, 168, 255, 0.12), transparent 35%),
    radial-gradient(circle at 70% 30%, rgba(232, 168, 92, 0.1), transparent 32%);
  pointer-events: none;
}

.hero-caption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.eye-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-display);
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
}

.eye-chip.blue {
  color: #d9e8ff;
  background: rgba(40, 80, 160, 0.35);
  border-color: rgba(110, 168, 255, 0.35);
}

.eye-chip.amber {
  color: #ffe8c8;
  background: rgba(120, 80, 30, 0.35);
  border-color: rgba(232, 168, 92, 0.35);
}

@keyframes drift {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(8deg) scale(1.03);
  }
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.about-main {
  padding: clamp(22px, 3vw, 32px);
}

.about-main h3,
.trait-card h3,
.note-meta h3,
.profile-id h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.about-main p {
  margin: 0 0 14px;
  color: var(--text-soft);
}

.about-main p:last-child {
  margin-bottom: 0;
}

.about-story {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted) !important;
}

.trait-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trait-card {
  padding: 18px 16px;
}

.trait-icon {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--amber-soft);
  text-shadow: 0 0 12px var(--amber-glow);
}

.trait-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* ---------- profile ---------- */

.profile-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 16px;
  align-items: stretch;
}

.profile-card {
  padding: clamp(22px, 3vw, 32px);
}

.profile-romaji {
  margin: 0 0 4px;
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.85rem;
}

.profile-id h3 span {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.profile-aliases {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.stat {
  padding: 12px 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(190, 210, 255, 0.08);
}

.stat dt {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.stat dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.profile-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  padding-top: 4px;
}

.profile-extra .label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.profile-extra p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-links a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.86rem;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.profile-links a:hover {
  border-color: rgba(110, 168, 255, 0.4);
  background: rgba(110, 168, 255, 0.08);
  color: var(--text);
}

.quote-featured {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: clamp(24px, 3vw, 36px);
  background:
    radial-gradient(circle at 20% 20%, rgba(110, 168, 255, 0.12), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(232, 168, 92, 0.1), transparent 40%),
    var(--glass);
}

.quote-featured p {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.7;
  color: var(--text);
}

.quote-featured footer {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- gallery ---------- */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s var(--ease);
}

.filter-btn:hover {
  color: var(--text);
  border-color: rgba(190, 210, 255, 0.28);
}

.filter-btn.is-active {
  color: #0a1020;
  border-color: transparent;
  background: linear-gradient(135deg, #dce8ff, #ffd4a0);
  font-weight: 500;
}

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

.shot {
  position: relative;
  margin: 0;
  grid-column: span 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  min-height: 280px;
}

.shot:nth-child(1) {
  grid-column: span 7;
  min-height: 420px;
}

.shot:nth-child(2) {
  grid-column: span 5;
  min-height: 420px;
}

.shot-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  position: absolute;
  inset: 0;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 0.6s var(--ease);
}

/* 主立绘透明 PNG：给一点星空底，避免发灰发糊感 */
.shot[data-category="立绘"] .shot-open {
  background:
    radial-gradient(ellipse 60% 45% at 50% 20%, rgba(110, 168, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #121c38 0%, #0a1228 100%);
}

.shot:hover img {
  transform: scale(1.04);
}

.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4, 8, 20, 0.88) 100%);
  pointer-events: none;
}

.shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 18px 16px 16px;
  pointer-events: none;
}

.shot-cat {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-soft);
  font-family: var(--font-display);
}

.shot figcaption strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.shot figcaption p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ---------- quotes ---------- */

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

.quote-card {
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}

.quote-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--blue), var(--amber));
  opacity: 0.85;
}

.quote-text {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text);
}

.quote-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.quote-source {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  font-family: var(--font-display);
}

/* ---------- notes ---------- */

.notes-list {
  display: grid;
  gap: 14px;
}

.note-card {
  display: grid;
  grid-template-columns: minmax(140px, 0.32fr) 1fr;
  gap: 18px;
  padding: 22px 22px;
}

.note-date {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: var(--font-display);
}

.note-card p {
  margin: 0;
  color: var(--text-soft);
}

/* ---------- footer ---------- */

.site-footer {
  width: min(1180px, calc(100vw - 32px));
  margin: 64px auto 0;
  padding: 48px 0 56px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer-constellation {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.footer-constellation .line {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), var(--amber));
  opacity: 0.55;
}

.footer-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.footer-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-hint {
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.footer-credit {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.8;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  opacity: 0.9;
}

.footer-meta a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-meta a:hover {
  color: var(--amber-soft);
  border-bottom-color: rgba(232, 168, 92, 0.45);
}

.footer-meta-sep {
  opacity: 0.45;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 14, 0.82);
  backdrop-filter: blur(10px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(92vh, 980px);
  display: grid;
  grid-template-rows: 1fr auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #0a1224;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}

.lightbox-panel img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #050a16;
}

.lightbox-meta {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
}

.lightbox-meta span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-soft);
  font-family: var(--font-display);
}

.lightbox-meta strong {
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.lightbox-meta p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text);
}

.lightbox-nav {
  position: absolute;
  top: 40%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text);
}

.lightbox-nav.prev {
  left: 12px;
}

.lightbox-nav.next {
  right: 12px;
}

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.shot.reveal {
  transition-delay: 0.04s;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 12px;
  }

  .hero-visual {
    order: -1;
  }

  .hero-frame {
    width: min(100%, 380px);
  }

  .about-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

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

  .shot,
  .shot:nth-child(1),
  .shot:nth-child(2) {
    grid-column: span 6;
    min-height: 320px;
  }

  .note-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 720px) {
  .page,
  .site-footer {
    width: min(100vw - 20px, 1180px);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 12px;
    right: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(8, 14, 30, 0.94);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .site-nav a:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .trait-grid,
  .quotes-grid,
  .profile-extra {
    grid-template-columns: 1fr;
  }

  .shot,
  .shot:nth-child(1),
  .shot:nth-child(2) {
    grid-column: span 12;
    min-height: 300px;
  }

  .hero-title-zh {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-ring {
    animation: none;
  }

  .shot img,
  .archive-card img {
    transition: none;
  }
}

/* =========================================================
   Full gallery archive page
   ========================================================= */

.archive-page {
  padding-top: 8px;
}

.archive-hero {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 18px;
  align-items: stretch;
  padding: 18px 0 8px;
}

.archive-hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.archive-lede {
  margin: 0 0 22px;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.8;
}

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

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-pill span {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.archive-hero-side {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.archive-hero-side .label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: var(--font-display);
}

.archive-hero-side ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.75;
}

.archive-hero-side li {
  margin-bottom: 6px;
}

.archive-hero-side code,
.drop-hint code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86em;
  color: var(--blue);
  background: rgba(110, 168, 255, 0.1);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

.archive-hero-side .btn {
  align-self: flex-start;
  margin-top: auto;
}

.gallery-head,
.archive-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gallery-more {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.filter-count {
  font-style: normal;
  margin-left: 6px;
  opacity: 0.7;
  font-size: 0.82em;
}

.filter-btn.is-active .filter-count {
  opacity: 0.85;
  color: inherit;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.archive-card {
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background:
    radial-gradient(ellipse 60% 45% at 50% 20%, rgba(110, 168, 255, 0.1), transparent 55%),
    linear-gradient(180deg, #121c38 0%, #0a1228 100%);
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.archive-open {
  position: relative;
  display: block;
  width: 100%;
  flex: 1;
  min-height: 220px;
  padding: 0;
  overflow: hidden;
}

.archive-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.55s var(--ease);
}

/* 主视觉全图偏右为其他角色；无 inline 时兜底对准左侧沙夜 */
.archive-card[data-id="art-mv"] img {
  object-position: 14% 42%;
}

.archive-card:hover img {
  transform: scale(1.04);
}

.archive-zoom {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(5, 10, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  font-family: var(--font-display);
}

.archive-card:hover .archive-zoom {
  opacity: 1;
  transform: none;
}

.archive-card figcaption {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, rgba(4, 8, 20, 0.55), rgba(4, 8, 20, 0.94));
  margin-top: -48px;
}

.archive-card figcaption strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-size: 1.02rem;
}

.archive-card figcaption p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  /* 保证说明在卡片上始终可见，最多约 3 行 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.archive-card figcaption p:empty {
  display: none;
}

.archive-card[data-source="ai"] {
  box-shadow: inset 0 0 0 1px rgba(232, 168, 92, 0.12);
}

.archive-card[data-source="official-cg"] {
  box-shadow: inset 0 0 0 1px rgba(110, 168, 255, 0.1);
}

.drop-hint {
  padding: clamp(28px, 5vw, 42px);
  text-align: center;
  max-width: 640px;
  margin: 8px auto;
  position: relative;
  overflow: hidden;
}

.drop-hint-orb {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0 50%, var(--amber) 50% 100%);
  box-shadow: 0 0 30px var(--blue-glow), 0 0 40px var(--amber-glow);
}

.drop-hint h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.drop-hint p {
  margin: 0 0 12px;
  color: var(--text-soft);
}

.drop-hint ol {
  text-align: left;
  display: inline-block;
  margin: 8px 0 14px;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.8;
}

.drop-hint-note {
  font-size: 0.9rem;
  color: var(--muted) !important;
}

.empty-tip {
  margin: 24px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .archive-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .archive-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .archive-card {
    min-height: 240px;
  }

  .archive-open {
    min-height: 160px;
  }

  .gallery-head .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .archive-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Quotes archive page
   ========================================================= */

.quotes-full-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.quote-full-card {
  padding: clamp(20px, 3vw, 28px);
  position: relative;
  overflow: hidden;
}

.quote-full-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--blue), var(--amber));
  opacity: 0.9;
}

.quote-full-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.quote-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(110, 168, 255, 0.28);
  background: rgba(110, 168, 255, 0.08);
  color: var(--blue);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
}

.quote-full-card[data-category="about"] .quote-badge {
  border-color: rgba(232, 168, 92, 0.3);
  background: rgba(232, 168, 92, 0.08);
  color: var(--amber-soft);
}

.quote-full-card[data-category="star"] .quote-badge {
  border-color: rgba(190, 210, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.quote-full-card[data-category="ai"] .quote-badge {
  border-color: rgba(196, 148, 255, 0.35);
  background: rgba(196, 148, 255, 0.1);
  color: #d4b8ff;
}

.quote-speaker {
  color: var(--muted);
  font-size: 0.88rem;
}

.quote-full-text {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.12rem, 2.2vw, 1.35rem);
  line-height: 1.8;
  color: var(--text);
}

.quote-full-ja {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.quote-full-context {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.quote-full-source {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.quotes-disclaimer {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.quotes-disclaimer code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  color: var(--blue);
  background: rgba(110, 168, 255, 0.1);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

@media (min-width: 900px) {
  .quotes-full-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quote-full-card:first-child,
  .quote-full-card[data-category="saya"]:nth-of-type(1) {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   Companion page
   ========================================================= */

.companion-page {
  padding-top: 8px;
}

.companion-hero {
  padding-top: 12px;
}

.companion-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}

.companion-presence {
  padding: clamp(22px, 3.5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.companion-title {
  margin: 8px 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.companion-greeting {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.75;
  color: var(--text);
}

.companion-visit {
  margin: 0 0 8px;
  color: var(--amber-soft);
  font-size: 0.95rem;
}

/* ---------- 好感度（独立页 + 共用仪表） ---------- */

.affinity-page {
  padding-top: 8px;
}

.affinity-hero {
  padding-top: 12px;
}

.affinity-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}

.affinity-presence {
  padding: clamp(22px, 3.5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.affinity-title {
  margin: 8px 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.affinity-lead {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 42ch;
}

.affinity-lead a {
  color: var(--amber-soft);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* 陪伴页入口卡片（完整仪表在好感页） */
.affinity-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "label stage value"
    "go go go";
  gap: 6px 14px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(110, 168, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(110, 168, 255, 0.08), rgba(232, 168, 92, 0.06)),
    rgba(5, 10, 24, 0.3);
  transition:
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.affinity-entry:hover {
  border-color: rgba(232, 168, 92, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.affinity-entry-label {
  grid-area: label;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-display);
}

.affinity-entry-stage {
  grid-area: stage;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--amber-soft);
}

.affinity-entry-value {
  grid-area: value;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.88rem;
  justify-self: end;
}

.affinity-entry-value strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
}

.affinity-entry-go {
  grid-area: go;
  font-size: 0.82rem;
  color: var(--blue);
  letter-spacing: 0.04em;
}

.affinity-chip {
  text-decoration: none;
}

.affinity-chip:hover {
  border-color: rgba(232, 168, 92, 0.55);
  background: rgba(232, 168, 92, 0.18);
}

.affinity-roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.affinity-road-card {
  padding: 18px 18px 16px;
  opacity: 0.55;
  transition: opacity 0.3s var(--ease), border-color 0.3s var(--ease);
}

.affinity-road-card.is-reached {
  opacity: 1;
}

.affinity-road-card.is-current {
  border-color: rgba(232, 168, 92, 0.4);
  box-shadow: 0 0 0 1px rgba(232, 168, 92, 0.1), 0 0 24px rgba(110, 168, 255, 0.08);
}

.affinity-road-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.affinity-road-idx {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--blue);
}

.affinity-road-min {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.affinity-road-name {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.affinity-road-desc {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-soft);
  min-height: 2.8em;
}

.affinity-unlock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.affinity-unlock-card {
  margin: 0;
}

.affinity-empty {
  padding: clamp(22px, 3vw, 32px);
  color: var(--text-soft);
  line-height: 1.75;
}

.affinity-empty-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.affinity-daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.affinity-daily-panel {
  padding: clamp(18px, 2.5vw, 24px);
}

.affinity-daily-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.affinity-daily-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.affinity-daily-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.affinity-daily-label {
  font-size: 0.92rem;
  color: var(--text);
}

.affinity-daily-nums {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--muted);
}

.affinity-daily-hint {
  margin: 4px 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.affinity-daily-link {
  margin-top: 16px;
}

@media (max-width: 920px) {
  .affinity-hero-grid {
    grid-template-columns: 1fr;
  }
}

.affinity-meter {
  margin: 14px 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(110, 168, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(110, 168, 255, 0.07), rgba(232, 168, 92, 0.06)),
    rgba(5, 10, 24, 0.35);
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.affinity-meter.is-compact {
  margin: 0;
}

.affinity-meter.is-pulse {
  border-color: rgba(232, 168, 92, 0.42);
  box-shadow: 0 0 0 1px rgba(232, 168, 92, 0.12), 0 0 24px rgba(110, 168, 255, 0.12);
}

.affinity-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.affinity-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-display);
}

.affinity-value {
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.affinity-value strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.04em;
}

.affinity-max {
  color: var(--muted);
  font-size: 0.85rem;
}

.affinity-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(190, 210, 255, 0.1);
  overflow: hidden;
}

.affinity-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #9ec0ff 42%, var(--amber));
  box-shadow: 0 0 12px var(--blue-glow);
  transition: width 0.55s var(--ease);
  min-width: 0;
}

.affinity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: 10px;
}

.affinity-stage {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--amber-soft);
  letter-spacing: 0.04em;
}

.affinity-next {
  font-size: 0.8rem;
  color: var(--muted);
}

.affinity-desc {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 40ch;
}

.affinity-stage-bar {
  margin-top: 10px;
  height: 3px;
  border-radius: 999px;
  background: rgba(190, 210, 255, 0.08);
  overflow: hidden;
}

.affinity-stage-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(110, 168, 255, 0.75), rgba(232, 168, 92, 0.85));
  transition: width 0.55s var(--ease);
}

.affinity-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(232, 168, 92, 0.35);
  background: rgba(232, 168, 92, 0.12);
  color: var(--amber-soft);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.affinity-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 80;
  min-width: min(320px, calc(100vw - 32px));
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(110, 168, 255, 0.28);
  background: rgba(8, 14, 32, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(232, 168, 92, 0.08);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.affinity-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.affinity-toast[data-level="up"] {
  border-color: rgba(232, 168, 92, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(232, 168, 92, 0.15);
}

.affinity-toast-title {
  margin: 0 0 6px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--blue);
  font-family: var(--font-display);
}

.affinity-toast[data-level="up"] .affinity-toast-title {
  color: var(--amber-soft);
}

.affinity-toast-line {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}

.affinity-toast-pts {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.companion-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 42ch;
}

.companion-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.companion-portrait {
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.companion-portrait img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center top;
}

.companion-portrait-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  background: linear-gradient(180deg, transparent, rgba(5, 10, 24, 0.88));
}

.companion-portrait-name {
  margin-left: auto;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-soft);
}

.companion-bubble {
  padding: clamp(24px, 4vw, 36px);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.companion-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--blue), var(--amber));
}

.companion-bubble.is-pop {
  animation: companion-pop 0.45s var(--ease);
}

@keyframes companion-pop {
  0% {
    transform: translateY(6px);
    opacity: 0.55;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

.companion-bubble-text {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.8;
  max-width: 36em;
}

.companion-bubble-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(110, 168, 255, 0.28);
  background: rgba(110, 168, 255, 0.08);
  color: var(--blue);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
}

.companion-bubble[data-mood="tease"] .companion-bubble-badge,
.companion-bubble[data-mood="care"] .companion-bubble-badge {
  border-color: rgba(232, 168, 92, 0.3);
  background: rgba(232, 168, 92, 0.08);
  color: var(--amber-soft);
}

.companion-timer {
  padding: clamp(22px, 3.5vw, 32px);
}

.timer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.timer-face {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.timer-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg,
.timer-ring-fg {
  fill: none;
  stroke-width: 6;
}

.timer-ring-bg {
  stroke: rgba(190, 210, 255, 0.12);
}

.timer-ring-fg {
  stroke: var(--blue);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--blue-glow));
  transition: stroke-dashoffset 0.2s linear;
}

.timer-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(0deg);
  pointer-events: none;
}

.timer-readout strong {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.timer-readout span {
  margin-top: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.timer-done-line {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--amber-soft);
  line-height: 1.7;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.timer-done-line.is-visible {
  opacity: 1;
}

/* ---------- 随口互动 ---------- */

.companion-interact {
  padding: clamp(20px, 3vw, 28px);
}

.interact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.interact-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  text-align: left;
  line-height: 1.35;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.interact-chip:hover {
  border-color: rgba(110, 168, 255, 0.42);
  background: rgba(110, 168, 255, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.interact-chip.is-active {
  border-color: rgba(232, 168, 92, 0.45);
  background: rgba(232, 168, 92, 0.12);
  color: var(--text);
}

.interact-chip-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.interact-chip-hint {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.interact-chip.is-active .interact-chip-hint {
  color: var(--amber-soft);
  opacity: 0.9;
}

.interact-reply {
  margin: 0;
}

.interact-you {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.interact-again {
  margin-top: 14px;
}

.companion-dialogue {
  padding: clamp(20px, 3vw, 28px);
}

.dialogue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.dialogue-stage {
  padding: 8px 4px 4px;
}

.dialogue-speaker {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: var(--font-display);
}

.dialogue-text {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: clamp(1.12rem, 2.3vw, 1.35rem);
  line-height: 1.8;
  color: var(--text);
  max-width: 38em;
}

.dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  max-width: 28rem;
}

.dialogue-choice {
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  line-height: 1.55;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.dialogue-choice:hover {
  border-color: rgba(110, 168, 255, 0.4);
  background: rgba(110, 168, 255, 0.08);
  color: var(--text);
}

.dialogue-choices .btn {
  align-self: flex-start;
}

@media (max-width: 920px) {
  .companion-hero-grid {
    grid-template-columns: 1fr;
  }

  .companion-portrait {
    order: -1;
    max-height: 420px;
  }

  .companion-portrait img {
    min-height: 280px;
    max-height: 420px;
  }

  .timer-face {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .timer-actions {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .companion-bubble.is-pop {
    animation: none;
  }

  .timer-ring-fg {
    transition: none;
  }
}

/* ---------- themes (affinity milestones) ---------- */

html[data-theme="blue-night"] {
  --bg-0: #040a16;
  --bg-1: #081428;
  --bg-2: #0c1c38;
  --blue: #7eb6ff;
  --blue-glow: rgba(126, 182, 255, 0.42);
  --amber: #c9b08a;
  --amber-glow: rgba(201, 176, 138, 0.22);
}

html[data-theme="blue-night"] .aurora {
  opacity: 0.85;
  filter: hue-rotate(-12deg) saturate(1.15);
}

html[data-theme="amber-warm"] {
  --bg-0: #0a0810;
  --bg-1: #16101a;
  --bg-2: #1e1420;
  --blue: #8aa8d8;
  --blue-glow: rgba(138, 168, 216, 0.22);
  --amber: #f0b46a;
  --amber-soft: #ffe0b0;
  --amber-glow: rgba(240, 180, 106, 0.4);
}

html[data-theme="amber-warm"] .aurora {
  filter: hue-rotate(28deg) saturate(1.1);
}

html[data-theme="milky-way"] {
  --bg-0: #050812;
  --bg-1: #0c1028;
  --bg-2: #141a38;
  --blue: #8ec0ff;
  --amber: #f0bc78;
  --blue-glow: rgba(142, 192, 255, 0.4);
  --amber-glow: rgba(240, 188, 120, 0.38);
  --glass-border: rgba(210, 220, 255, 0.2);
}

html[data-theme="milky-way"] .aurora {
  opacity: 1;
  filter: saturate(1.2) brightness(1.05);
}

/* ---------- portrait frames ---------- */

.portrait-frame {
  position: relative;
}

.portrait-frame--soft-ring {
  box-shadow:
    0 0 0 1px rgba(190, 210, 255, 0.18),
    0 0 40px rgba(110, 168, 255, 0.18),
    var(--shadow);
}

.portrait-frame--soft-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(190, 210, 255, 0.22);
  pointer-events: none;
}

.portrait-frame--dual-glow {
  box-shadow:
    0 0 0 1px rgba(232, 168, 92, 0.28),
    -12px 0 36px rgba(110, 168, 255, 0.22),
    12px 0 36px rgba(232, 168, 92, 0.22),
    var(--shadow);
}

.portrait-frame--dual-glow::before,
.portrait-frame--dual-glow::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}

.portrait-frame--dual-glow::before {
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, var(--blue), transparent 45%, var(--amber)) 1;
  opacity: 0.7;
}

.portrait-frame--constellation {
  box-shadow:
    0 0 0 1px rgba(230, 240, 255, 0.28),
    0 0 50px rgba(110, 168, 255, 0.25),
    0 0 80px rgba(232, 168, 92, 0.12),
    var(--shadow);
}

.portrait-frame--constellation::after {
  content: "✦ · ✧ · ★";
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  color: rgba(230, 240, 255, 0.55);
  pointer-events: none;
  text-shadow: 0 0 12px var(--blue-glow);
}

/* ---------- birthday ---------- */

.birthday-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: clamp(16px, 2.5vw, 22px) clamp(18px, 3vw, 26px);
  margin-bottom: 18px;
  border-color: rgba(232, 168, 92, 0.28);
  background: linear-gradient(
    120deg,
    rgba(232, 168, 92, 0.1),
    rgba(110, 168, 255, 0.08) 55%,
    rgba(12, 20, 42, 0.5)
  );
}

.birthday-banner.is-today {
  border-color: rgba(232, 168, 92, 0.45);
  box-shadow: 0 0 40px rgba(232, 168, 92, 0.12);
}

.birthday-banner-kicker {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: var(--font-display);
}

.birthday-banner-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 600;
}

.birthday-banner-text {
  margin: 0;
  max-width: 40em;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.birthday-home {
  margin: 0 0 18px;
  padding: 16px 18px;
  max-width: 32rem;
}

.birthday-home-kicker {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.birthday-home-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.birthday-home-text {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.birthday-countdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(12, 20, 42, 0.45);
  font-size: 0.88rem;
  color: var(--text-soft);
}

.birthday-countdown-chip strong {
  color: var(--amber-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- care checklist ---------- */

.companion-care {
  padding: clamp(20px, 3vw, 28px);
}

.care-progress {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.care-progress strong {
  color: var(--amber-soft);
  font-variant-numeric: tabular-nums;
}

.care-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.care-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

.care-item:hover:not(:disabled) {
  border-color: rgba(110, 168, 255, 0.4);
  background: rgba(110, 168, 255, 0.08);
}

.care-item.is-done {
  opacity: 0.72;
  border-color: rgba(232, 168, 92, 0.35);
  background: rgba(232, 168, 92, 0.08);
  cursor: default;
}

.care-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--amber);
}

.care-item.is-done .care-check {
  border-color: var(--amber);
  background: rgba(232, 168, 92, 0.2);
}

.care-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.care-label {
  font-size: 0.95rem;
  color: var(--text);
}

.care-icon {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.care-reply {
  margin-top: 4px;
}

.interact-locked-hint {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.interact-locked-hint a {
  color: var(--blue);
  text-decoration: none;
}

.interact-locked-hint a:hover {
  text-decoration: underline;
}

.interact-chip.is-unlock .interact-chip-label::after {
  content: "✦";
  margin-left: 6px;
  font-size: 0.7em;
  color: var(--amber);
  opacity: 0.85;
}

.filter-btn.is-unlock::after {
  content: "✦";
  margin-left: 6px;
  font-size: 0.7em;
  color: var(--amber);
}

.filter-btn.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- calm · 心事安放 ---------- */

.companion-calm {
  padding: clamp(20px, 3vw, 28px);
}

.calm-step-head {
  margin-bottom: 14px;
}

.calm-step-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.calm-step-title {
  margin: 0 0 8px;
  font-family: "Noto Serif SC", "Cormorant Garamond", serif;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 600;
  color: var(--text);
}

.calm-step-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
}

.calm-progress {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
}

.calm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  transition:
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.calm-dot.is-done {
  background: rgba(110, 168, 255, 0.55);
  border-color: rgba(110, 168, 255, 0.5);
}

.calm-dot.is-current {
  background: rgba(232, 168, 92, 0.75);
  border-color: rgba(232, 168, 92, 0.65);
  box-shadow: 0 0 10px rgba(232, 168, 92, 0.35);
}

.calm-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.calm-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.calm-chip:hover {
  border-color: rgba(110, 168, 255, 0.4);
  background: rgba(110, 168, 255, 0.08);
}

.calm-chip.is-active {
  border-color: rgba(232, 168, 92, 0.5);
  background: rgba(232, 168, 92, 0.1);
  box-shadow: 0 0 0 1px rgba(232, 168, 92, 0.15);
}

.calm-chip-icon {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--amber-soft);
}

.calm-chip-label {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.calm-chip-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.calm-margin {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.calm-margin-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.calm-margin-input {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  max-height: 140px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(5, 10, 24, 0.45);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.calm-margin-input::placeholder {
  color: rgba(154, 172, 207, 0.55);
}

.calm-margin-input:focus {
  border-color: rgba(110, 168, 255, 0.45);
}

.calm-margin-hint {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.9;
}

.calm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.calm-you {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.calm-margin-echo {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(232, 168, 92, 0.55);
  background: rgba(232, 168, 92, 0.06);
  font-size: 0.9rem;
  color: var(--amber-soft);
  line-height: 1.55;
}

.calm-reply {
  margin-top: 4px;
}

.calm-ground-hint {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
}

.calm-ground-side {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
}

.calm-breath {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px 12px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background:
    radial-gradient(ellipse 60% 50% at 35% 45%, rgba(91, 157, 255, 0.12), transparent 70%),
    radial-gradient(ellipse 55% 50% at 65% 50%, rgba(232, 168, 92, 0.1), transparent 70%),
    rgba(255, 255, 255, 0.02);
}

.calm-breath-orbs {
  position: relative;
  width: 140px;
  height: 140px;
}

.calm-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  transition:
    transform 0.6s var(--ease),
    opacity 0.6s var(--ease),
    box-shadow 0.6s var(--ease);
}

.calm-orb-blue {
  background: radial-gradient(circle at 35% 30%, #cfe0ff, #5b9dff 55%, rgba(40, 80, 160, 0.4));
  box-shadow: 0 0 24px rgba(91, 157, 255, 0.45);
  transform: translate(-18px, 0) scale(0.92);
}

.calm-orb-amber {
  background: radial-gradient(circle at 35% 30%, #ffe6c2, #e8a85c 55%, rgba(140, 90, 40, 0.35));
  box-shadow: 0 0 24px rgba(232, 168, 92, 0.4);
  transform: translate(18px, 0) scale(0.92);
}

.calm-breath[data-phase="in"] .calm-orb-blue {
  transform: translate(-10px, 0) scale(1.18);
  opacity: 1;
}

.calm-breath[data-phase="in"] .calm-orb-amber {
  transform: translate(10px, 0) scale(1.05);
  opacity: 0.9;
}

.calm-breath[data-phase="hold"] .calm-orb-blue,
.calm-breath[data-phase="hold"] .calm-orb-amber {
  transform: translate(0, 0) scale(1.12);
  opacity: 1;
}

.calm-breath[data-phase="out"] .calm-orb-blue {
  transform: translate(-28px, 4px) scale(0.78);
  opacity: 0.75;
}

.calm-breath[data-phase="out"] .calm-orb-amber {
  transform: translate(28px, -4px) scale(0.78);
  opacity: 0.7;
}

.calm-breath-readout {
  text-align: center;
}

.calm-breath-phase {
  display: block;
  font-family: "Noto Serif SC", serif;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 4px;
}

.calm-breath-count {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--amber-soft);
  letter-spacing: 0.04em;
}

.calm-breath-cue {
  margin: 8px 0 0;
  max-width: 28em;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.calm-breath-bar {
  width: min(240px, 80%);
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.calm-breath-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5b9dff, #e8a85c);
  transition: width 0.12s linear;
}

.calm-breath-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.calm-release-stage {
  position: relative;
  padding: 22px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(5, 10, 24, 0.4);
  overflow: hidden;
  text-align: center;
}

.calm-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.calm-sky-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.55;
  animation: calm-twinkle 2.8s ease-in-out infinite;
}

.calm-sky-star.s1 {
  top: 22%;
  left: 18%;
  background: #9ec0ff;
}
.calm-sky-star.s2 {
  top: 35%;
  left: 72%;
  animation-delay: 0.4s;
  background: #ffd4a0;
}
.calm-sky-star.s3 {
  top: 58%;
  left: 30%;
  animation-delay: 0.9s;
}
.calm-sky-star.s4 {
  top: 18%;
  left: 55%;
  width: 2px;
  height: 2px;
  animation-delay: 1.2s;
}
.calm-sky-star.s5 {
  top: 68%;
  left: 78%;
  animation-delay: 0.2s;
  background: #9ec0ff;
}

@keyframes calm-twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.35);
  }
}

.calm-release-note {
  position: relative;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--amber-soft);
}

.calm-done-summary {
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.calm-done-summary strong {
  color: var(--amber-soft);
  font-variant-numeric: tabular-nums;
}

.calm-done-summary a {
  color: var(--blue);
  text-decoration: none;
}

.calm-done-summary a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .calm-sky-star {
    animation: none;
    opacity: 0.7;
  }

  .calm-orb {
    transition: none;
  }

  .calm-breath-bar-fill {
    transition: none;
  }
}

/* ---------- milestones / appearance / backup ---------- */

.affinity-appearance {
  padding: clamp(18px, 2.5vw, 24px);
  margin-bottom: 20px;
}

.appearance-block + .appearance-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.appearance-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-family: var(--font-serif);
}

.appearance-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.appearance-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.milestone-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.milestone-card {
  padding: clamp(16px, 2.2vw, 22px);
}

.milestone-card.is-reached {
  border-color: rgba(110, 168, 255, 0.28);
}

.milestone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.milestone-head h3 {
  margin: 0;
  flex: 1;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.milestone-min {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--amber);
  letter-spacing: 0.06em;
}

.milestone-status {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.milestone-card.is-reached .milestone-status {
  color: var(--blue);
}

.milestone-unlocks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.milestone-unlock {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.milestone-unlock strong {
  grid-column: 2;
  font-size: 0.95rem;
}

.milestone-unlock span:last-child {
  grid-column: 2;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.milestone-kind {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  min-width: 2.5em;
}

.milestone-unlock.is-fog {
  opacity: 0.55;
}

.affinity-road-rewards {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--blue);
  line-height: 1.5;
}

.affinity-road-rewards.is-locked {
  color: var(--muted);
}

.affinity-backup {
  padding: clamp(20px, 3vw, 28px);
}

.backup-lead {
  margin: 0 0 16px;
  color: var(--text-soft);
  max-width: 40em;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.backup-import-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.backup-status {
  min-height: 1.4em;
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--blue);
}

.backup-status[data-ok="0"] {
  color: #ff9b9b;
}

.backup-warn {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .birthday-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .milestone-unlock {
    grid-template-columns: 1fr;
  }

  .milestone-kind {
    grid-row: auto;
  }
}

/* =========================================================
   系统浮窗陪伴（极简：随机面部 + 陪伴话语）
   ========================================================= */

.float-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-sans);
  background: var(--bg-0);
  overflow-x: hidden;
  overflow-y: auto;
}

.float-sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 45% at 30% 15%, rgba(110, 168, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 40%, rgba(232, 168, 92, 0.1), transparent 50%),
    linear-gradient(180deg, #050a18 0%, #0a1228 100%);
}

.float-sky::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    radial-gradient(1.2px 1.2px at 18% 22%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 72% 28%, rgba(190, 210, 255, 0.5), transparent),
    radial-gradient(1.1px 1.1px at 42% 68%, rgba(255, 212, 160, 0.4), transparent),
    radial-gradient(1px 1px at 88% 72%, rgba(255, 255, 255, 0.45), transparent);
}

#float-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.float-app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  max-width: 320px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}

.float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 0 2px;
}

.float-kicker {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.float-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-soft);
  flex-shrink: 0;
}

.float-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.float-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 12px 14px;
  flex: 1;
}

.float-portrait-btn {
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
}

.float-portrait-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* 圆形面部：裁切参数由 --face-x / --face-y / --face-scale 控制 */
.float-portrait {
  --face-x: 50%;
  --face-y: 10%;
  --face-scale: 3.2;
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  box-shadow:
    0 0 0 2px rgba(190, 210, 255, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

.float-portrait.is-swap {
  animation: float-avatar-swap 0.35s var(--ease);
}

@keyframes float-avatar-swap {
  0% {
    opacity: 0.45;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.float-portrait img,
.float-portrait .float-portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--face-x) var(--face-y);
  transform: scale(var(--face-scale));
  transform-origin: var(--face-x) var(--face-y);
}

.float-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.float-bubble {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  box-sizing: border-box;
}

.float-bubble .companion-bubble-text {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: none;
}

.float-bubble .companion-bubble-badge {
  min-height: 22px;
  font-size: 0.72rem;
}

.float-toolbar {
  display: flex;
  width: 100%;
  gap: 6px;
}

.float-toolbar .float-mini-btn {
  flex: 1;
  min-height: 36px;
  padding: 0 8px;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.float-launch-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(10, 16, 32, 0.92);
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: var(--shadow);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.float-launch-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 300px) {
  .float-portrait {
    width: 120px;
    height: 120px;
  }

  .float-toolbar {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-portrait.is-swap {
    animation: none;
  }
}


