/* ========== 全局颜色规范 —— 高可读性优先 ========== */
:root {
  --bg-light: #f8fafc;
  --bg-deep: #0B1220;
  --text-primary: #1F2937;
  --text-secondary: #243447;
  --text-accent: #1E3A8A;
  --text-on-dark: #F1F5F9;
  --text-dark-title: #FFFFFF;
  --border-light: #CBD5E1;
  --card-bg: #ffffff;
  --nav-bg: #ffffffcc;
  --btn-bg: #1E3A8A;
  --btn-text: #ffffff;
  --footer-bg: #16213e;
  --footer-text: #E2E8F0;
  --hover-bg: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --radius: 16px;
  --max-width: 1280px;
  --transition: 0.25s ease;
  --gradient-primary: linear-gradient(135deg, #1E3A8A, #2563EB);
  --gradient-banner: linear-gradient(145deg, #1e293b, #1e3a8a);
  --gradient-accent: linear-gradient(135deg, #f59e0b, #fbbf24);
  --glass-bg: rgba(255,255,255,0.6);
  --glass-border: rgba(255,255,255,0.3);
  --scrollbar-thumb: #1E3A8A;
  --scrollbar-track: #f1f5f9;
}

[data-theme="dark"] {
  --bg-light: #0B1220;
  --bg-deep: #0B1220;
  --text-primary: #E2E8F0;
  --text-secondary: #CBD5E1;
  --text-accent: #93C5FD;
  --text-on-dark: #F1F5F9;
  --text-dark-title: #FFFFFF;
  --border-light: #334155;
  --card-bg: #1E293B;
  --nav-bg: rgba(15, 23, 42, 0.85);
  --btn-bg: #3B82F6;
  --btn-text: #0B1220;
  --footer-bg: #020617;
  --footer-text: #CBD5E1;
  --hover-bg: #1e293b;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
  --gradient-primary: linear-gradient(135deg, #3B82F6, #60A5FA);
  --gradient-banner: linear-gradient(145deg, #0f172a, #1e3a8a);
  --gradient-accent: linear-gradient(135deg, #f59e0b, #fbbf24);
  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255,255,255,0.08);
  --scrollbar-thumb: #3B82F6;
  --scrollbar-track: #0f172a;
}

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s, color 0.3s;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

a:hover {
  text-decoration: underline;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== 自定义滚动条 ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

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

/* ========== 导航吸顶 + 毛玻璃 ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  transition: background 0.3s, box-shadow 0.3s;
}

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

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.logo-area::before {
  content: '';
  position: absolute;
  inset: -6px -12px;
  background: var(--gradient-primary);
  opacity: 0.08;
  border-radius: 12px;
  filter: blur(8px);
  pointer-events: none;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 4px;
  letter-spacing: -0.02em;
  position: relative;
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(37, 99, 235, 0.3)); }
  50% { filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.5)); }
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-primary);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
  position: relative;
}

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

.nav-links a:hover {
  border-color: transparent;
  color: var(--text-accent);
  transform: translateY(-1px);
  text-decoration: none;
}

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

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

/* ========== 搜索框 ========== */
.search-box {
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  padding: 4px 8px 4px 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
  border-color: var(--text-accent);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.search-box input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  width: 180px;
  font-size: 0.9rem;
}

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

.search-box button {
  background: var(--gradient-primary);
  border: none;
  color: var(--btn-text);
  padding: 6px 14px;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.search-box button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 30px;
  padding: 6px 12px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.theme-toggle:hover {
  transform: rotate(15deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s;
}

.hamburger:hover {
  transform: scale(1.1);
}

/* ========== Banner 渐变 + 动画 ========== */
.banner {
  background: var(--gradient-banner);
  color: white;
  border-radius: var(--radius);
  padding: 48px 36px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  box-shadow: 0 8px 32px rgba(30, 58, 138, 0.25);
  position: relative;
  overflow: hidden;
  animation: bannerFloat 6s ease-in-out infinite;
}

@keyframes bannerFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.2), transparent 60%);
  border-radius: 50%;
  animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.banner h1 {
  font-size: 2.8rem;
  margin-bottom: 12px;
  color: var(--text-dark-title);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
  animation: slideIn 0.6s ease-out;
}

.banner p {
  font-size: 1.3rem;
  color: var(--text-on-dark);
  max-width: 600px;
  position: relative;
  z-index: 1;
  animation: slideIn 0.8s ease-out;
}

.banner .cta {
  background: var(--gradient-accent);
  color: #1f2937;
  border: none;
  padding: 14px 32px;
  border-radius: 60px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  z-index: 1;
  animation: slideIn 1s ease-out;
}

.banner .cta:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.5);
}

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

/* ========== 区块标题 ========== */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 40px 0 24px;
  color: var(--text-primary);
  border-left: 8px solid transparent;
  border-image: var(--gradient-primary) 1;
  padding-left: 16px;
  position: relative;
  animation: fadeInUp 0.6s ease-out;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 16px;
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

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

/* ========== 卡片网格 ========== */
.grid-articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
  border-color: var(--text-accent);
}

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

.article-card h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.article-card:hover h3 {
  color: var(--text-accent);
}

.article-card .meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

.article-card p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.read-more {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.read-more:hover {
  gap: 8px;
}

/* ========== FAQ 手风琴 ========== */
.faq-item {
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: fadeInUp 0.5s ease-out;
}

.faq-item:hover,
.faq-item.active {
  border-color: var(--text-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.faq-question {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 1.1rem;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--hover-bg);
}

.faq-question span {
  font-size: 1.4rem;
  color: var(--text-accent);
  transition: transform 0.3s;
  display: inline-block;
}

.faq-item.active .faq-question span {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--text-secondary);
  display: none;
  border-top: 1px dashed var(--border-light);
  animation: fadeIn 0.3s ease-out;
}

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

.faq-item.active .faq-answer {
  display: block;
  padding-top: 16px;
}

/* ========== HowTo 教程框 ========== */
.howto-box {
  background: var(--card-bg);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin: 32px 0;
  transition: box-shadow 0.3s;
  animation: fadeInUp 0.6s ease-out;
}

.howto-box:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.howto-box ol {
  padding-left: 24px;
  color: var(--text-primary);
}

.howto-box li {
  margin-bottom: 12px;
  transition: transform 0.2s, color 0.2s;
}

.howto-box li:hover {
  transform: translateX(4px);
  color: var(--text-accent);
}

.howto-box li strong {
  color: var(--text-accent);
}

/* ========== 企业信息区块 ========== */
.howto-box + section {
  background: var(--card-bg);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin: 32px 0;
  transition: box-shadow 0.3s;
  animation: fadeInUp 0.6s ease-out;
}

.howto-box + section:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.howto-box + section h3 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 8px;
  display: inline-block;
}

.howto-box + section p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ========== 页脚 ========== */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 48px 20px 24px;
  margin-top: 60px;
  border-radius: 24px 24px 0 0;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

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

.footer a {
  color: var(--footer-text);
  opacity: 0.9;
  transition: opacity 0.2s, transform 0.2s, color 0.2s;
  display: inline-block;
  margin-bottom: 4px;
}

.footer a:hover {
  color: #ffffff;
  opacity: 1;
  transform: translateX(4px);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid #334155;
  margin-top: 32px;
  padding-top: 24px;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.9;
}

/* ========== 返回顶部按钮 ========== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--gradient-primary);
  color: var(--btn-text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  border: none;
  z-index: 99;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeInUp 0.4s ease-out;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
}

/* ========== 移动端菜单 ========== */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--card-bg);
  padding: 16px;
  gap: 8px;
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: 1px solid var(--border-light);
  animation: slideDown 0.3s ease-out;
}

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

.mobile-menu.show {
  display: flex;
}

.mobile-menu a {
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-primary);
  transition: background 0.2s, color 0.2s;
}

