/* ============================================================
   萌喵漫画 - 完整样式表 (style.css)
   风格：软萌治愈系 · 圆角卡片 · 毛玻璃 · 渐变 · 响应式 · 暗色模式
   ============================================================ */

/* ---------- CSS Variables & 主题 ---------- */
:root {
  --bg: #fff8f5;
  --bg-gradient: linear-gradient(145deg, #fff0f5, #ffe4ec);
  --text: #3a2e2e;
  --text-light: #7a6a6a;
  --card: rgba(255, 255, 255, 0.85);
  --card-solid: #ffffff;
  --accent: #e89bb0;
  --accent-dark: #d4728f;
  --accent-light: #fce4ec;
  --border: #f0d9d9;
  --shadow: 0 8px 32px rgba(180, 100, 120, 0.08);
  --shadow-hover: 0 12px 40px rgba(180, 100, 120, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.8);
  --hero-gradient: linear-gradient(145deg, #ffe6f0, #ffd9e8, #fff0f5);
  --footer-bg: #2f2226;
  --footer-text: #eadcdc;
  --footer-link: #f0d5d5;
  --code-bg: #fdf0f3;
  --transition: 0.3s ease;
  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 32px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

[data-theme="dark"] {
  --bg: #1f1a1a;
  --bg-gradient: linear-gradient(145deg, #2a2222, #1f1a1a);
  --text: #f0e0e0;
  --text-light: #b0a0a0;
  --card: rgba(43, 35, 35, 0.85);
  --card-solid: #2b2323;
  --accent: #e89bb0;
  --accent-dark: #ffb0c4;
  --accent-light: #4a3a3a;
  --border: #4a3a3a;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(30, 24, 24, 0.7);
  --glass-border: rgba(80, 60, 60, 0.6);
  --hero-gradient: linear-gradient(145deg, #3a2a2a, #2f2226, #3a2530);
  --footer-bg: #151010;
  --footer-text: #c0b0b0;
  --footer-link: #d0b0b0;
  --code-bg: #3a2a2a;
}

/* ---------- Reset & 基础 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

section {
  margin: 3rem 0;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
  border: 2px solid var(--bg);
}

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

::selection {
  background: var(--accent);
  color: white;
}

/* ---------- Header / 导航 ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
  transition: background 0.4s ease, border-color 0.4s ease;
}

[data-theme="dark"] header {
  background: rgba(31, 26, 26, 0.8);
  border-bottom-color: rgba(80, 60, 60, 0.4);
}

.nav-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent-dark);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.03);
}

.logo svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 30px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--accent-dark);
  background: var(--accent-light);
  transform: translateY(-2px);
}

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

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

.search-box {
  display: flex;
  gap: 6px;
  align-items: center;
}

.search-box input {
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--card-solid);
  font-size: 0.9rem;
  width: 160px;
  transition: all 0.3s ease;
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 155, 176, 0.2);
  width: 200px;
}

.search-box input::placeholder {
  color: var(--text-light);
}

.btn {
  padding: 8px 16px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 155, 176, 0.4);
}

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

#darkModeToggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
}

#darkModeToggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  box-shadow: none;
}

/* ---------- Hero / Banner ---------- */
.hero {
  background: var(--hero-gradient);
  padding: 4rem 0 3rem;
  text-align: center;
  border-radius: 0 0 60px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232, 155, 176, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

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

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
  color: #a14a62;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .hero h1 {
  color: #ffb0c4;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 700px;
  margin: 0 auto 2rem;
  color: var(--text-light);
  line-height: 1.8;
}

.banner-slider {
  overflow: hidden;
  border-radius: 30px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(161, 74, 98, 0.15);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.slides {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
  min-width: 100%;
  padding: 2.5rem 2rem;
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

[data-theme="dark"] .slide {
  background: rgba(43, 35, 35, 0.5);
}

.slide h3 {
  font-size: 1.5rem;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
}

.slide p {
  color: var(--text-light);
  margin: 0;
}

/* ---------- Section 标题 ---------- */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 2.5rem 0 1.5rem;
  border-left: 8px solid var(--accent);
  padding-left: 1.2rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  transition: all 0.3s ease;
}

.section-title:hover {
  border-left-color: var(--accent-dark);
  transform: translateX(4px);
}

/* ---------- 网格布局 ---------- */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 2rem;
  margin: 2.5rem 0;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

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

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

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

.card h3, .card h4 {
  margin-bottom: 0.8rem;
  color: var(--text);
  font-weight: 600;
}

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

.card h4 {
  font-size: 1.05rem;
  color: var(--accent-dark);
}

.card p {
  color: var(--text-light);
  margin-bottom: 0.8rem;
  line-height: 1.7;
}

.card svg {
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  transition: transform 0.4s ease;
}

.card:hover svg {
  transform: scale(1.02);
}

.card span {
  display: block;
  font-style: italic;
  color: var(--accent-dark);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.card a {
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.5rem;
  transition: gap 0.3s ease;
}

.card a:hover {
  gap: 8px;
  color: var(--accent-dark);
}

/* 产品卡片特殊样式 */
.card[style*="margin-top"] {
  margin-top: 1.5rem;
}

/* ---------- 产品优势 ---------- */
.card p:has(✅) {
  background: var(--code-bg);
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

/* ---------- 新闻文章 ---------- */
article.card {
  padding: 1.5rem 1.8rem;
  transition: all 0.4s ease;
}

article.card:hover {
  transform: translateX(8px);
}

article.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

article.card time {
  color: var(--accent);
  font-weight: 500;
  margin-right: 0.8rem;
  font-size: 0.85rem;
}

/* ---------- FAQ ---------- */
details.card {
  padding: 1.2rem 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

details.card:hover {
  border-color: var(--accent);
}

details.card summary {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

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

details.card summary::before {
  content: '❓';
  margin-right: 8px;
}

details.card summary::after {
  content: '＋';
  position: absolute;
  right: 0;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.3s ease;
}

details.card[open] summary::after {
  transform: rotate(45deg);
}

details.card p {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-light);
}

/* ---------- HowTo 教程 ---------- */
.card ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
  color: var(--text-light);
}

.card ol li {
  margin-bottom: 0.5rem;
  position: relative;
}

.card ol li::marker {
  color: var(--accent);
  font-weight: 700;
}

.card h4 {
  margin-top: 1rem;
}

/* ---------- 联系我们 ---------- */
#contact .card p {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#contact .card p strong {
  color: var(--accent-dark);
  min-width: 80px;
}

/* ---------- Footer ---------- */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0;
  margin-top: 4rem;
  border-radius: 40px 40px 0 0;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent, var(--accent));
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-grid h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: white;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-grid h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
}

.footer-grid a {
  color: var(--footer-link);
  text-decoration: none;
  display: block;
  margin: 6px 0;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.footer-grid a:hover {
  color: var(--accent);
  transform: translateX(4px);
}

.footer-grid p {
  font-size: 0.9rem;
  margin: 6px 0;
  color: var(--footer-text);
}

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

footer .container:last-child p {
  margin: 4px 0;
  color: var(--footer-text);
}

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  z-index: 999;
  box-shadow: 0 8px 30px rgba(232, 155, 176, 0.4);
  transition: all 0.3s ease;
  animation: fadeInUp 0.3s ease;
}

.back-to-top:hover {
  background: var(--accent-dark);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(232, 155, 176, 0.5);
}

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

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

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

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .nav-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav-links {
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 4px 8px;
  }

  .search-box {
    justify-content: center;
    width: 100%;
  }

  .search-box input {
    flex: 1;
    max-width: 300px;
  }

  #darkModeToggle {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .hero {
    padding: 3rem 0 2rem;
    border-radius: 0 0 40px 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .card {
    padding: 1.2rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

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

  .logo {
    font-size: 1.3rem;
  }

  .nav-links {
    gap: 5px;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 4px 6px;
  }

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

  .hero p {
    font-size: 0.95rem;
  }

  .slide {
    padding: 1.5rem 1rem;
  }

  .slide h3 {
    font-size: 1.2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-grid h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-grid a {
    margin: 4px auto;
  }

  .back-to-top {
    bottom: 15px;
    right: 15px;
  }
}

/* ---------- 打印样式 ---------- */
@media print {
  header, footer, .back-to-top, .search-box, #darkModeToggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

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

/* ---------- 无障碍 & 性能优化 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
  :root {
    --text: #000;
    --text-light: #333;
    --border: #000;
    --accent: #d4728f;
    --accent-dark: #a14a62;
  }
}

/* 确保SVG图标可访问 */
svg {
  focusable: "false";
}

/* 焦点可见性 */
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* 暗色模式下的特殊调整 */
[data-theme="dark"] .hero {
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .card {
  border-color: rgba(80, 60, 60, 0.5);
}

[data-theme="dark"] .card:hover {
  border-color: var(--accent);
}

[data-theme="dark"] details.card summary::after {
  color: var(--accent);
}

[data-theme="dark"] .footer-grid a:hover {
  color: var(--accent);
}

/* 加载动画占位（用于未来图片懒加载） */
.lazy-loading {
  background: linear-gradient(90deg, var(--accent-light), var(--border), var(--accent-light));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* 确保所有交互元素有足够的触控区域 */
@media (pointer: coarse) {
  .nav-links a, .btn, .back-to-top, details.card summary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* 微交互 - 卡片内链接箭头 */
.card a::after {
  content: '→';
  transition: transform 0.3s ease;
}

.card a:hover::after {
  transform: translateX(4px);
}

/* 品牌故事卡片特殊样式 */
#about .card:first-child {
  background: linear-gradient(145deg, var(--card), var(--accent-light));
}

[data-theme="dark"] #about .card:first-child {
  background: linear-gradient(145deg, var(--card), #3a2a2a);
}

/* 解决方案卡片图标 */
#solutions .card {
  position: relative;
  padding-left: 2rem;
}

#solutions .card::after {
  content: '🧩';
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  opacity: 0.2;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#solutions .card:hover::after {
  opacity: 0.4;
  transform: rotate(15deg);
}

/* 案例卡片评价样式 */
#cases .card span {
  font-style: italic;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.85rem;
}

/* 联系信息卡片图标 */
#contact .card p:nth-child(1)::before { content: '📍'; margin-right: 8px; }
#contact .card p:nth-child(2)::before { content: '📞'; margin-right: 8px; }
#contact .card p:nth-child(3)::before { content: '✉️'; margin-right: 8px; }
#contact .card p:nth-child(4)::before { content: '🕘'; margin-right: 8px; }

/* 新闻中心时间线装饰 */
#news article.card {
  border-left: 4px solid transparent;
}

#news article.card:hover {
  border-left-color: var(--accent);
}

/* FAQ 展开动画 */
details.card {
  transition: all 0.3s ease;
}

details.card[open] {
  background: var(--card-solid);
  border-color: var(--accent);
}

/* 响应式微调 */
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 {
    gap: 1.2rem;
  }

  .card {
    padding: 1rem;
    border-radius: 18px;
  }

  .section-title {
    font-size: 1.3rem;
    padding-left: 0.8rem;
    border-left-width: 5px;
  }
}

/* 深色模式滚动条 */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1f1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #4a3a3a;
  border-color: #1f1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* 结束 */
/* 萌喵漫画 - 软萌治愈系完整样式表 */