/* ==========================================================================
   LJF Personal Universe · 基础设计系统
   Apple 式克制排版、毛玻璃、双主题、无障碍焦点与减弱动态效果支持
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: "SFMono-Regular", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --bg: #f5f5f7;
  --bg-soft: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f1f1f4;
  --surface-3: #e8e8ed;
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.16);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --accent-text: #0066cc;
  --violet: #7c5cff;
  --pink: #ff5f8f;
  --green: #1a9c5d;
  --orange: #f56300;
  --danger: #d70015;
  --danger-soft: rgba(215, 0, 21, 0.09);
  --warning: #b25000;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --glass-solid: #ffffff;
  --glass-border: rgba(255, 255, 255, 0.72);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 36px 100px rgba(0, 0, 0, 0.16);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;
  --nav-height: 62px;
  --container: 1240px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 92px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #050506;
  --bg-soft: #08080a;
  --surface: #111114;
  --surface-2: #18181c;
  --surface-3: #232329;
  --text: #f5f5f7;
  --text-2: #d2d2d7;
  --muted: #a1a1a6;
  --faint: #8e8e93;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #0a84ff;
  --accent-hover: #399dff;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --accent-text: #64b5ff;
  --violet: #9b7bff;
  --pink: #ff7aa2;
  --green: #32d583;
  --orange: #ff9f0a;
  --danger: #ff6961;
  --danger-soft: rgba(255, 105, 97, 0.14);
  --warning: #ffb340;
  --glass: rgba(18, 18, 22, 0.62);
  --glass-strong: rgba(18, 18, 22, 0.88);
  --glass-solid: #131317;
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 40px 120px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.3s var(--ease);
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--text);
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

strong,
b {
  font-weight: 650;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translate(-50%, -160%);
  z-index: 999;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

/* 环境光背景 ------------------------------------------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  transform: translateZ(0);
  will-change: transform;
}

.ambient-one {
  width: 52vw;
  height: 52vw;
  top: -18vw;
  right: -10vw;
  background: radial-gradient(circle at 35% 35%, rgba(0, 113, 227, 0.28), transparent 66%);
  animation: ambientDrift 26s ease-in-out infinite alternate;
}

.ambient-two {
  width: 44vw;
  height: 44vw;
  bottom: -16vw;
  left: -12vw;
  background: radial-gradient(circle at 60% 40%, rgba(124, 92, 255, 0.22), transparent 68%);
  animation: ambientDrift 32s ease-in-out infinite alternate-reverse;
}

.ambient-three {
  width: 30vw;
  height: 30vw;
  top: 46%;
  left: 38%;
  background: radial-gradient(circle, rgba(255, 95, 143, 0.1), transparent 70%);
  filter: blur(100px);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 10%, transparent 78%);
  opacity: 0.28;
}

[data-theme="dark"] .ambient-orb {
  opacity: 0.5;
}

[data-theme="dark"] .ambient-one {
  background: radial-gradient(circle at 35% 35%, rgba(10, 132, 255, 0.28), transparent 66%);
}

[data-theme="dark"] .ambient-two {
  background: radial-gradient(circle at 60% 40%, rgba(124, 92, 255, 0.24), transparent 68%);
}

@keyframes ambientDrift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-4vw, 5vh, 0) scale(1.12);
  }
}

/* 毛玻璃 ---------------------------------------------------------------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-solid);
    border-color: var(--line);
  }
}

/* 导航 ------------------------------------------------------------------ */
.site-nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  width: min(calc(100% - 32px), var(--container));
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease), transform 0.35s var(--ease);
}

.site-nav.is-scrolled {
  box-shadow: var(--shadow-md);
  background: var(--glass-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 17px;
  font-weight: 750;
  background: linear-gradient(145deg, #0a84ff, #7c5cff 58%, #ff5f8f);
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.28);
}

.brand-text {
  font-size: 17px;
  line-height: 1;
}

.brand-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-inline: auto;
}

.nav-links a {
  position: relative;
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.nav-links a.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-entry {
  color: var(--faint);
}

.admin-entry:hover {
  color: var(--accent);
}

.menu-toggle {
  display: none;
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.mobile-menu {
  position: fixed;
  z-index: 89;
  top: calc(16px + var(--nav-height) + 10px);
  left: 16px;
  right: 16px;
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.mobile-menu.is-open {
  opacity: 1;
  transform: none;
}

.mobile-menu nav {
  display: grid;
  gap: 2px;
}

.mobile-menu nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 550;
}

.mobile-menu nav a small {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-menu nav a:hover,
.mobile-menu nav a.is-active {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.mobile-menu-foot {
  display: flex;
  gap: 8px;
  padding: 10px 4px 4px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

/* 页面 & 页脚 ------------------------------------------------------------ */
#app {
  min-height: 72vh;
  padding-top: calc(var(--header-h) + 18px);
  outline: none;
}

.site-footer {
  margin-top: 120px;
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 70%, transparent);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 36px;
  align-items: start;
}

.footer-brand .brand {
  margin-bottom: 14px;
}

.footer-tagline {
  color: var(--muted);
  font-size: 14px;
  max-width: 280px;
}

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

.footer-links a {
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.2s;
}

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

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  color: var(--faint);
  font-size: 12.5px;
}

.text-btn {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.text-btn:hover {
  color: var(--text);
  border-bottom-color: currentColor;
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 200;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
}

/* 按钮 ------------------------------------------------------------------ */
.btn {
  --btn-bg: var(--surface);
  --btn-color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s,
    box-shadow 0.2s, opacity 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  --btn-bg: var(--accent);
  --btn-color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 28%, transparent);
}

.btn-primary:hover {
  --btn-bg: var(--accent-hover);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 34%, transparent);
}

.btn-secondary {
  --btn-bg: color-mix(in srgb, var(--text) 6%, transparent);
  border-color: transparent;
}

.btn-secondary:hover {
  --btn-bg: color-mix(in srgb, var(--text) 10%, transparent);
}

.btn-quiet {
  --btn-bg: transparent;
  border-color: var(--line);
}

.btn-danger {
  --btn-bg: var(--danger-soft);
  --btn-color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 24%, transparent);
}

