/* =========================================================
   光棍天堂 - 二次元同好交流圈
   完整样式表 (style.css)
   ========================================================= */

/* ---------- CSS 变量与主题 ---------- */
:root {
  --bg-primary: #0a0a18;
  --bg-secondary: #14142a;
  --bg-card: #1a1a35;
  --bg-card-hover: #22224a;
  --bg-glass: rgba(20, 20, 46, 0.65);
  --bg-glass-light: rgba(26, 26, 53, 0.5);
  --border-color: #2d2d55;
  --border-hover: #8b5cf6;
  --text-primary: #f0f0ff;
  --text-secondary: #e0e0f0;
  --text-muted: #b0b0d0;
  --text-dim: #8888aa;
  --accent: #a78bfa;
  --accent-light: #c4b5fd;
  --accent-gradient: linear-gradient(145deg, #8b5cf6, #6d28d9);
  --accent-gradient-hover: linear-gradient(145deg, #a78bfa, #7c3aed);
  --tag-bg: #2d2d55;
  --card-radius: 14px;
  --card-radius-lg: 18px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.2);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- 基础重置与全局 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: var(--bg-primary);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
    linear-gradient(145deg, #0a0a18 0%, #14142a 100%);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(10, 10, 24, 0.4) 100%);
  animation: aurora 20s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes aurora {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.5; }
  50% { transform: translate(2%, 1%) rotate(1deg); opacity: 0.8; }
  100% { transform: translate(-2%, -1%) rotate(-1deg); opacity: 0.5; }
}

/* 链接 */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease, opacity 0.2s ease;
  position: relative;
}

a:hover {
  color: var(--accent-light);
  text-decoration: none;
}

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

/* 标题 */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  background: linear-gradient(135deg, #f0f0ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 2.5rem 0 1.2rem;
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-hover), transparent);
  margin-left: 1rem;
  opacity: 0.4;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  margin: 1.5rem 0 0.8rem;
  color: var(--text-primary);
}

/* 段落 */
p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 容器 */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ---------- 头部 ---------- */
header {
  background: rgba(13, 13, 32, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

header:hover {
  background: rgba(13, 13, 32, 0.9);
  box-shadow: 0 4px 40px rgba(139, 92, 246, 0.1);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo h1 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #6d28d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
  animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.2)); }
  50% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4)); }
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.95rem;
}

nav a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

nav a:hover, nav a.active {
  color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
}

nav a:hover::before, nav a.active::before {
  width: 60%;
}

/* ---------- 主布局 ---------- */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ---------- 网格系统 ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 1.1rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15), var(--shadow-md);
}

.card:hover::before {
  opacity: 1;
}

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

.card img {
  border-radius: 8px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.8rem;
  transition: transform 0.5s ease, filter 0.5s ease;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 0.7;
  object-fit: cover;
}

.card:hover img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.card-title {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.card:hover .card-title {
  color: var(--accent-light);
}

.card-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--text-secondary);
  padding: 0.25rem 0.85rem;
  border-radius: 30px;
  font-size: 0.78rem;
  margin: 0.2rem 0.2rem 0 0;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  cursor: default;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.tag:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-1px);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  margin: 0.5rem 0.5rem 0 0;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(109, 40, 217, 0.3);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover {
  background: var(--accent-gradient-hover);
  text-decoration: none;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(109, 40, 217, 0.3);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}

