@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700;800&display=swap');

/* ── Dark Mode (Default) ────────────────── */
:root {
  --bg: #000000;
  --bg-1: #050508;
  --bg-2: #0a0a10;
  --grid-color: rgba(255, 255, 255, 0.015);
  --surface: rgba(255, 255, 255, 0.02);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-secondary: rgba(255, 255, 255, 0.08);
  --text: #eaedf3;
  --text-secondary: rgba(234, 237, 243, 0.4);
  --accent: #007AFF;
  --accent-glow: rgba(0, 122, 255, 0.03);
  --accent-2: #5AC8FA;
  --accent-2-glow: rgba(90, 200, 250, 0.02);
  --line: rgba(255, 255, 255, 0.04);
  --line-strong: rgba(255, 255, 255, 0.08);
  --danger: #FF3B30;
  --success: #34C759;
  --warning: #FF9500;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --font-display: 'Sora', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --glass-blur: 12px;
  --glass-contrast: 1.1;
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-shadow: rgba(0, 0, 0, 0.2);
}

/* ── Light Mode ─────────────────────────── */
:root.light {
  --bg: #FAFAFA;
  --bg-1: #FFFFFF;
  --bg-2: #F5F5F5;
  --grid-color: rgba(0, 0, 0, 0.015);
  --surface: rgba(0, 0, 0, 0.02);
  --surface-hover: rgba(0, 0, 0, 0.04);
  --surface-strong: rgba(0, 0, 0, 0.06);
  --bg-card: rgba(255, 255, 255, 0.25);
  --bg-secondary: rgba(0, 0, 0, 0.04);
  --text: #1C1C1E;
  --text-secondary: rgba(28, 28, 30, 0.4);
  --accent: #007AFF;
  --accent-glow: rgba(0, 122, 255, 0.02);
  --accent-2: #5AC8FA;
  --accent-2-glow: rgba(90, 200, 250, 0.02);
  --line: rgba(0, 0, 0, 0.05);
  --line-strong: rgba(0, 0, 0, 0.1);
  --danger: #FF3B30;
  --success: #34C759;
  --warning: #FF9500;
  --glass-shadow: rgba(0, 0, 0, 0.06);
}

/* Light mode: softer text shadow */
:root.light h1, :root.light h2, :root.light h3, :root.light h4, :root.light h5, :root.light h6,
:root.light .eyebrow, :root.light .lead,
:root.light p, :root.light span, :root.light a, :root.light li,
:root.light .brand-name, :root.light .brand-sub,
:root.light .hero-title-accent {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

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

/* ── Video Background ─────────────────── */
.video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.3;
  pointer-events: none;
  /* GPU acceleration */
  transform: translateZ(0);
  will-change: auto;
  /* Reduce decode overhead */
  content-visibility: auto;
}

@media (max-width: 768px) {
  .video-bg { opacity: 0.22; }
  .page-aurora span { filter: blur(52px); opacity: 0.48; }
}

@media (prefers-reduced-motion: reduce) {
  .video-bg { display: none; }
  .page-aurora span { animation: none; }
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

/* Text shadow for readability on transparent backgrounds */
h1, h2, h3, h4, h5, h6,
.eyebrow, .lead,
p, span, a, li,
.brand-name, .brand-sub,
.hero-title-accent,
.contact-row span, .contact-row strong {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background-color: transparent;
  line-height: 1.6;
  overflow-x: hidden;
  isolation: isolate;
  transition: background-color 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

code {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent);
}

/* ── Liquid Glass ──────────────────────── */

.fx-layer {
  filter: contrast(var(--glass-contrast));
  isolation: isolate;
}

.glass {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    inset 2px -2px 2px -1px rgba(255, 255, 255, 0.04),
    inset -2px 2px 2px -1px rgba(255, 255, 255, 0.04),
    inset 6px -6px 4px -4px rgba(255, 255, 255, 0.02),
    inset -6px 6px 4px -4px rgba(255, 255, 255, 0.02),
    0 8px 32px var(--glass-shadow);
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.04) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.glass::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  box-shadow:
    inset 2px -2px 2px -1px rgba(255, 255, 255, 0.12),
    inset -2px 2px 2px -1px rgba(255, 255, 255, 0.12),
    inset 6px -6px 4px -4px rgba(255, 255, 255, 0.06),
    inset -6px 6px 4px -4px rgba(255, 255, 255, 0.06),
    0 12px 48px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

/* Glass inner content above pseudo-elements */
.glass > * { position: relative; z-index: 2; }

/* Glass button */
.glass-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow:
    inset 1px -1px 1px rgba(255, 255, 255, 0.06),
    inset -1px 1px 1px rgba(255, 255, 255, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow: hidden;
}

.glass-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow:
    inset 1px -1px 2px rgba(255, 255, 255, 0.15),
    inset -1px 1px 2px rgba(255, 255, 255, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Accent glass button */
.glass-btn.accent {
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.15), rgba(129, 140, 248, 0.12));
  border-color: rgba(110, 231, 183, 0.25);
  color: var(--accent);
}

.glass-btn.accent:hover {
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.25), rgba(129, 140, 248, 0.18));
  border-color: rgba(110, 231, 183, 0.4);
}

/* ── Buttons ───────────────────────────── */

button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

.primary {
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.primary:hover { box-shadow: 0 8px 32px rgba(110, 231, 183, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3); }

.ghost, .secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
}

.ghost:hover, .secondary:hover { background: var(--surface-hover); border-color: rgba(255, 255, 255, 0.2); }

/* ── Topbar ────────────────────────────── */

/* ── Nav Dock (floating pill container) ── */

main, .footer {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto;
}

/* ── Swup page transitions ─────────────── */

#app.transition-fade {
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html.is-animating #app.transition-fade {
  opacity: 0;
  transform: translateY(8px);
}