.mobile-menu a:hover {
  background: var(--hover-bg);
  color: var(--text-accent);
  text-decoration: none;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
  .banner h1 {
    font-size: 2.4rem;
  }
  .banner p {
    font-size: 1.1rem;
  }
  .search-box input {
    width: 140px;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .actions .search-box {
    display: none;
  }
  
  .hamburger {
    display: block;
  }
  
  .mobile-menu {
    display: none;
  }
  
  .mobile-menu.show {
    display: flex;
  }
  
  .banner {
    padding: 32px 24px;
    text-align: center;
    justify-content: center;
  }
  
  .banner h1 {
    font-size: 2rem;
  }
  
  .banner p {
    font-size: 1rem;
    margin: 0 auto;
  }
  
  .banner .cta {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .grid-articles {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  
  .article-card {
    padding: 18px;
  }
  
  .article-card h3 {
    font-size: 1.1rem;
  }
  
  .howto-box,
  .howto-box + section {
    padding: 20px;
  }
  
  .footer {
    padding: 32px 16px 16px;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .logo-text {
    font-size: 1.5rem;
  }
  
  .banner {
    padding: 24px 16px;
    margin: 20px 0;
  }
  
  .banner h1 {
    font-size: 1.6rem;
  }
  
  .banner p {
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.3rem;
    margin: 28px 0 16px;
  }
  
  .grid-articles {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .article-card {
    padding: 16px;
  }
  
  .faq-question {
    font-size: 0.95rem;
    padding: 14px 16px;
  }
  
  .faq-answer {
    padding: 0 16px 16px;
    font-size: 0.9rem;
  }
  
  .howto-box ol {
    padding-left: 16px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  
  .footer h4 {
    font-size: 1rem;
  }
}

/* ========== 滚动条美化 ========== */
@media (min-width: 769px) {
  ::-webkit-scrollbar {
    width: 10px;
  }
  
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--text-accent), var(--btn-bg));
    border-radius: 5px;
    border: 2px solid var(--bg-light);
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--btn-bg), var(--text-accent));
  }
  
  ::-webkit-scrollbar-track {
    background: transparent;
  }
}

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

.card a,
.read-more {
  color: var(--text-accent);
  position: relative;
}

.read-more::after {
  content: '→';
  transition: transform 0.2s;
  display: inline-block;
}

.read-more:hover::after {
  transform: translateX(4px);
}

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

.faq-answer {
  color: var(--text-secondary);
}

.footer a,
.footer p {
  color: var(--footer-text);
}

.section-sub {
  color: var(--text-secondary);
}

.stat-number {
  color: var(--text-primary);
  font-weight: 800;
}

/* ========== 无障碍辅助 ========== */
@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;
  }
}

