/* momo漫画 - 完整样式表 */
/* 全局设计变量 – 高对比度文字色板 */
:root {
  --bg: #ffffff;
  --surface: #faf7f9;
  --surface2: #f1ecf0;
  --primary: #b43b5e;
  --primary-dark: #8c2a46;
  --text-strong: #17202A;
  --text-body: #1F2937;
  --text-muted: #334155;
  --text-hover: #0f172a;
  --border: #d8d0d6;
  --footer-bg: #17202A;
  --footer-text: #E5E7EB;
  --card-bg: #ffffff;
  --shadow: 0 8px 24px rgba(0,0,0,0.05);
  --banner-overlay: rgba(0,0,0,0.25);
  --nav-bg: rgba(255,255,255,0.92);
  --link-color: #1e4a6b;
  --btn-text: #ffffff;
  --tag-bg: #ffe3eb;
  --tag-text: #8c2a46;
  --gradient-banner: linear-gradient(145deg, #ffe3eb 0%, #ffd6e0 40%, #f8c8da 100%);
  --gradient-hero: linear-gradient(135deg, #fff0f5 0%, #ffe3eb 50%, #ffd1dc 100%);
  --card-hover-transform: translateY(-8px);
  --card-hover-shadow: 0 20px 40px rgba(180, 59, 94, 0.15);
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 暗黑模式高可读性 */
[data-theme="dark"] {
  --bg: #0e1419;
  --surface: #1a222a;
  --surface2: #24303a;
  --primary: #ff9eb5;
  --primary-dark: #ffb3c6;
  --text-strong: #FFFFFF;
  --text-body: #E5E7EB;
  --text-muted: #cbd5e1;
  --text-hover: #ffffff;
  --border: #3a4754;
  --footer-bg: #0b1116;
  --footer-text: #F1F5F9;
  --card-bg: #1e2833;
  --shadow: 0 8px 24px rgba(0,0,0,0.4);
  --banner-overlay: rgba(0,0,0,0.35);
  --nav-bg: rgba(14,20,25,0.92);
  --link-color: #aad3ff;
  --btn-text: #111827;
  --tag-bg: #4a2f3a;
  --tag-text: #ffe2ea;
  --gradient-banner: linear-gradient(145deg, #2d1f2a 0%, #3d2438 40%, #4a2a3d 100%);
  --gradient-hero: linear-gradient(135deg, #1e2833 0%, #2d1f2a 50%, #3d2438 100%);
  --card-hover-transform: translateY(-8px);
  --card-hover-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

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

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

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  color: var(--text-strong);
  font-weight: 650;
  line-height: 1.3;
  transition: color 0.3s ease;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 2rem 0 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 4px;
  margin-top: 8px;
  transition: background 0.3s ease;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin: 1.6rem 0 0.8rem;
}

h4 {
  font-size: 1.15rem;
  margin: 1.2rem 0 0.5rem;
  font-weight: 600;
}

p {
  color: var(--text-body);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  border-bottom-color: currentColor;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px;
  width: 100%;
}

.nav-blur {
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}

/* ==================== 顶部导航 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}

.logo svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(180, 59, 94, 0.3));
  transition: transform 0.3s ease;
}

.logo:hover svg {
  transform: scale(1.1) rotate(-5deg);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-body);
  font-weight: 500;
  position: relative;
  padding: 0.3rem 0;
  border-bottom: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-links a:hover {
  color: var(--primary-dark);
  border-bottom: none;
}

.nav-links a:hover::after {
  width: 100%;
}

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

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(180, 59, 94, 0.1);
}

.search-box input {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: var(--text-body);
  width: 140px;
  outline: none;
  transition: width 0.3s ease;
}

.search-box input:focus {
  width: 180px;
}

.search-box input::placeholder {
  color: var(--text-muted);
  opacity: 0.9;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-strong);
  transition: transform 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  transform: scale(1.15);
  color: var(--primary);
}

#darkModeToggle {
  padding: 6px;
  border-radius: 50%;
  font-size: 1.2rem;
  background: var(--surface);
  width: 38px;
  height: 38px;
  justify-content: center;
  transition: all 0.3s ease;
}

#darkModeToggle:hover {
  background: var(--surface2);
  transform: rotate(20deg) scale(1.1);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.burger:hover {
  background: var(--surface);
}

.burger span {
  width: 26px;
  height: 3px;
  background: var(--text-strong);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.3s ease;
}

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

.mobile-menu a {
  color: var(--text-body);
  font-size: 1.1rem;
  padding: 0.5rem 0;
  border-bottom: none;
}

.mobile-menu a:hover {
  color: var(--primary-dark);
  padding-left: 8px;
  border-bottom: none;
}

/* ==================== 按钮 ==================== */
.btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(180, 59, 94, 0.2);
}

.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: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 8px 20px rgba(180, 59, 94, 0.3);
  transform: translateY(-2px);
}

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

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(180, 59, 94, 0.2);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary-dark);
  box-shadow: none;
}

.btn-outline::before {
  display: none;
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 20px rgba(180, 59, 94, 0.2);
}

/* ==================== Hero Banner ==================== */
.banner-section {
  background: var(--gradient-banner);
  margin-top: 20px;
  border-radius: 36px;
  padding: clamp(25px, 4vw, 40px);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.banner-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.banner-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 40%;
  height: 80%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-flex {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 2 1 300px;
  animation: fadeInUp 0.8s ease;
}

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

.hero-text .highlight {
  color: var(--primary-dark);
  font-weight: 700;
}

.hero-text p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-body);
}