.nav-dock {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 14px 1rem 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.nav-dock.is-hidden {
  transform: translateY(-120%);
  opacity: 0.85;
}

.nav-dock-spacer {
  height: 80px;
  flex-shrink: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem 0.55rem 1rem;
  width: min(820px, 100%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  background: rgba(0, 0, 0, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 40px rgba(0, 0, 0, 0.05);
  pointer-events: all;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.topbar.scrolled {
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 14px 48px rgba(0, 0, 0, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.brand-sub { display: none; }

.nav {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav a {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  white-space: nowrap;
}

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

.nav a.active {
  color: var(--bg);
  background: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(110, 231, 183, 0.3);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.actions, .hero-cta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ── Language Switch ───────────────────── */

.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.lang-switch button {
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
}

.lang-switch button:hover { transform: none; background: var(--surface); }

.lang-switch button.active {
  color: var(--bg);
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ── Theme Toggle ──────────────────────── */

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-secondary);
  padding: 0;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: none;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* ── Hero ──────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2rem;
  align-items: center;
  padding: 3rem 0 2rem;
  min-height: 65vh;
}

.hero-copy { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
}

.eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

h1 .accent-text { color: var(--accent); }

.lead {
  font-size: 1.1rem;
  max-width: 52ch;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.hero-cta { margin-bottom: 2.5rem; }

.stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat span {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Hero Panel — Terminal Card */
.hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow:
    inset 1px -1px 1px rgba(255, 255, 255, 0.02),
    inset -1px 1px 1px rgba(255, 255, 255, 0.02),
    0 16px 48px rgba(0, 0, 0, 0.2);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.panel-dots {
  display: flex;
  gap: 5px;
}

.panel-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.panel-dots span:nth-child(1) { background: #ff5c5c; }
.panel-dots span:nth-child(2) { background: #ffc857; }
.panel-dots span:nth-child(3) { background: #00d4aa; }

.panel-header span:last-child {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.panel-body {
  padding: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}

.panel-line {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  animation: lineIn 0.4s ease forwards;
}

.panel-line:nth-child(1) { animation-delay: 0.2s; }
.panel-line:nth-child(2) { animation-delay: 0.5s; }
.panel-line:nth-child(3) { animation-delay: 0.8s; }
.panel-line:nth-child(4) { animation-delay: 1.1s; }
.panel-line:nth-child(5) { animation-delay: 1.4s; }

.panel-prompt { color: var(--accent); user-select: none; }
.panel-cmd { color: var(--text); }
.panel-output { color: var(--accent-2); }
.panel-comment { color: var(--text-secondary); }

@keyframes lineIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Sections ──────────────────────────── */

.section {
  padding: 3.5rem 0;
  position: relative;
  z-index: 1;
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 60ch;
}

/* ── About / Skills ────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.25rem;
}

.about-card {
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.about-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 16px 48px rgba(0, 0, 0, 0.08);
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ── Quick Links Grid (Liquid Glass) ────── */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin-top: 2rem;
}

.stack-grid a {
  position: relative;
  display: block;
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--text);
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow: hidden;
}

.stack-grid a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(90, 200, 250, 0.05));
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.stack-grid a:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 48px rgba(0, 0, 0, 0.12);
}

.stack-grid a:hover::before {
  opacity: 1;
}

.stack-grid h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.stack-grid p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  position: relative;
  z-index: 1;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.skill-tag {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.25s;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(110, 231, 183, 0.08);
}

/* ── Portfolio Grid ────────────────────── */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.portfolio-intro {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.5rem;
  padding: 1.6rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.portfolio-intro-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.portfolio-intro-copy p:last-child {
  color: var(--text-secondary);
  max-width: 62ch;
}

.portfolio-intro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.portfolio-stat {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  text-align: center;
}

.portfolio-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  color: var(--accent);
}

.portfolio-stat span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.portfolio-item {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.portfolio-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 48px rgba(0, 0, 0, 0.12);
}

.portfolio-thumb {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3rem;
  transition: transform 0.4s;
}

.portfolio-item:hover .portfolio-thumb { transform: scale(1.05); }

.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  background: linear-gradient(to top, rgba(8, 8, 14, 0.95) 0%, rgba(8, 8, 14, 0.4) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.35s;
}

.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.portfolio-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.portfolio-overlay h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.portfolio-overlay p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.portfolio-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.portfolio-year {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.portfolio-summary {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(234, 237, 243, 0.88);
}

.portfolio-meta {
  margin-top: 0.7rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* ── Social Accounts ────────────────────── */

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.social-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  cursor: pointer;
}

.social-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 45px rgba(0, 0, 0, 0.12);
}

.social-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.18;
  filter: saturate(1.1);
  pointer-events: none;
}

.social-card-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  position: relative;
  z-index: 1;
}

.social-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.social-info h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.social-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── CTA Section ───────────────────────── */

.cta-section {
  margin: 2rem 0;
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(0, 122, 255, 0.03), rgba(90, 200, 250, 0.02)),
    rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-section h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.cta-section p {
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* ── Footer ────────────────────────────── */

.footer {
  margin: 2rem auto 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

/* ── Nav Clock (live time in header) ───── */

.nav-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1;
  padding-right: 0.7rem;
  margin-right: 0.15rem;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.nav-clock time {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.nav-clock-label {
  font-size: 0.58rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .nav-clock-label { display: none; }
  .nav-clock {
    padding-right: 0.55rem;
    margin-right: 0.1rem;
  }
  .nav-clock time { font-size: 0.85rem; }
}

@media (max-width: 400px) {
  .nav-clock time { font-size: 0.78rem; }
}

/* ── Login Page ────────────────────────── */

.auth-page {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 2rem;
}

.auth-copy, .auth-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.auth-copy {
  padding: clamp(2rem, 4vw, 3rem);
}

.auth-copy-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.auth-note {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.auth-note p { color: var(--text-secondary); font-size: 0.9rem; }
.auth-note p:last-child { margin-bottom: 0; }
.notice-title { font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }

.auth-card { padding: 1.8rem; }

.auth-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.back-link { color: var(--accent); font-size: 0.9rem; }

.badge {
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.auth-form { display: grid; gap: 1rem; }

.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.9rem; font-weight: 500; }

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-error {
  min-height: 1rem;
  color: var(--danger);
  font-size: 0.82rem;
}

.form-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.checkbox {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}

.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

.form-status {
  min-height: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-status[data-tone="error"] { color: var(--danger); }
.form-status[data-tone="success"] { color: var(--success); }

.auth-submit { width: 100%; padding: 0.9rem; }

.auth-demo {
  margin-top: 1.4rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.auth-demo-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.auth-demo-line {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.88rem;
}

.text-button:hover { transform: none; text-decoration: underline; }

/* ── Drive / File Manager ──────────────── */

.drive-page {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto 2rem;
  position: relative;
  z-index: 1;
}

.drive-gate {
  margin-top: 3rem;
  text-align: center;
}

.drive-gate .auth-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem;
}

.drive-gate h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.drive-gate .lead { margin: 0 auto 1.5rem; }

.drive-shell { display: grid; gap: 1.2rem; }

/* Drive Toolbar */
.drive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  flex-wrap: wrap;
}

.drive-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.drive-breadcrumb a {
  color: var(--text-secondary);
  transition: color 0.2s;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.drive-breadcrumb a:hover { color: var(--accent); }
.drive-breadcrumb .sep { color: var(--text-secondary); opacity: 0.4; }
.drive-breadcrumb .current { color: var(--text); font-weight: 500; }

.drive-actions {
  display: flex;
  gap: 0.5rem;
}

.drive-actions button {
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Drive Body */
.drive-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.2rem;
  min-height: 60vh;
}

.drive-sidebar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
}

.drive-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.drive-sidebar-item:hover { background: var(--surface-hover); color: var(--text); }
.drive-sidebar-item.active { background: var(--accent-glow); color: var(--accent); }

.drive-sidebar-item .icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }

.drive-sidebar-divider {
  height: 1px;
  background: var(--line);
  margin: 0.6rem 0;
}

.drive-storage {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.storage-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin: 0.6rem 0 0.4rem;
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 0.5s;
}

.storage-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Drive File Grid */
.drive-content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.2rem;
}

.drive-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.drive-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: transparent;
  width: 100%;
  font-family: var(--font-body);
}

.drive-item:hover {
  background: var(--surface-hover);
  border-color: var(--line);
}

.drive-item.selected {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.drive-item.is-image {
  position: relative;
  overflow: hidden;
}

.drive-item-thumb-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.drive-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drive-item-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.drive-item-name {
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}

.drive-item-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.drive-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-secondary);
  text-align: center;
  gap: 0.8rem;
}

.drive-empty .icon { font-size: 3rem; opacity: 0.3; }

/* ── Modal ─────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  padding: 1.8rem;
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 1.2rem;
}

.modal .field { margin-bottom: 0.8rem; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.preview-modal {
  width: min(760px, 100%);
  padding: 1rem;
}

.preview-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.preview-heading {
  min-width: 0;
}

.preview-heading h3 {
  margin-bottom: 0.35rem;
}

.preview-meta {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.preview-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0;
  flex-shrink: 0;
}

.preview-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: min(72vh, 720px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  padding: 0.75rem;
}

.preview-stage img {
  max-width: 100%;
  max-height: min(72vh, 680px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.preview-fallback {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ── Upload zone ───────────────────────── */

.upload-zone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  margin-bottom: 1rem;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-zone p { color: var(--text-secondary); font-size: 0.88rem; }

.drive-status {
  display: none;
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
}

.drive-status.show { display: block; }
.drive-status[data-tone="success"] { border-color: rgba(52, 199, 89, 0.28); color: var(--success); }
.drive-status[data-tone="error"] { border-color: rgba(255, 59, 48, 0.28); color: var(--danger); }
.drive-status[data-tone="warning"] { border-color: rgba(255, 149, 0, 0.28); color: var(--warning); }

/* ── File list (table view) ────────────── */

.drive-list {
  display: grid;
  gap: 0.4rem;
}

.drive-list-header, .drive-list-row {
  display: grid;
  grid-template-columns: 1fr 100px 140px 60px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

.drive-list-header {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.drive-list-row {
  cursor: pointer;
  transition: background 0.2s;
}

.drive-list-row:hover { background: var(--surface-hover); }

.drive-list-row .name-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.drive-list-row .name-cell .icon { font-size: 1.2rem; }

.drive-list-row .delete-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.drive-list-row .delete-btn:hover { color: var(--danger); background: rgba(255, 92, 92, 0.1); }

/* ── User pill ─────────────────────────── */

.user-pill {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

/* ── Dashboard KPIs (kept for drive stats) ── */

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.dashboard-intro {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.8rem;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.dashboard-kpis .stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.2rem;
}

/* ── Scrollbar ─────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── iOS 26 Bottom Tab Bar ──────────────── */

.bottom-tab {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  justify-content: space-evenly;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.25rem calc(env(safe-area-inset-bottom, 0px) + 0.2rem);
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  pointer-events: none;
  box-shadow: none;
}

.bottom-tab-indicator {
  display: none;
}

.bottom-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.35rem 0.2rem 0.25rem;
  border-radius: 0;
  color: var(--text-secondary);
  transition: color 0.35s ease, transform 0.35s ease;
  position: relative;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  pointer-events: all;
  z-index: 1;
}

.bottom-tab-item svg {
  width: 22px;
  height: 22px;
  transition: color 0.35s ease;
  transform: none;
  stroke-width: 2.2;
}

.bottom-tab-item span {
  font-size: 0.66rem;
  font-weight: 600;
  font-family: var(--font-display);
  transition: color 0.2s ease;
  transform: none;
}

.bottom-tab-item:hover {
  color: var(--text);
}

.bottom-tab-item.active {
  color: var(--accent);
  background: transparent;
}

.bottom-tab-item.active svg {
  transform: none;
  filter: none;
  stroke-width: 2.5;
}

.bottom-tab-item.active span {
  color: var(--accent);
  transform: none;
  font-weight: 700;
}

/* ── Responsive ────────────────────────── */

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.2s;
  z-index: 200;
  flex-shrink: 0;
}

.hamburger:hover { background: var(--surface-hover); transform: none; }

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mobile-nav-overlay.open { opacity: 1; pointer-events: all; }

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  z-index: 160;
  padding: 5rem 1.5rem 2rem;
  flex-direction: column;
  gap: 0.5rem;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-nav.open { right: 0; }

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.mobile-nav a:hover, .mobile-nav a.active {
  color: var(--text);
  background: var(--surface);
}

.mobile-nav .nav-divider {
  height: 1px;
  background: var(--line);
  margin: 0.5rem 0;
}

.mobile-nav .mobile-lang-switch {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 0;
}

.mobile-nav .mobile-lang-switch button {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}

.mobile-nav .mobile-lang-switch button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.mobile-nav .mobile-auth {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Tablet (≤ 980px) ──────────────────── */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 2rem 0 1.5rem; }
  .hero-panel { max-width: 500px; }
  .about-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-shell { grid-template-columns: 1fr; }
  .drive-body { grid-template-columns: 1fr; }
  .drive-sidebar { display: none; }
  .cta-section { flex-direction: column; text-align: center; }
  .stats { gap: 1.5rem; }
}

/* ── Mobile (≤ 768px) ──────────────────── */

@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .hamburger { display: flex; }
  .mobile-nav-overlay, .mobile-nav { display: block; }
  .mobile-nav { display: flex; }

  .topbar .nav { display: none; }
  .topbar .lang-switch { display: none; }
  .topbar .actions { display: none; }

  /* Show bottom tab bar, hide hamburger */
  .bottom-tab {
    display: flex;
    margin: 0;
  }

  .bottom-tab-item {
    padding: 0.35rem 0.15rem 0.22rem;
  }

  /* Bottom padding for content to avoid tab bar */
  main { padding-bottom: 86px; }
  .footer { margin-bottom: 86px; }
  .drive-page { margin-bottom: 86px; }
  .auth-page { padding-bottom: 86px; }

  /* Hide hamburger since bottom tab replaces it */
  .hamburger { display: none !important; }

  /* Show mobile logout in drive toolbar */
  .mobile-only-logout { display: block !important; }

  /* Lift back-to-top above bottom tab bar */
  .back-to-top { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

  /* Topbar compact */
  .topbar {
    padding: 0.45rem 0.5rem 0.45rem 0.8rem;
    gap: 0.4rem;
  }

  .nav-dock { padding: 10px 0.75rem 0; }
  .nav-dock-spacer { height: 68px; }

  .brand-name { font-size: 0.88rem; }
  .brand-sub { font-size: 0.7rem; }
  .brand-avatar { width: 28px; height: 28px; }

  /* Hero mobile */
  .hero { padding: 1rem 0 0.8rem; }

  h1 {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
    max-width: none;
    margin-bottom: 0.8rem;
  }

  .lead {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
  }

  .hero-cta .button-link {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
  }

  .stats {
    display: flex;
    gap: 0;
    justify-content: space-between;
  }

  .stat {
    flex: 1;
    text-align: center;
    padding: 0.8rem 0.4rem;
  }

  .stat strong { font-size: 1.3rem; }
  .stat span { font-size: 0.72rem; }

  /* Hero panel mobile */
  .hero-panel {
    margin-top: 1rem;
    border-radius: var(--radius);
  }

  .panel-body { padding: 1rem; font-size: 0.78rem; }

  /* Sections mobile */
  .section { padding: 2.5rem 0; }
  .section-head { margin-bottom: 1.5rem; }
  .section-head h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
  .section-head p { font-size: 0.9rem; }

  /* About cards mobile */
  .about-card {
    padding: 1.3rem;
    border-radius: var(--radius);
  }

  .about-card h3 { font-size: 1rem; }
  .about-card p { font-size: 0.88rem; }

  .stack-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-top: 1.5rem;
  }

  .stack-grid a {
    padding: 1.2rem;
  }

  .stack-grid h3 { font-size: 1rem; }
  .stack-grid p { font-size: 0.82rem; }

  .skill-tags {
    gap: 0.4rem;
    margin-top: 1.2rem;
  }

  .skill-tag {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
  }

  /* Portfolio mobile */
  .portfolio-intro {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.2rem;
  }

  .portfolio-intro-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .portfolio-stat {
    padding: 0.8rem 0.5rem;
  }

  .portfolio-stat strong {
    font-size: 1.3rem;
  }

  .portfolio-stat span {
    font-size: 0.7rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .portfolio-item { border-radius: var(--radius-sm); }

  .portfolio-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(8, 8, 14, 0.9) 0%, transparent 80%);
    padding: 0.8rem;
  }

  .portfolio-overlay h3 { font-size: 0.88rem; }
  .portfolio-overlay p { font-size: 0.75rem; }
  .portfolio-tag { font-size: 0.68rem; padding: 0.15rem 0.5rem; }

  /* Social mobile */
  .social-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .social-card-content {
    padding: 1rem;
    gap: 0.8rem;
  }

  .social-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .social-info h3 { font-size: 0.9rem; }
  .social-info p { font-size: 0.75rem; }

  /* CTA mobile */
  .cta-section {
    padding: 1.5rem;
    border-radius: var(--radius);
    gap: 1rem;
  }

  .cta-section h2 { font-size: 1.3rem; }
  .cta-section p { font-size: 0.88rem; }
  .cta-section .hero-cta { width: 100%; }

  /* Footer mobile */
  .footer {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
    padding: 1.2rem 0;
  }

  .footer-links { justify-content: center; gap: 0.8rem; }

  /* Auth pages mobile */
  .auth-page { padding: 1rem 0; }
  .auth-shell { gap: 1rem; }
  .auth-copy { padding: 1.5rem; border-radius: var(--radius); }
  .auth-card { padding: 1.3rem; border-radius: var(--radius); }
  .auth-copy h1 { font-size: clamp(2rem, 8vw, 2.8rem); }

  .field input {
    padding: 0.8rem;
    font-size: 1rem; /* prevents iOS zoom */
    border-radius: 12px;
  }

  .auth-submit {
    padding: 0.85rem;
    font-size: 1rem;
  }

  /* Drive mobile */
  .drive-page { margin-bottom: 1rem; }

  .drive-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    gap: 0.7rem;
  }

  .drive-breadcrumb {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
  }

  .drive-actions {
    display: grid;
    grid-template-columns: 0.9fr 1fr 0.8fr;
    gap: 0.4rem;
    width: 100%;
  }

  .drive-actions .view-toggle {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }

  .drive-actions button {
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    min-width: 0;
    white-space: nowrap;
  }

  .drive-content {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
  }

  .drive-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
  }

  .drive-item {
    padding: 0.8rem 0.5rem;
    border-radius: 10px;
  }

  .drive-item-thumb-wrap {
    border-radius: 10px;
  }

  .drive-item-icon { font-size: 1.8rem; }
  .drive-item-name { font-size: 0.75rem; }
  .drive-item-meta { font-size: 0.68rem; }

  .drive-empty { padding: 2rem 1rem; }
  .drive-empty .icon { font-size: 2.5rem; }
  .drive-empty h3 { font-size: 1rem; }
  .drive-empty p { font-size: 0.85rem; }

  .drive-list-header, .drive-list-row {
    grid-template-columns: 1fr 70px 40px;
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
  }

  .drive-list-header > span:nth-child(3),
  .drive-list-row > span:nth-child(3) { display: none; }

  .upload-zone { padding: 1.2rem; }
  .upload-zone .icon { font-size: 1.5rem; }
  .upload-zone p { font-size: 0.82rem; }

  /* Modal mobile */
  .modal-overlay { padding: 1rem; }
  .modal {
    border-radius: var(--radius);
    padding: 1.3rem;
  }
  .modal h3 { font-size: 1.05rem; margin-bottom: 1rem; }
  .modal-actions { gap: 0.5rem; }
  .modal-actions button { flex: 1; padding: 0.75rem; }

  .preview-modal {
    width: 100%;
    padding: 0.9rem;
  }

  .preview-modal-header {
    margin-bottom: 0.75rem;
  }

  .preview-stage {
    min-height: 220px;
    padding: 0.5rem;
  }
}

/* ── Small Mobile (≤ 400px) ────────────── */

@media (max-width: 400px) {
  .topbar, main, .footer, .auth-page, .drive-page {
    width: calc(100% - 0.75rem);
  }

  h1 { font-size: clamp(1.8rem, 9vw, 2.6rem); }

  .portfolio-grid { grid-template-columns: 1fr; }

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

  .brand-sub { display: none; }

  .dashboard-kpis { grid-template-columns: 1fr; }
}

/* ── View toggle ───────────────────────── */

.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.view-toggle button {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
}

.view-toggle button:hover { transform: none; background: var(--surface); }
.view-toggle button.active { color: var(--text); background: var(--surface-strong); }

/* ── Animations ────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.2s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
.fade-up:nth-child(6) { animation-delay: 0.3s; }

/* ── Context menu ──────────────────────── */

.context-menu {
  position: fixed;
  min-width: 160px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  padding: 0.4rem;
  z-index: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: none;
}

.context-menu.open { display: block; }

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.context-menu-item:hover { background: var(--surface-hover); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item.danger:hover { background: rgba(255, 92, 92, 0.1); }
.context-menu-divider { height: 1px; background: var(--line); margin: 0.3rem 0; }

/* Clean personal-site pages */

.site-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 4rem;
}

.home-hero {
  min-height: calc(100vh - 280px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  padding: 2rem 0 1.5rem;
}

.home-hero-copy h1,
.page-head h1,
.anime-hero h1 {
  max-width: 860px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.home-hero-copy h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.home-hero-copy .lead,
.page-head p:not(.eyebrow),
.anime-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 1.2rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.8;
}

.home-quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.home-quick-links a {
  min-width: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.home-quick-links a:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 255, 0.52);
  background: rgba(0, 122, 255, 0.12);
}

.home-quick-links a > span:first-child {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.home-quick-links strong {
  overflow: hidden;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-quick-links i {
  color: var(--text-secondary);
  font-style: normal;
  font-size: 0.85rem;
}

body[data-page="home"] .home-about .stack-grid {
  display: none;
}

.home-hero-media {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line-strong);
  border-radius: 36px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18);
}

.home-hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 30% 25%, rgba(0, 122, 255, 0.06), transparent 32%),
    radial-gradient(circle at 78% 78%, rgba(255, 45, 85, 0.04), transparent 30%),
    linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 55%);
  pointer-events: none;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ══ Home Hero Carousel ═══════════════════ */
.hero-carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  z-index: 0;
}