/* ---------- 侧边栏 ---------- */
aside {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.8rem;
  margin: 0;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

aside:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

aside h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(45, 45, 85, 0.6);
  padding: 0.7rem 0.3rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  border-radius: 8px;
  cursor: default;
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-item:hover {
  color: var(--accent-light);
  background: rgba(139, 92, 246, 0.08);
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

/* ---------- 评论区 ---------- */
.comment-box {
  background: var(--bg-glass-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.3rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.comment-box:nth-child(2) { animation-delay: 0.05s; }
.comment-box:nth-child(3) { animation-delay: 0.1s; }
.comment-box:nth-child(4) { animation-delay: 0.15s; }
.comment-box:nth-child(5) { animation-delay: 0.2s; }
.comment-box:nth-child(6) { animation-delay: 0.25s; }
.comment-box:nth-child(7) { animation-delay: 0.3s; }
.comment-box:nth-child(8) { animation-delay: 0.35s; }
.comment-box:nth-child(9) { animation-delay: 0.4s; }
.comment-box:nth-child(10) { animation-delay: 0.45s; }
.comment-box:nth-child(11) { animation-delay: 0.5s; }
.comment-box:nth-child(12) { animation-delay: 0.55s; }

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

.comment-box:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.1);
}

.comment-user {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.comment-time {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-left: 0.8rem;
  font-weight: 400;
}

.comment-box p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- 特色区块 ---------- */
section[style*="background"] {
  position: relative;
  overflow: hidden;
}

section[style*="background"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* ---------- 页脚 ---------- */
footer {
  background: rgba(10, 10, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-top: 4rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

footer .container {
  position: relative;
  z-index: 1;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: var(--accent);
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.footer-links a:hover {
  color: var(--accent-light);
  border-color: var(--border-hover);
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.copyright {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.8;
  border-top: 1px solid rgba(45, 45, 85, 0.5);
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ---------- 选择文本 ---------- */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

/* ---------- 动画 ---------- */

/* 滚动进入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.8s ease both;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }
section:nth-child(6) { animation-delay: 0.5s; }

/* 卡片悬浮光效 */
@keyframes cardGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.1); }
  50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.2); }
}

.card:nth-child(odd) {
  animation: cardGlow 6s ease-in-out infinite;
}

/* 页脚链接动画 */
@keyframes linkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  aside {
    position: static;
    margin-top: 1rem;
  }

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

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  nav a {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

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

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

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 0.9rem;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-meta {
    font-size: 0.8rem;
  }

  .btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    display: block;
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
  }

  aside {
    padding: 1.2rem;
  }

  .comment-box {
    padding: 1rem;
  }

  .comment-time {
    display: block;
    margin-left: 0;
    margin-top: 0.2rem;
  }

  h2 {
    font-size: 1.3rem;
    padding-left: 0.8rem;
  }

  section[style*="background"] {
    padding: 1.5rem !important;
  }

  .footer-links {
    gap: 0.5rem;
  }

  .footer-links a {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (max-width: 400px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
  }

  .card {
    padding: 0.7rem;
  }

  .card img {
    margin-bottom: 0.5rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }
}

/* ---------- 暗色模式强制（已为暗色主题，额外补充） ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a18;
    --bg-secondary: #14142a;
    --bg-card: #1a1a35;
    --text-primary: #f0f0ff;
    --text-secondary: #e0e0f0;
  }
}

/* ---------- 打印优化 ---------- */
@media print {
  header, aside, footer, .btn {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    break-inside: avoid;
    border: 1px solid #ddd;
  }
}

/* ---------- 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 工具类 ---------- */
.text-gradient {
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(20, 20, 46, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(45, 45, 85, 0.6);
}

.hover-grow {
  transition: transform 0.3s ease;
}

.hover-grow:hover {
  transform: scale(1.05);
}

/* ---------- 卡片进入动画 ---------- */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.grid .card {
  animation: cardIn 0.6s ease both;
}

.grid .card:nth-child(1) { animation-delay: 0.05s; }
.grid .card:nth-child(2) { animation-delay: 0.1s; }
.grid .card:nth-child(3) { animation-delay: 0.15s; }
.grid .card:nth-child(4) { animation-delay: 0.2s; }
.grid .card:nth-child(5) { animation-delay: 0.25s; }
.grid .card:nth-child(6) { animation-delay: 0.3s; }
.grid .card:nth-child(7) { animation-delay: 0.35s; }
.grid .card:nth-child(8) { animation-delay: 0.4s; }
.grid .card:nth-child(9) { animation-delay: 0.45s; }
.grid .card:nth-child(10) { animation-delay: 0.5s; }
.grid .card:nth-child(11) { animation-delay: 0.55s; }
.grid .card:nth-child(12) { animation-delay: 0.6s; }

/* ---------- 排行榜数字动画 ---------- */
.rank-item span:first-child {
  font-weight: 500;
}

.rank-item span:last-child {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- 图片加载优化 ---------- */
img {
  background: linear-gradient(135deg, #1a1a35 0%, #2d2d55 100%);
  position: relative;
}

img::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 1.5s infinite;
}

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

/* ---------- 自定义动画：标题下划线 ---------- */
h2 {
  position: relative;
  overflow: hidden;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 40px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  animation: lineGrow 2s ease-in-out infinite;
}

@keyframes lineGrow {
  0%, 100% { width: 40px; opacity: 0.6; }
  50% { width: 80px; opacity: 1; }
}

/* ---------- 移动端底部导航优化 ---------- */
@media (max-width: 600px) {
  nav ul {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  nav ul::-webkit-scrollbar {
    display: none;
  }

  nav a {
    white-space: nowrap;
  }
}

/* ---------- 高对比度模式 ---------- */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #f0f0ff;
    --text-muted: #d0d0e8;
    --border-color: #4a4a8a;
    --border-hover: #a78bfa;
  }
}

/* ---------- 结束 ---------- */