.hero-art {
  flex: 1 1 200px;
  text-align: center;
  animation: fadeIn 0.8s ease 0.2s both;
}

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

.hero-art svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(180, 59, 94, 0.15));
  transition: transform 0.3s ease;
}

.hero-art svg:hover {
  transform: scale(1.05) rotate(2deg);
}

/* ==================== 卡片网格 ==================== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(180, 59, 94, 0.1);
  border-color: var(--primary);
}

.card h3 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  color: var(--text-body);
}

/* ==================== 文章列表 ==================== */
.article-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease both;
}

.article-item:hover {
  background: var(--surface);
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 12px;
}

.article-item a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-strong);
  border-bottom: none;
  transition: color 0.2s ease;
}

.article-item a:hover {
  color: var(--primary);
  border-bottom: none;
}

.article-item time {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ==================== FAQ ==================== */
details {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 18px;
  margin: 12px 0;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease both;
}

details:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(180, 59, 94, 0.1);
}

details[open] {
  border-color: var(--primary);
  background: var(--card-bg);
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-strong);
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  transition: color 0.2s ease;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '▼';
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  color: var(--primary);
}

details[open] summary::after {
  transform: rotate(180deg);
}

details p {
  margin-top: 12px;
  color: var(--text-body);
  animation: fadeIn 0.3s ease;
}

/* ==================== Footer ==================== */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 42px 0 24px;
  margin-top: auto;
  transition: background 0.3s ease;
}

.footer a {
  color: #cbd5e1;
  border-bottom: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: white;
  border-bottom: none;
  text-decoration: underline;
}

.footer h4 {
  color: white;
  margin-bottom: 12px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-grid div:first-child p {
  color: #cbd5e1;
}

.footer-bottom {
  border-top: 1px solid #2a3845;
  margin-top: 30px;
  padding-top: 20px;
  font-size: 0.9rem;
  color: #cbd5e1;
  text-align: center;
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  animation: fadeIn 0.5s ease;
}

.breadcrumb a {
  color: var(--link-color);
  border-bottom: none;
}

.breadcrumb a:hover {
  color: var(--primary);
  border-bottom: none;
}

/* ==================== 数字动画 ==================== */
.stat-number {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--primary-dark);
  transition: color 0.3s ease;
  display: inline-block;
}

/* ==================== 通用间距 ==================== */
.section-pad {
  padding: 40px 0;
}

.text-center {
  text-align: center;
}

/* ==================== 图片占位SVG文字保证对比度 ==================== */
svg text {
  fill: #1F2937;
}

[data-theme="dark"] svg text {
  fill: #E5E7EB;
}

/* ==================== 返回顶部按钮 ==================== */
#backTop {
  position: fixed;
  bottom: 28px;
  right: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 16px;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: none;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

#backTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(180, 59, 94, 0.3);
}

/* ==================== 滚动动画 ==================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== 暗色模式适配 ==================== */
[data-theme="dark"] .banner-section {
  color: var(--text-body);
}

[data-theme="dark"] .hero-text p {
  color: var(--text-body);
}

[data-theme="dark"] .card {
  background: var(--card-bg);
}

[data-theme="dark"] .btn-outline {
  color: var(--primary);
}

[data-theme="dark"] .btn-outline:hover {
  color: white;
  background: var(--primary);
}

[data-theme="dark"] .search-box {
  background: var(--surface2);
}

[data-theme="dark"] #darkModeToggle {
  background: var(--surface2);
}

/* ==================== 响应式媒体查询 ==================== */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .search-box input {
    width: 100px;
  }
}

@media (max-width: 800px) {
  .nav-links {
    display: none;
  }
  
  .burger {
    display: flex;
  }
  
  .mobile-menu.open {
    display: flex;
  }
  
  .search-box input {
    width: 90px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .hero-flex {
    gap: 20px;
  }
  
  .article-item {
    flex-direction: column;
    gap: 4px;
  }
  
  .article-item time {
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }
  
  .nav-wrap {
    height: 60px;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .logo svg {
    width: 28px;
    height: 28px;
  }
  
  .search-box {
    display: none;
  }
  
  .banner-section {
    border-radius: 24px;
    margin-top: 12px;
  }
  
  .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
  }
  
  .card {
    padding: 18px 16px;
    border-radius: 18px;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  #backTop {
    bottom: 20px;
    right: 16px;
    padding: 8px 14px;
  }
}

@media (max-width: 400px) {
  .hero-flex {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-art {
    order: -1;
  }
  
  .hero-art svg {
    max-width: 180px;
  }
  
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
  }
  
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-bottom {
    font-size: 0.8rem;
  }
}

/* ==================== 打印样式 ==================== */
@media print {
  .site-header,
  .mobile-menu,
  .footer,
  #backTop {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  transition: background 0.3s ease;
}

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

/* ==================== 焦点可见性 ==================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==================== 减少动画偏好 ==================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
