/* ============================================
   SKDUID Personal Blog — Global Styles
   Glassmorphism Theme
   ============================================ */

@import url('https://fonts.font.im/css2?family=Space+Grotesk:wght@500;700&display=swap');

/* ----- CSS Variables ----- */
:root {
  --bg-deep: #0a0a14;
  --bg-gradient: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-bg-alt: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-active: rgba(255, 255, 255, 0.18);
  --text-primary: #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted: #606078;
  --accent: #6c8cff;
  --accent-light: rgba(108, 140, 255, 0.15);
  --accent-glow: 0 0 20px rgba(108, 140, 255, 0.25);
  --danger: #ff5c6c;
  --danger-light: rgba(255, 92, 108, 0.15);
  --success: #44d7b6;
  --success-light: rgba(68, 215, 182, 0.15);
  --warning: #f0a050;
  --title-c1: #6c8cff;
  --title-c2: #44d7b6;
  --title-c3: #c084fc;
  --title-glow: 0 0 30px rgba(108, 140, 255, 0.35);
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
}

/* ----- Light Theme ----- */
[data-theme="light"] {
  --bg-deep: #f0f2f5;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e9f0 50%, #dce3ed 100%);
  --glass-bg: rgba(255,255,255,0.55);
  --glass-bg-hover: rgba(255,255,255,0.75);
  --glass-bg-alt: rgba(255,255,255,0.45);
  --glass-border: rgba(0,0,0,0.08);
  --glass-border-active: rgba(0,0,0,0.14);
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --text-muted: #999;
  --accent: #5a7af0;
  --accent-light: rgba(90,122,240,0.12);
  --accent-glow: 0 0 20px rgba(90,122,240,0.2);
  --title-c1: #4a6cf7;
  --title-c2: #1db88a;
  --title-c3: #8b5cf6;
  --title-glow: 0 0 30px rgba(74, 108, 247, 0.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.08);
  --shadow: 0 8px 24px rgba(0,0,0,0.05);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.03);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg-deep);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  opacity: 0.85;
}

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

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ----- Container ----- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-xs {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Glass Navigation Bar — 液态玻璃增强 ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(2) brightness(1.08) contrast(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(2) brightness(1.08) contrast(1.05);
  background: rgba(10, 10, 20, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 56px;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
  backdrop-filter: blur(30px) saturate(2.2) brightness(1.12) contrast(1.08);
  -webkit-backdrop-filter: blur(30px) saturate(2.2) brightness(1.12) contrast(1.08);
  background: rgba(10, 10, 20, 0.25);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 2px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.35);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  white-space: nowrap;
}

.nav-logo:hover {
  color: var(--accent);
  opacity: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
  opacity: 1;
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--accent);
}

/* Hamburger Menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

.nav-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none; border: none; cursor: pointer; padding: 8px;
  border-radius: 50%; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast); flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); background: var(--glass-bg-hover); }
.theme-toggle svg { width: 20px; height: 20px; }

/* Theme Transition Overlay — sweeps behind all content */
.theme-transition-overlay {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  transform: translate(-50%, -50%) scale(0);
  opacity: 1;
  transition: transform 0.7s cubic-bezier(0.32, 0.05, 0.23, 0.99),
              opacity 0.3s ease;
}

/* ----- Glass Card — 液态玻璃增强 ----- */
.glass-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(2) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(2) brightness(1.1) contrast(1.05);
  border: 1px double rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  overflow: hidden;
}

/* Frosted glass — internal shadow depth */
.glass-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border-radius: inherit;
  border: 1px solid rgba(0, 0, 0, 0.5);
  filter: blur(6px);
  pointer-events: none;
}

/* Diagonal highlight reflection */
.glass-card::after {
  z-index: 2;
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  filter: blur(2px);
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 25%,
    transparent 75%,
    rgba(255, 255, 255, 0.15) 100%
  );
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.35s ease;
}

.glass-card:hover::after {
  opacity: 1;
}

.glass-card:hover {
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, 0.3),
    inset -2px 2px 1px -1px rgba(255, 255, 255, 0.3),
    inset 5px -5px 1px -5px rgba(255, 255, 255, 0.2),
    inset -5px 5px 1px -5px rgba(255, 255, 255, 0.2),
    inset 0 0 3px rgba(0, 0, 0, 0.5),
    0 8px 32px rgba(0, 0, 0, 0.3);
  filter: brightness(1);
}

.glass-card.interactive:hover {
  transform: translateY(-3px);
}

/* FX layer — apply contrast filter to containers wrapping glass cards */
.glass-fx {
  filter: contrast(1.3);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--accent-glow);
  transform: translateY(-1px);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--glass-border-active);
  color: var(--text-primary);
  background: var(--glass-bg-hover);
  opacity: 1;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(255, 92, 108, 0.3);
  opacity: 1;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--radius-xs);
}