.hero-carousel-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.hero-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.hero-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 1.4rem;
  font-family: var(--font-display);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
  opacity: 0.6;
  padding: 0;
}

.home-hero-media:hover .hero-carousel-btn,
.hero-carousel:focus-within .hero-carousel-btn {
  opacity: 1;
}

/* 移动端触屏无法 hover，始终显示箭头 */
@media (hover: none) {
  .hero-carousel-btn { opacity: 1; }
}

.hero-carousel-btn:hover {
  background: rgba(0, 122, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.05);
}

.hero-carousel-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.hero-carousel-prev { left: 16px; }
.hero-carousel-next { right: 16px; }

.hero-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}

.hero-carousel-dot.active {
  background: #fff;
  width: 22px;
  border-radius: 999px;
}

.hero-carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.15);
}

@media (max-width: 900px) {
  .hero-carousel-btn {
    opacity: 0.8;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  .hero-carousel-prev { left: 10px; }
  .hero-carousel-next { right: 10px; }
  .hero-carousel-dots { bottom: 12px; gap: 6px; }
  .hero-carousel-dot { width: 7px; height: 7px; }
  .hero-carousel-dot.active { width: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel-track {
    transition: none;
  }
}
.orb-a,
.orb-b {
  display: none;
}

.hero-photo-card {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 9%;
  z-index: 2;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  backdrop-filter: blur(18px);
  overflow: visible;
}

.hero-photo-card > span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
}

.hero-photo-card .hero-title-accent {
  display: inline;
  color: #89caff;
  font-size: inherit;
  letter-spacing: inherit;
  text-shadow: 0 0 16px rgba(137, 202, 255, 0.55);
}

/* Typewriter character spans inherit inline display from strong context */
.hero-photo-card strong span {
  display: inline;
  font-size: inherit;
  letter-spacing: normal;
  color: inherit;
}

.hero-photo-card strong {
  position: relative;
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  white-space: nowrap;
  min-height: 1.2em;
}

.nav-music-player {
  position: relative;
  width: 236px;
  min-height: 64px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(24, 31, 43, 0.9), rgba(10, 14, 22, 0.84));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  pointer-events: all;
  overflow: hidden;
}

