/* ============================================================
   18漫画 (lipinhui.net.cn) — 完整样式表
   风格: 现代漫画平台 · 渐变Banner · 毛玻璃 · 圆角卡片 · 响应式 · 暗色模式
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f4f6fb;
  --bg-card: #ffffff;
  --bg-footer: #1F2937;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-banner-gradient: linear-gradient(135deg, #4F46E5 0%, #9333EA 50%, #1F2937 100%);
  --bg-badge: rgba(255, 255, 255, 0.15);

  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --text-heading: #111827;
  --text-footer: #E5E7EB;
  --text-link: #1D4ED8;
  --text-btn: #ffffff;
  --text-hover: #111827;

  --btn-bg: #1F2937;
  --btn-bg-hover: #111827;

  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 6px 20px rgba(31, 41, 55, 0.08);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ---------- 暗色模式变量 ---------- */
[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #1E293B;
  --bg-footer: #0B1120;
  --bg-nav: rgba(15, 23, 42, 0.85);
  --bg-banner-gradient: linear-gradient(135deg, #1E3A8A 0%, #6D28D9 50%, #111827 100%);
  --bg-badge: rgba(255, 255, 255, 0.1);

  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-heading: #F8FAFC;
  --text-footer: #CBD5E1;
  --text-link: #93C5FD;
  --text-btn: #0F172A;
  --text-hover: #ffffff;

  --btn-bg: #E2E8F0;
  --btn-bg-hover: #ffffff;

  --border-light: #334155;
  --border-medium: #475569;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ---------- 重置与基础 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

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

a {
  color: var(--text-link);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-hover);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 2.5rem; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

/* ---------- 布局容器 ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ============================================================
   导航栏 (毛玻璃 + 吸顶)
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  gap: 1rem;
}

.logo a {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: 0.5px;
  text-decoration: none;
  background: linear-gradient(135deg, #4F46E5, #9333EA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity var(--transition-fast);
}

.logo a:hover {
  opacity: 0.8;
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.3rem 0;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #4F46E5, #9333EA);
  transition: width var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-link);
  text-decoration: none;
}

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

.theme-toggle,
.menu-toggle {
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  line-height: 1;
}

.theme-toggle:hover,
.menu-toggle:hover {
  background-color: var(--bg-secondary);
  transform: scale(1.05);
}

.menu-toggle {
  display: none;
}

/* ---------- 移动端导航 ---------- */
@media (max-width: 768px) {
  .nav-inner {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-light);
    margin-top: 0.75rem;
  }

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

  .nav-links a {
    padding: 0.6rem 0.5rem;
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .nav-links a:hover {
    background-color: var(--bg-secondary);
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }
}

/* ============================================================
   Banner (渐变 + 玻璃效果)
   ============================================================ */
.banner {
  background: var(--bg-banner-gradient);
  color: white;
  padding: 4rem 2rem;
  border-radius: var(--radius-lg);
  margin: 2rem 0 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.banner::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: -5%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.banner h1 {
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  margin-bottom: 0.75rem;
}

.banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  max-width: 700px;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.banner .btn {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
  background-color: #ffffff;
  color: #1F2937;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.banner .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   面包屑
   ============================================================ */
.breadcrumb {
  padding: 0.7rem 1.2rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-full);
  margin: 1.5rem 0;
  font-size: 0.9rem;
  display: inline-block;
  border: 1px solid var(--border-light);
}

.breadcrumb a {
  color: var(--text-link);
}

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

/* ============================================================
   卡片网格 (圆角 + 阴影 + hover动画)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  margin: 2rem 0;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4F46E5, #9333EA);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

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

.card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.card a {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--transition-fast);
}

.card a:hover {
  gap: 0.6rem;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-block;
  background-color: var(--btn-bg);
  color: var(--text-btn);
  padding: 0.7rem 1.8rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.btn:hover {
  background-color: var(--btn-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  color: var(--text-btn);
  text-decoration: none;
}

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

/* ============================================================
   FAQ 折叠面板
   ============================================================ */
.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 0;
  transition: background-color var(--transition-fast);
}

.faq-item:first-child {
  border-top: 1px solid var(--border-light);
}

.faq-question {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-heading);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
  user-select: none;
}

.faq-question:hover {
  color: var(--text-link);
}

.faq-question span {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-link);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.faq-question:hover span {
  background-color: var(--text-link);
  color: white;
}

.faq-answer {
  margin-top: 0.75rem;
  color: var(--text-primary);
  padding-right: 2rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ============================================================
   表格
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--border-light);
  padding: 0.85rem 1.25rem;
  text-align: left;
}