/* ----- Form Inputs ----- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
  font-family: inherit;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), 0 0 20px rgba(108, 140, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="url"],
[data-theme="light"] input[type="search"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: rgba(0, 0, 0, 0.04);
}

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

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239090a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

::placeholder {
  color: var(--text-muted);
}

/* ----- Tags ----- */
.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.tag:hover {
  background: rgba(108, 140, 255, 0.25);
  opacity: 1;
}

.tag.active {
  background: var(--accent);
  color: #fff;
}

/* ----- Timeline ----- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--glass-border);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 12px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--glass-bg);
  box-shadow: 0 0 8px rgba(108, 140, 255, 0.4);
  z-index: 1;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ----- Glass Modal ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: rgba(20, 20, 35, 0.85);
  backdrop-filter: blur(30px) saturate(2.2) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(30px) saturate(2.2) brightness(1.1) contrast(1.05);
  border: 1px double rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, 0.15),
    inset -2px 2px 1px -1px rgba(255, 255, 255, 0.15),
    inset 0 0 2px rgba(0, 0, 0, 0.5),
    0 16px 48px rgba(0, 0, 0, 0.4);
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.95);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

/* Square QR modal */
.modal-content.qr-modal {
  max-width: 380px;
  aspect-ratio: 1 / 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


/* ----- Toast ----- */
.toast-container {
  position: fixed !important;
  top: 24px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #fff;
  animation: slideUpToast 0.3s ease, fadeOutToast 0.3s ease 2.7s forwards;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border-active);
  backdrop-filter: blur(16px) saturate(2) brightness(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(2) brightness(1.1);
  white-space: nowrap;
  pointer-events: auto;
}

.toast-info {
  background: rgba(30, 30, 50, 0.9);
  border-color: var(--glass-border-active);
}

.toast-success {
  background: rgba(68, 215, 182, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.toast-error {
  background: rgba(255, 92, 108, 0.2);
  border-color: var(--danger);
  color: #ff8a94;
}

/* ----- Empty State ----- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

/* ----- Spinner ----- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

/* ----- Footer ----- */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--glass-border);
  margin-top: 60px;
}

/* ----- Page Header ----- */
.page-header {
  padding-top: 80px;
  margin-bottom: 32px;
  text-align: center;
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ----- Utility Classes ----- */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- Animations ----- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes fadeOutToast {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

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


/* ----- Modal Theme Overrides ----- */
[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .modal-content {
  background: rgba(255, 255, 255, 0.98);
}

/* ----- Responsive (768px) ----- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(30px) saturate(2) brightness(1.1);
    -webkit-backdrop-filter: blur(30px) saturate(2) brightness(1.1);
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    padding: 12px 0;
    gap: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 24px;
    border-radius: 0;
    width: 100%;
  }

  .nav-links a.active::after {
    display: none;
  }

  .nav-links a.active {
    background: var(--accent-light);
  }

  .nav-toggle {
    display: block;
  }

  .container,
  .container-sm,
  .container-xs {
    padding: 0 16px;
  }

  .modal-content {
    padding: 24px;
    margin: 10px;
  }

  [data-theme="light"] .nav-links {
    background: rgba(240, 242, 245, 0.95);
  }
}

/* ----- Markdown Content ----- */
.md-content { line-height: 1.9; color: var(--text-primary); }
.md-content h1, .md-content h2, .md-content h3,
.md-content h4, .md-content h5, .md-content h6 {
  margin-top: 1.4em; margin-bottom: 0.6em; font-weight: 600;
  color: var(--text-primary);
}
.md-content h1 { font-size: 1.6em; }
.md-content h2 { font-size: 1.35em; }
.md-content h3 { font-size: 1.15em; }
.md-content p { margin-bottom: 0.8em; }
.md-content ul, .md-content ol { padding-left: 1.6em; margin-bottom: 0.8em; }
.md-content li { margin-bottom: 0.3em; }
.md-content code {
  background: var(--glass-bg-alt); padding: 2px 6px; border-radius: var(--radius-xs);
  font-family: "SF Mono", "Fira Code", "Consolas", monospace; font-size: 0.9em;
}
.md-content pre {
  background: var(--glass-bg-alt); padding: 16px; border-radius: var(--radius);
  overflow-x: auto; margin-bottom: 1em; border: 1px solid var(--glass-border);
}
.md-content pre code {
  background: none; padding: 0; font-size: 0.85em; line-height: 1.6;
}
.md-content blockquote {
  border-left: 3px solid var(--accent); padding: 8px 16px;
  margin: 0.8em 0; color: var(--text-secondary);
  background: var(--glass-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.md-content a { color: var(--accent); text-decoration: underline; }
.md-content img { max-width: 100%; border-radius: var(--radius); margin: 0.8em 0; }
.md-content hr { border: none; border-top: 1px solid var(--glass-border); margin: 1.5em 0; }
.md-content table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.md-content th, .md-content td {
  border: 1px solid var(--glass-border); padding: 8px 12px; text-align: left;
}
.md-content th { background: var(--glass-bg-alt); font-weight: 600; }

/* Preview in editor */
.md-preview {
  max-height: 50vh; overflow-y: auto; padding: 12px;
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  background: var(--glass-bg);
}

/* ============================================
   Liquid Glass — Scroll Reveal Animations
   ============================================ */

[data-reveal] {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal="fade-up"] {
  transform: translateY(40px);
}
[data-reveal="fade-left"] {
  transform: translateX(-40px);
}
[data-reveal="fade-right"] {
  transform: translateX(40px);
}
[data-reveal="scale"] {
  transform: scale(0.9);
}
[data-reveal="blur"] {
  filter: blur(8px);
  transform: translateY(20px);
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ============================================
   Liquid Glass — Scroll Progress Bar
   ============================================ */

.scroll-progress {
  position: fixed;
  top: 56px;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  z-index: 101;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(108, 140, 255, 0.4), 0 0 20px rgba(68, 215, 182, 0.2);
}

/* ============================================
   Liquid Glass — Back to Top Button
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(2) brightness(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(2) brightness(1.1);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--shadow-sm);
}

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

.back-to-top:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--accent);
  box-shadow: 0 8px 32px rgba(108, 140, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* Breathing glow animation for back-to-top */
.back-to-top.visible {
  animation: breatheGlow 3s ease-in-out infinite;
}

@keyframes breatheGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
  50% { box-shadow: 0 8px 32px rgba(108, 140, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
}

/* ============================================
   Liquid Glass — Body Page Fade-In
   ============================================ */

body {
  animation: pageLoadFadeIn 0.6s ease-out;
}

@keyframes pageLoadFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Liquid Glass — Button Ripple Effect
   ============================================ */

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  transform: scale(0);
  animation: rippleExpand 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleExpand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================
   Glass — Light Theme Overrides
   ============================================ */

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(2) brightness(1.02) contrast(1.02);
  -webkit-backdrop-filter: blur(20px) saturate(2) brightness(1.02) contrast(1.02);
  border-color: rgba(0,0,0,0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0,0,0,0.05);
}

[data-theme="light"] .glass-card::before {
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-card::after {
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.5) 0%,
    transparent 25%,
    transparent 75%,
    rgba(255, 255, 255, 0.5) 100%
  );
}

[data-theme="light"] .glass-card:hover {
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, 0.95),
    inset -2px 2px 1px -1px rgba(255, 255, 255, 0.95),
    inset 5px -5px 1px -5px rgba(255, 255, 255, 0.6),
    inset -5px 5px 1px -5px rgba(255, 255, 255, 0.6),
    inset 0 0 3px rgba(0, 0, 0, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .scroll-progress {
  box-shadow: 0 0 8px rgba(90, 122, 240, 0.3), 0 0 20px rgba(68, 215, 182, 0.15);
}

/* ============================================
   Liquid Glass — Word Reveal (Scroll Text Animation)
   ============================================ */

.word-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.word-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .word-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   Liquid Glass — Reduced Motion
   ============================================ */

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

  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .back-to-top.visible {
    animation: none;
  }

  body {
    animation: none;
  }
}

/* ============================================
   Liquid Glass — Firefox Fallback (updated)
   ============================================ */
@supports not (backdrop-filter: blur(1px)) {
  .navbar {
    background: rgba(10, 10, 20, 0.7);
  }
  .navbar.scrolled {
    background: rgba(10, 10, 20, 0.92);
  }
  .glass-card {
    background: rgba(20, 20, 40, 0.7);
  }
  .modal-overlay {
    background: rgba(0, 0, 0, 0.75);
  }
  .modal-content {
    background: rgba(20, 20, 40, 0.98);
  }
  .toast {
    background: rgba(20, 20, 40, 0.98);
  }
  .back-to-top {
    background: rgba(20, 20, 40, 0.8);
  }

  [data-theme="light"] .navbar {
    background: rgba(240, 242, 245, 0.8);
  }
  [data-theme="light"] .navbar.scrolled {
    background: rgba(240, 242, 245, 0.95);
  }
  [data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.8);
  }
  [data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.35);
  }
  [data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.98);
  }
  [data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.98);
  }
  [data-theme="light"] .back-to-top {
    background: rgba(255, 255, 255, 0.85);
  }
}

/* 隐藏系统光标，使用自定义光标 */
@media (pointer: fine) {
  *, *::before, *::after { cursor: none !important; }
}