.nav-music-player::after {
  content: "";
  position: absolute;
  inset: auto 10px 0 65px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-music-cover {
  width: 44px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(111, 211, 228, 0.24);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(77, 180, 200, 0.34), rgba(57, 115, 148, 0.2));
  color: #c9f3f5;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
}

.nav-music-cover svg {
  width: 21px;
  height: 21px;
}

.nav-music-meta { min-width: 0; }
.nav-music-meta span,
.nav-music-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-music-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.66rem;
}
.nav-music-meta span i {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7dd3c7;
  box-shadow: 0 0 8px rgba(125, 211, 199, 0.65);
}
.nav-music-meta strong { margin-top: 3px; font-size: 0.8rem; font-weight: 650; letter-spacing: 0; }

.nav-music-play {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.72);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-music-play svg {
  width: 17px;
  height: 17px;
  margin-left: 2px;
}

.nav-music-play:not(:disabled) {
  cursor: pointer;
}

.nav-music-play:not(:disabled):hover {
  transform: scale(1.06);
  border-color: rgba(125, 211, 199, 0.52);
  background: rgba(125, 211, 199, 0.18);
}

.nav-music-play:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.055);
}

@media (max-width: 1100px) {
  .nav-music-player {
    width: 44px;
    min-height: 44px;
    grid-template-columns: 34px;
    padding: 4px;
  }
  .nav-music-cover { width: 34px; }
  .nav-music-meta,
  .nav-music-play { display: none; }
}