th {
  background-color: var(--bg-secondary);
  color: var(--text-heading);
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: var(--bg-secondary);
}

tr:hover {
  background-color: var(--bg-secondary);
}

/* ============================================================
   Footer (深色)
   ============================================================ */
.footer {
  background-color: var(--bg-footer);
  color: var(--text-footer);
  padding: 4rem 1.5rem 2rem;
  margin-top: 4rem;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4F46E5, #9333EA, #4F46E5);
  background-size: 200% 100%;
  animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.footer a {
  color: var(--text-footer);
  text-decoration: underline;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

.footer a:hover {
  color: #ffffff;
  opacity: 0.9;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.footer h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.footer h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #4F46E5, #9333EA);
}

.footer p,
.footer li {
  color: var(--text-footer);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer ul li {
  margin-bottom: 0.6rem;
}

.footer .copyright {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   回到顶部
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--btn-bg);
  color: var(--text-btn);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: all var(--transition-fast);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

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

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   滚动动画
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   数字统计
   ============================================================ */
.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
}

/* ============================================================
   图片占位
   ============================================================ */
.svg-placeholder {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 1px dashed var(--border-medium);
  min-height: 120px;
}

/* ============================================================
   工具类
   ============================================================ */
.text-muted {
  color: var(--text-secondary) !important;
}

.text-body {
  color: var(--text-primary) !important;
}

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

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* ============================================================
   暗色模式修正
   ============================================================ */
[data-theme="dark"] .banner {
  background: var(--bg-banner-gradient);
}

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

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

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

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

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

/* ============================================================
   响应式断点
   ============================================================ */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.25rem;
  }

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

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .banner {
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1rem 0 2rem;
  }

  .banner h1 {
    font-size: 1.7rem;
  }

  .banner p {
    font-size: 1rem;
  }

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

  .card {
    padding: 1.25rem;
  }

  .footer {
    padding: 3rem 1rem 1.5rem;
  }

  .footer-grid {
    gap: 1.5rem;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.7rem 1rem;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; margin-top: 2rem; }
  h3 { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .banner {
    padding: 2rem 1.25rem;
  }

  .banner h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1rem;
  }

  .faq-question {
    font-size: 0.95rem;
  }

  .footer h4 {
    font-size: 1rem;
  }
}

/* ============================================================
   打印样式 (可选)
   ============================================================ */
@media print {
  .navbar,
  .back-to-top,
  .menu-toggle,
  .theme-toggle {
    display: none !important;
  }

  .banner {
    background: #1F2937;
    color: white;
    box-shadow: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================================
   性能优化: 滚动条美化 (Webkit)
   ============================================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #4F46E5, #9333EA);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #4338CA, #7E22CE);
}

/* ============================================================
   无障碍: 焦点可见
   ============================================================ */
:focus-visible {
  outline: 3px solid #4F46E5;
  outline-offset: 2px;
}

/* ============================================================
   动画: 页面加载淡入
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.banner,
.breadcrumb,
.card-grid,
section {
  animation: fadeInUp 0.8s ease-out both;
}

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

/* ============================================================
   性能: 减少动画 (用户偏好)
   ============================================================ */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}