::selection {
  background: var(--text-accent);
  color: #ffffff;
}

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

/* ========== 企业信息区块样式修正 ========== */
section[style*="flex"] {
  background: var(--card-bg);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin: 40px 0;
  transition: box-shadow 0.3s, transform 0.3s;
  animation: fadeInUp 0.6s ease-out;
}

section[style*="flex"]:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

section[style*="flex"] h3 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 8px;
  display: inline-block;
  transition: border-color 0.2s;
}

section[style*="flex"] h3:hover {
  border-color: var(--text-accent);
}

section[style*="flex"] p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ========== 响应式修正 ========== */
@media (max-width: 768px) {
  section[style*="flex"] {
    padding: 24px;
    gap: 24px;
    flex-direction: column;
  }
  
  section[style*="flex"] > div {
    width: 100% !important;
  }
}

/* ========== Banner 移动端优化 ========== */
@media (max-width: 480px) {
  .banner::before {
    width: 200px;
    height: 200px;
    top: -30%;
    right: -30%;
  }
}

/* ========== 高对比度模式支持 ========== */
@media (prefers-contrast: high) {
  :root {
    --border-light: #000;
    --shadow: none;
  }
  
  [data-theme="dark"] {
    --border-light: #fff;
  }
  
  .article-card,
  .faq-item,
  .howto-box {
    border-width: 2px;
  }
}