@media (max-width: 768px) {
  .nav-music-player { display: none; }
}

.type-caret {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.1em;
  background: #89caff;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(137, 202, 255, 0.7);
  animation: caretBlink 0.9s steps(1, end) infinite;
}

@keyframes caretBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.feature-band article,
.about-profile,
.stack-grid article,
.project-card,
.waifu-grid article,
.watch-calendar {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.feature-band article {
  padding: 1.35rem;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.feature-band span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ── Home About preview ─────────────────── */
.home-about {
  margin-top: 2.5rem;
  scroll-margin-top: 96px;
}

.home-about .eyebrow {
  margin: 0;
}

.home-about > h2 {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
}

.home-about-desc {
  max-width: 720px;
  margin: 1rem 0 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

.home-about .about-layout {
  margin-top: 2.5rem;
}

.feature-band h2,
.about-profile h2,
.project-card h2,
.waifu-grid h2,
.watch-calendar h2 {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
}

.feature-band p,
.project-card p,
.waifu-grid p,
.stack-grid p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.about-profile p {
  margin-bottom: 0.5rem;
  line-height: 1.85;
}

.page-head,
.anime-hero {
  padding: 5rem 0 2.5rem;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 1.75rem;
}

.about-profile {
  padding: 2rem;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.about-avatar {
  width: 92px;
  height: 92px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  margin-bottom: 1rem;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.contact-row span {
  color: var(--text-secondary);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.stack-grid article {
  padding: 1.5rem;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  overflow: hidden;
  padding: 1rem;
}

.project-shot {
  min-height: 220px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.08em;
}

.project-blue { background: linear-gradient(135deg, #007aff, #5ac8fa); }
.project-green { background: linear-gradient(135deg, #00c48c, #84fab0); }
.project-ink { background: linear-gradient(135deg, #111827, #6b7280); }

.project-card h2,
.project-card p,
.project-card span {
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.project-card span {
  display: inline-flex;
  margin-top: 0.75rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  color: var(--accent);
  background: var(--surface);
  font-size: 0.8rem;
}

.anime-hero {
  border-bottom: 1px solid var(--line);
}

.waifu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.waifu-grid article {
  padding: 1rem;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.waifu-frame {
  min-height: 300px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.52), transparent 28%),
    linear-gradient(135deg, #ff7aa2, #ffb86c);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.08em;
}

.waifu-frame.alt {
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.42), transparent 26%),
    linear-gradient(135deg, #1f2937, #2563eb);
}

.watch-calendar {
  margin-top: 1rem;
  padding: 1.4rem;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.calendar-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.calendar-list article {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.calendar-list span {
  color: var(--accent);
  font-family: var(--font-mono);
}

.calendar-list em {
  color: var(--text-secondary);
  font-style: normal;
}

/* ── Anime Quotes ──────────────────────── */

.quote-section {
  margin-top: 2rem;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.quote-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.quote-item {
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.08);
}

.quote-item p {
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text);
}

.quote-item em {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: normal;
}

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--accent);
  color: var(--bg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ── Button Hover Scale Effect ────────────────────────── */

.nav a,
.bottom-tab-item,
.photowall-card,
.admin-btn,
.upload-btn,
.photowall-upload-btn,
.button-link,
.lang-switch button,
.theme-toggle,
.hamburger {
  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav a:hover,
.bottom-tab-item:hover,
.photowall-card:hover,
.admin-btn:hover,
.upload-btn:hover,
.photowall-upload-btn:hover,
.button-link:hover,
.lang-switch button:hover {
  transform: scale(1.03);
}

.theme-toggle:hover {
  transform: scale(1.08) rotate(15deg);
}

.hamburger:hover {
  transform: scale(1.08);
}

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -22px, 0) scale(1.08); }
}

@media (max-width: 900px) {
  .home-hero,
  .about-layout,
  .project-grid,
  .waifu-grid,
  .feature-band {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: auto;
    padding-top: 1.5rem;
  }

  .home-hero-media {
    min-height: 280px;
    order: -1;
  }

  .hero-image {
    object-position: center 15%;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .calendar-list article {
    grid-template-columns: 54px 1fr;
  }

  .calendar-list em {
    grid-column: 2;
  }
}

/* ── 光影画廊 (Light & Shadow Photography Exhibition) ── */

.photo-gallery {
  margin-top: 4.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.photo-gallery-head {
  text-align: center;
  margin-bottom: 2.75rem;
}

.photo-gallery-head .eyebrow {
  justify-content: center;
}

.photo-gallery-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin: 0.4rem 0 0.5rem;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.photo-gallery-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3.75rem 2rem;
}

.photo-album {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: center;
}

.photo-stack {
  position: relative;
  width: 86%;
  aspect-ratio: 4 / 3;
  margin-bottom: 1.75rem;
}

.photo-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 6px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1), filter 0.5s ease, opacity 0.5s ease;
  will-change: transform;
}

.photo-layer--back {
  transform: rotate(6deg) translate(8px, 8px) scale(0.96);
  opacity: 0.5;
  filter: grayscale(0.7);
}

.photo-layer--mid {
  transform: rotate(-3deg) translate(-8px, -8px) scale(0.98);
  opacity: 0.8;
  z-index: 2;
  filter: grayscale(0.5);
}

.photo-layer--front {
  z-index: 3;
  filter: grayscale(0.55) contrast(1.02);
}

.photo-album:hover .photo-layer--front,
.photo-album:focus-visible .photo-layer--front {
  transform: translateY(-10px) scale(1.04);
  filter: grayscale(0) contrast(1.05);
}

.photo-album:hover .photo-layer--back,
.photo-album:focus-visible .photo-layer--back {
  transform: rotate(11deg) translate(20px, 14px) scale(0.96);
  opacity: 0.7;
}

.photo-album:hover .photo-layer--mid,
.photo-album:focus-visible .photo-layer--mid {
  transform: rotate(-6deg) translate(-16px, -12px) scale(0.98);
  opacity: 0.9;
}

/* Hover overlay — reveals the album title over the cover (matches reference) */
.photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 1rem;
  border-radius: 4px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.15) 55%, transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.photo-album:hover .photo-overlay,
.photo-album:focus-visible .photo-overlay {
  opacity: 1;
  transform: translateY(0);
}

.photo-overlay-title {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.photo-overlay-hint {
  color: var(--accent, #8b7cff);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.photo-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.photo-date {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.photo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  margin: 0.2rem 0 0;
}

.photo-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 22ch;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photo-count {
  margin-top: 0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.photo-count::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Upload controls + empty state */
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius, 12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.upload-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.upload-btn.folder {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.upload-btn.folder:hover {
  background: rgba(255, 255, 255, 0.25);
}

.photo-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  border-radius: var(--radius, 12px);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.photo-empty-icon {
  font-size: 3.5rem;
  opacity: 0.8;
}

.photo-empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.photo-empty-sub {
  font-size: 0.9rem;
  margin: 0;
  max-width: 28ch;
}

/* ── Lightbox ── */

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.photo-lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-inner {
  position: relative;
  width: min(960px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform: scale(0.94);
  transition: transform 0.34s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.photo-lightbox.open .lightbox-inner {
  transform: scale(1);
}

.lightbox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: #fff;
  flex-wrap: wrap;
  padding-right: 3.25rem;
}

.lightbox-head h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0;
  font-weight: 700;
}

.lightbox-head .lb-date {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.lightbox-head .lb-desc {
  flex-basis: 100%;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  touch-action: pan-y;
  overflow: visible;
}

.lightbox-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-stage.is-loading .lightbox-loading {
  opacity: 1;
}

.lightbox-stage.is-loading .lightbox-img {
  opacity: 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 66vh;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
  z-index: 3;
  pointer-events: auto;
  line-height: 0;
  padding: 0;
}

.lightbox-arrow-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox-btn.prev { left: 0; }
.lightbox-btn.next { right: 0; }

.lightbox-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
}

.lightbox-close-icon {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  pointer-events: none;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

.lightbox-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.lightbox-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-dots button.active {
  background: #fff;
  transform: scale(1.25);
}

@media (max-width: 900px) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.25rem; }
  .lightbox-btn.prev { left: 0; }
  .lightbox-btn.next { right: 0; }
}

@media (max-width: 540px) {
  .photo-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .photo-stack { width: 78%; }
  .photo-lightbox { padding: 1rem 0.75rem; }
  .lightbox-inner { gap: 0.7rem; }
  .lightbox-head { gap: 0.35rem; padding: 0 3rem 0 0.25rem; }
  .lightbox-head h3 { font-size: 1.05rem; }
  .lightbox-head .lb-desc { font-size: 0.8rem; }
  .lightbox-img { max-height: 62vh; border-radius: 8px; }
  .lightbox-btn { width: 40px; height: 40px; }
  .lightbox-btn.prev { left: 0; }
  .lightbox-btn.next { right: 0; }
  .lightbox-close { top: 0; right: 0; }
  .hero-photo-card { left: 5%; right: 5%; padding: 0.8rem; }
  .hero-photo-card strong { font-size: clamp(0.9rem, 3.8vw, 1.4rem); white-space: nowrap; }
}

/* ── 照片墙 (Photowall) ────────────────────────────────── */

.photowall {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

.photowall-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 1rem;
  position: relative;
}

.photowall-refresh {
  position: absolute;
  top: 0;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.photowall-refresh:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.photowall-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.photowall-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
  letter-spacing: 0.01em;
}

.photowall-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.photowall-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photowall-upload-btn:hover {
  background: var(--accent-hover, #0056b3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.photowall-upload-btn.folder {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.photowall-upload-btn.folder:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

/* 照片墙网格 */
.photowall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.photowall-loading {
  grid-column: 1 / -1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.photowall-loading-spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: photowall-spin 0.8s linear infinite;
}

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

/* 相册卡片 */
.photowall-card {
  position: relative;
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  animation: photowallFadeIn 0.5s ease forwards;
  opacity: 0;
}

@keyframes photowallFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photowall-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

/* 封面图片 */
.photowall-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.photowall-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photowall-image-status {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(18, 22, 30, 0.72);
  transition: opacity 0.2s ease;
}

.photowall-cover.image-ready:not(.image-failed) .photowall-image-status {
  opacity: 0;
  pointer-events: none;
}

.photowall-cover.image-failed img {
  opacity: 0;
}

.photowall-card:hover .photowall-cover img {
  transform: scale(1.05);
}

/* Hover 覆盖层 */
.photowall-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photowall-card:hover .photowall-cover-overlay {
  opacity: 1;
}

.photowall-cover-text {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}

/* 卡片信息 */
.photowall-info {
  padding: 1rem;
}

.photowall-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
  line-height: 1.3;
}

.photowall-card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.photowall-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photowall-card-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

.photowall-card-count svg {
  width: 14px;
  height: 14px;
}

/* 空状态 */
.photowall-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.photowall-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.photowall-empty-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.photowall-empty-sub {
  font-size: 0.9rem;
  margin: 0;
}

/* 响应式 */
@media (max-width: 900px) {
  .photowall-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 540px) {
  .photowall-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .photowall-title {
    font-size: 1.8rem;
  }
}

/* ══ Floating aurora background (homepage) ══════════════════ */
.page-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.page-aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.6;
  will-change: transform;
  animation: auroraFloat 22s ease-in-out infinite;
}

.page-aurora .a1 {
  width: 48vw; height: 48vw;
  top: -14vw; left: -8vw;
  background: radial-gradient(circle at 50% 50%, #6366f1, transparent 64%);
  animation-delay: 0s;
}
.page-aurora .a2 {
  width: 42vw; height: 42vw;
  top: 6vw; right: -12vw;
  background: radial-gradient(circle at 50% 50%, #ec4899, transparent 64%);
  animation-delay: -6s;
  animation-duration: 26s;
}
.page-aurora .a3 {
  width: 40vw; height: 40vw;
  bottom: -14vw; left: 16vw;
  background: radial-gradient(circle at 50% 50%, #38bdf8, transparent 64%);
  animation-delay: -11s;
  animation-duration: 30s;
}
.page-aurora .a4 {
  width: 32vw; height: 32vw;
  bottom: 2vw; right: 12vw;
  background: radial-gradient(circle at 50% 50%, #a855f7, transparent 64%);
  animation-delay: -3s;
  animation-duration: 24s;
}

@keyframes auroraFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(4vw, 5vh, 0) scale(1.08); }
  66%      { transform: translate3d(-3vw, -4vh, 0) scale(0.94); }
}

/* light theme: softer pastel aurora */
:root.light .page-aurora span { opacity: 0.42; filter: blur(60px); }
:root.light .page-aurora .a1 { background: radial-gradient(circle at 50% 50%, #a5b4fc, transparent 64%); }
:root.light .page-aurora .a2 { background: radial-gradient(circle at 50% 50%, #f9a8d4, transparent 64%); }
:root.light .page-aurora .a3 { background: radial-gradient(circle at 50% 50%, #7dd3fc, transparent 64%); }
:root.light .page-aurora .a4 { background: radial-gradient(circle at 50% 50%, #c4b5fd, transparent 64%); }

/* Hero copy becomes a floating glass plate */
.home-hero-copy {
  position: relative;
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
:root.light .home-hero-copy {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow:
    0 24px 70px rgba(31, 38, 135, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Strengthen the floating glass on homepage cards */
.feature-band article,
.about-profile,
.stack-grid article,
.about-card {
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-color: rgba(255, 255, 255, 0.22);
}
.feature-band article:hover,
.about-profile:hover,
.stack-grid article:hover,
.about-card:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 18px 56px rgba(0, 0, 0, 0.16);
}
:root.light .feature-band article,
:root.light .about-profile,
:root.light .stack-grid article,
:root.light .about-card {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 860px) {
  .home-hero-copy { padding: 1.2rem; }
}

/* Compact desktop homepage: keep the primary site overview in one viewport. */
@media (min-width: 901px) {
  body[data-page="home"] {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body[data-page="home"] .site-main {
    width: min(1240px, calc(100% - 3rem));
    margin: 0 auto 0.5rem;
  }

  body[data-page="home"] .home-hero {
    min-height: 0;
    height: min(390px, calc(100vh - 220px));
    grid-template-columns: minmax(300px, 0.8fr) minmax(480px, 1.2fr);
    gap: 1rem;
    padding: 0.55rem 0;
  }

  body[data-page="home"] .home-hero-media {
    height: 100%;
    min-height: 0;
    align-self: stretch;
    border-radius: 22px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
  }

  body[data-page="home"] .hero-photo-card {
    left: 6%;
    right: 6%;
    bottom: 7%;
    padding: 0.85rem 1rem;
    border-radius: 16px;
  }

  body[data-page="home"] .hero-photo-card strong {
    margin-top: 0.2rem;
    font-size: clamp(1rem, 1.8vw, 1.45rem);
  }

  body[data-page="home"] .home-hero-copy {
    height: 100%;
    padding: 1.15rem 1.35rem;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  body[data-page="home"] .home-hero-copy .eyebrow {
    margin-bottom: 0.65rem;
    font-size: 0.66rem;
  }

  body[data-page="home"] .home-hero-copy h1 {
    font-size: clamp(1.65rem, 2.7vw, 2.4rem);
    line-height: 1.15;
  }

  body[data-page="home"] .home-hero-copy .lead {
    margin-top: 0.65rem;
    font-size: 0.84rem;
    line-height: 1.55;
  }

  body[data-page="home"] .feature-band {
    gap: 0.7rem;
    margin-top: 0.55rem;
  }

  body[data-page="home"] .feature-band article {
    min-height: 78px;
    padding: 0.65rem 0.85rem;
    border-radius: 16px;
  }

  body[data-page="home"] .feature-band span {
    font-size: 0.68rem;
  }

  body[data-page="home"] .feature-band h2 {
    margin-top: 0.25rem;
    font-size: 1rem;
  }

  body[data-page="home"] .feature-band p {
    margin: 0.2rem 0 0;
    font-size: 0.76rem;
    line-height: 1.4;
  }

  body[data-page="home"] .home-about {
    display: none;
  }

  body[data-page="home"] .footer {
    padding: 0.35rem 1rem 0.6rem;
  }
}

/* ── Falling Particles (Sakura / Snow) ── */

.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  contain: layout style;
}

.particle {
  position: absolute;
  top: -40px;
  opacity: 0;
  animation: particleFall linear forwards;
  will-change: transform;
  contain: layout style paint;
}

/* Sakura (light mode) */
.particle.sakura {
  width: 18px;
  height: 18px;
  background: radial-gradient(ellipse at 30% 30%, rgba(255, 183, 197, 0.6), rgba(255, 107, 138, 0.3));
  border-radius: 50% 0 50% 50%;
  box-shadow: 0 0 6px rgba(255, 107, 138, 0.15);
}

/* Snow (dark mode) */
.particle.snow {
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), rgba(200, 220, 255, 0.3));
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(200, 220, 255, 0.2);
}

@keyframes particleFall {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(0deg) scale(0.6);
  }
  15% {
    opacity: 0.6;
  }
  85% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translateX(var(--drift-x)) translateY(calc(100vh + 40px)) rotate(var(--rotation)) scale(1);
  }
}

/* ── Cursor Glow Follow ──────────────── */
.cursor-glow {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(57, 197, 187, 0.6), transparent 70%);
  box-shadow: 0 0 15px rgba(57, 197, 187, 0.5), 0 0 30px rgba(57, 197, 187, 0.25), 0 0 50px rgba(57, 197, 187, 0.1);
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  will-change: left, top;
}

.cursor-glow.hidden {
  opacity: 0;
}

:root.light .cursor-glow {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(57, 197, 187, 0.5), transparent 70%);
  box-shadow: 0 0 12px rgba(57, 197, 187, 0.35), 0 0 25px rgba(57, 197, 187, 0.15);
}

/* ── Guestbook ────────────────────────── */
.guestbook {
  margin-top: 4rem;
  padding-bottom: 2rem;
}

.guestbook .eyebrow {
  margin: 0;
}

.guestbook > h2 {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.guestbook-desc {
  color: var(--text-secondary);
  margin: 0.5rem 0 2rem;
}

.guestbook-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.guestbook-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.guestbook-input,
.guestbook-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.guestbook-input:focus,
.guestbook-textarea:focus {
  border-color: var(--accent);
}

.guestbook-input::placeholder,
.guestbook-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.guestbook-textarea {
  resize: vertical;
  min-height: 80px;
}

.guestbook-submit {
  margin-top: 0.75rem;
  padding: 0.7rem 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.guestbook-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(110, 231, 183, 0.25);
}

.guestbook-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guestbook-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.guestbook-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-size: 0.95rem;
}

.guestbook-item {
  display: flex;
  gap: 1rem;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.guestbook-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.guestbook-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.guestbook-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.guestbook-content {
  flex: 1;
  min-width: 0;
}

.guestbook-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.guestbook-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.guestbook-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.guestbook-text {
  color: var(--text);
  line-height: 1.6;
  font-size: 0.95rem;
  word-break: break-word;
}

/* ── Blog Page ─────────────────────────── */

.blog-hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.blog-list-section {
  padding: 2rem 0;
}

.blog-list {
  display: grid;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.blog-card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.blog-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.1);
}

.blog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.blog-card-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.blog-card-header h2 a {
  color: var(--text);
  text-decoration: none;
}

.blog-card-header h2 a:hover {
  color: var(--accent);
}

.blog-card-header time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.blog-summary {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-tags .tag {
  padding: 0.25rem 0.75rem;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
}

/* ── Article Page ──────────────────────── */

.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 0;
}

.article-header {
  margin-bottom: 2rem;
}

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.article-meta time {
  font-weight: 500;
}

.article-meta .updated {
  font-size: 0.85rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.article-tags .tag {
  padding: 0.25rem 0.75rem;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
}

.article-cover {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.article-summary {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-body {
  line-height: 1.8;
  font-size: 1.05rem;
}

.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.article-body h1 { font-size: 1.75rem; }
.article-body h2 { font-size: 1.5rem; }
.article-body h3 { font-size: 1.25rem; }

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body code {
  padding: 0.2rem 0.5rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article-body pre {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.article-body pre code {
  padding: 0;
  background: none;
}

.article-body blockquote {
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-secondary);
  margin: 1.25rem 0;
  color: var(--text-secondary);
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
}

.article-body a:hover {
  text-decoration: none;
}

.article-nav {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Guestbook Page ────────────────────── */

.guestbook-hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.guestbook-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.guestbook-form-section {
  max-width: 600px;
  margin: 0 auto 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.guestbook-form {
  display: grid;
  gap: 1rem;
}

.guestbook-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.guestbook-input,
.guestbook-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.guestbook-input:focus,
.guestbook-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.guestbook-input::placeholder,
.guestbook-textarea::placeholder {
  color: var(--text-secondary);
}

.guestbook-textarea {
  resize: vertical;
  min-height: 100px;
}

.guestbook-submit {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.guestbook-submit:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.guestbook-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.9rem;
}

.form-status.success {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
}

.form-status.error {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.guestbook-list-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 0 3rem;
}

.guestbook-list-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.guestbook-list {
  display: grid;
  gap: 1rem;
}

.guestbook-item {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gb-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.gb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.gb-avatar-default {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.gb-info {
  flex: 1;
}

.gb-name {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}

.gb-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.gb-message {
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
}

.btn-secondary {
  display: block;
  width: 100%;
  max-width: 200px;
  margin: 2rem auto 0;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.empty-state,
.error-state,
.blog-loading,
.article-loading,
.guestbook-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.error-state {
  color: var(--danger);
}

/* Light mode adjustments */
:root.light .guestbook-form,
:root.light .guestbook-item {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.35);
}

:root.light .guestbook-input,
:root.light .guestbook-textarea {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

:root.light .guestbook-input::placeholder,
:root.light .guestbook-textarea::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .guestbook-form-row {
    grid-template-columns: 1fr;
  }
}

/* ═══ 大屏幕适配 (1080p+) ═══ */
@media (min-width: 1400px) {
  :root {
    --radius: 22px;
    --radius-sm: 14px;
    --radius-lg: 30px;
    --glass-blur: 16px;
  }

  .site-main {
    width: min(1400px, calc(100% - 4rem));
  }

  .topbar {
    padding: 0.8rem 2rem;
  }

  .nav {
    gap: 0.4rem;
  }

  .nav a {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }

  .home-hero {
    min-height: calc(100vh - 200px);
    padding: 3rem 0 2rem;
  }

  .home-hero-copy h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
  }

  .home-hero-copy .lead {
    font-size: 1.15rem;
    max-width: 600px;
  }

  .home-quick-links {
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .home-quick-links a {
    min-height: 64px;
    padding: 1rem 1.2rem;
    font-size: 1rem;
  }

  .stack-grid {
    gap: 1.5rem;
  }

  .stack-grid a {
    padding: 2.2rem;
  }

  .stack-grid h3 {
    font-size: 1.3rem;
  }

  .stack-grid p {
    font-size: 1rem;
  }

  .feature-band article {
    padding: 2rem;
  }

  .about-layout {
    gap: 3rem;
  }

  .about-avatar {
    width: 110px;
    height: 110px;
  }

  .about-card {
    padding: 2rem;
  }

  .about-card h3 {
    font-size: 1.2rem;
  }

  .about-card p {
    font-size: 1rem;
  }

  .photowall-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
  }

  .photowall-card {
    border-radius: 20px;
  }

  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }

  .anime-card {
    padding: 2rem;
    border-radius: 20px;
  }

  .social-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
  }

  .social-card {
    padding: 1.5rem;
  }

  .guestbook-form-section {
    padding: 2rem;
  }

  .guestbook-input,
  .guestbook-textarea {
    padding: 0.9rem 1.1rem;
    font-size: 1rem;
  }

  .guestbook-submit {
    padding: 0.9rem 2rem;
    font-size: 1rem;
  }

  .guestbook-item {
    padding: 1.5rem;
  }

  .gb-name {
    font-size: 1.05rem;
  }

  .gb-message {
    font-size: 1rem;
  }

  .article-container {
    max-width: 900px;
    padding: 3rem;
  }

  .article-container h1 {
    font-size: 2.5rem;
  }

  .article-container p {
    font-size: 1.1rem;
    line-height: 1.9;
  }

  .bottom-tab {
    padding: 0.6rem 2rem;
  }

  .bottom-tab-item {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
  }
}

/* ═══ 超大屏幕适配 (2K/4K) ═══ */
@media (min-width: 1920px) {
  .site-main {
    width: min(1600px, calc(100% - 6rem));
  }

  .home-hero-copy h1 {
    font-size: clamp(3.5rem, 4vw, 5rem);
  }

  .home-hero-copy .lead {
    font-size: 1.25rem;
    max-width: 700px;
  }

  .home-quick-links a {
    min-height: 72px;
    padding: 1.2rem 1.5rem;
  }

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

  .stack-grid a {
    padding: 2.5rem;
  }

  .photowall-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }

  .article-container {
    max-width: 1000px;
    padding: 4rem;
  }
}