.btn-sm {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
}

.btn-lg {
  min-height: 52px;
  padding: 15px 26px;
  font-size: 16px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

.btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

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

/* 表单 ------------------------------------------------------------------ */
.field {
  display: grid;
  gap: 7px;
}

.field > label,
.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.field-hint {
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.5;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--line-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface);
}

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

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.checkbox {
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

/* 标签、徽章、提示 ------------------------------------------------------- */
.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.tag,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent-text);
  letter-spacing: 0.02em;
  font-weight: 550;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-green {
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
}

.badge-blue {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge-orange {
  background: color-mix(in srgb, var(--orange) 14%, transparent);
  color: var(--orange);
}

.badge-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-gray {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--muted);
}

.gradient-text {
  background: linear-gradient(110deg, var(--text) 6%, var(--accent) 46%, var(--violet) 74%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.small {
  font-size: 12.5px;
}

/* 卡片 ------------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--shadow-sm);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card {
    background: var(--surface);
    border-color: var(--line);
  }
}

/* 骨架屏 ---------------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent), transparent);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.skeleton-kicker {
  width: 130px;
  height: 12px;
  margin-bottom: 26px;
}

.skeleton-title {
  width: min(720px, 84%);
  height: clamp(42px, 7vw, 82px);
  margin-bottom: 16px;
  border-radius: var(--radius-md);
}

.skeleton-title.short {
  width: min(520px, 62%);
}

.skeleton-copy {
  width: min(560px, 76%);
  height: 20px;
  margin: 30px 0 44px;
}

.skeleton-card {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-lg);
}

.boot-screen {
  padding-top: 40px;
}

/* 加载、空、错误状态 ----------------------------------------------------- */
.state {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 76px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}

.state-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--faint);
}

.state h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.state p {
  max-width: 420px;
  font-size: 13.5px;
  line-height: 1.7;
}

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

.inline-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.loading-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* Toast ----------------------------------------------------------------- */
.toast-region {
  position: fixed;
  z-index: 300;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 13.5px;
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease-spring);
}

.toast.is-leaving {
  animation: toastOut 0.22s var(--ease) forwards;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.toast-error .toast-dot {
  background: var(--danger);
}

.toast-info .toast-dot {
  background: var(--accent);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* 弹层基础 -------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, #000 36%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.22s var(--ease);
}

.overlay.is-closing {
  animation: fadeOut 0.18s var(--ease) forwards;
}

.dialog {
  width: min(560px, 100%);
  max-height: min(84vh, 900px);
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 26px;
  animation: dialogIn 0.28s var(--ease-spring);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dialog-head h2 {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.dialog-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

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

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.close-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  flex: none;
}

.close-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.close-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* 富文本 ---------------------------------------------------------------- */
.prose {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: -0.005em;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-top: 1.8em;
}

.prose h1 {
  font-size: 32px;
}

.prose h2 {
  font-size: 25px;
}

.prose h3 {
  font-size: 20px;
}

.prose h4 {
  font-size: 17px;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 18px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 17px;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
}

.prose pre {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose img {
  border-radius: var(--radius-md);
}

.prose hr {
  margin: 2em 0;
}

/* 减弱动态效果 ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .ambient-orb {
    animation: none !important;
  }
}

/* 响应式基础 ------------------------------------------------------------- */
@media (max-width: 1120px) {
  .nav-links a {
    padding-inline: 8px;
    font-size: 12.8px;
  }

  .nav-links {
    gap: 0;
  }
}

@media (max-width: 980px) {
  .wrap {
    padding-inline: 24px;
  }

  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .nav-actions {
    margin-left: auto;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 82px;
    --nav-height: 56px;
  }

  .wrap {
    padding-inline: 18px;
  }

  .site-nav {
    top: 10px;
    width: calc(100% - 20px);
    padding: 0 8px 0 14px;
    gap: 10px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 9px;
    font-size: 15px;
  }

  .brand-text {
    font-size: 16px;
  }

  .nav-action[data-action="share"] {
    display: none;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .mobile-menu {
    top: calc(10px + var(--nav-height) + 8px);
    left: 10px;
    right: 10px;
  }

  #app {
    padding-top: calc(var(--header-h) + 14px);
  }

  .site-footer {
    margin-top: 80px;
    padding: 42px 0 30px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .dialog {
    padding: 20px;
    max-height: 88vh;
  }

  .toast-region {
    bottom: 16px;
  }
}

@media (max-width: 380px) {
  .brand-text {
    display: none;
  }
}

/* 滚动条 ---------------------------------------------------------------- */
@supports (scrollbar-width: thin) {
  * {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text) 18%, transparent) transparent;
  }
}
