/* ===== 开云 Kaiyun 官网样式表 ===== */
/* 版本: 1.0 | 作者: 开云设计团队 */

/* ===== CSS变量 / 主题 ===== */
:root {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --primary-dark: #0f2640;
  --accent: #f0a500;
  --accent-light: #ffc34d;
  --bg: #f5f9fc;
  --bg-card: rgba(255,255,255,0.75);
  --text: #1a1a2e;
  --text-light: #4a4a6a;
  --glass: rgba(255,255,255,0.25);
  --shadow: 0 8px 32px rgba(0,0,0,0.08);
  --radius: 20px;
  --transition: 0.3s ease;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-height: 70px;
  --section-padding: 80px 0;
  --container-max: 1200px;
  --container-padding: 0 24px;
  --gradient-hero: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  --gradient-logo: linear-gradient(135deg, var(--primary), var(--accent));
}

/* ===== 暗色模式 ===== */
[data-theme="dark"] {
  --bg: #0d1b2a;
  --bg-card: rgba(30,40,60,0.8);
  --text: #e0e0f0;
  --text-light: #a0a0c0;
  --glass: rgba(30,40,60,0.5);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --gradient-hero: linear-gradient(135deg, #07111f 0%, #0f2640 50%, #1a3a5c 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--accent);
}

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

ul {
  list-style: none;
}

/* ===== 容器 ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--container-padding);
}

/* ===== 毛玻璃通用 ===== */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.2);
}

/* ===== 头部导航 ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: background var(--transition);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-logo);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

nav ul {
  display: flex;
  gap: 28px;
}

nav a {
  font-weight: 500;
  color: var(--text);
  position: relative;
  padding: 4px 0;
  font-size: 0.95rem;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* 汉堡菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--text);
  border-radius: 4px;
  transition: var(--transition);
}

/* 移动导航 */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 999;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav a {
  display: block;
  padding: 8px 0;
  font-weight: 500;
  color: var(--text);
  font-size: 1.1rem;
}

/* 主题切换按钮 */
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background var(--transition);
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--glass);
}

/* ===== Hero 区域 ===== */
.hero {
  padding-top: 120px;
  padding-bottom: 80px;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

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

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  color: #fff;
  max-width: 700px;
  line-height: 1.2;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin-bottom: 30px;
  line-height: 1.6;
}

.hero .btn {
  display: inline-block;
  background: var(--accent);
  color: #1a1a2e;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(240,165,0,0.3);
  border: none;
  cursor: pointer;
}

.hero .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(240,165,0,0.5);
}

/* Banner 轮播容器 */
.hero-banner-swiper {
  position: relative;
  margin-top: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  padding: 20px;
}

.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #fff;
  flex-direction: column;
  text-align: center;
}

.swiper-slide svg {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

.swiper-slide h3 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  font-weight: 700;
}

.swiper-slide p {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  max-width: 400px;
}

.swiper-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.swiper-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background var(--transition);
}

.swiper-dots span.active {
  background: var(--accent);
}

/* ===== 通用 Section ===== */
section {
  padding: var(--section-padding);
  transition: background var(--transition);
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.section-title p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

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

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.card svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--accent);
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text);
}

.card h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--text);
}

.card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== 统计数字 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  text-align: center;
}

.stat-item {
  padding: 24px;
}

.stat-item .num {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-item p {
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== 文章卡片 ===== */
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.article-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform var(--transition), box-shadow var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.article-card .date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.article-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.article-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.article-card .readmore {
  font-weight: 600;
  color: var(--accent);
  transition: color var(--transition);
}

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

/* ===== FAQ ===== */
.faq-item {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  margin-bottom: 12px;
  padding: 0 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.faq-item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.faq-question {
  padding: 18px 0;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  user-select: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  transition: transform var(--transition);
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .faq-question::after {
  content: '−';
  transform: rotate(0deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  padding: 0;
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding: 0 0 20px;
}

/* ===== HowTo 步骤 ===== */
.howto-steps {
  counter-reset: step;
}

.howto-step {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform var(--transition), box-shadow var(--transition);
}

.howto-step:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.howto-step::before {
  counter-increment: step;
  content: "步骤 " counter(step);
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.howto-step p {
  color: var(--text-light);
  line-height: 1.7;
}

.howto-step strong {
  color: var(--text);
}

/* ===== 页脚 ===== */
footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 30px;
}

footer a {
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
}

footer a:hover {
  color: var(--accent);
}

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

.footer-col h4 {
  color: #fff;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul a {
  font-size: 0.9rem;
}

.footer-qr {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 20px 0;
}

.footer-qr svg {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

.footer-bottom p {
  line-height: 1.6;
}

/* ===== 回到顶部 ===== */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1a2e;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#backToTop.visible {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

/* ===== 搜索框 ===== */
.search-box {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.search-box input {
  flex: 1;
  padding: 12px 20px;
  border-radius: 40px;
  border: 1px solid rgba(255,255,255,0.2);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240,165,0,0.2);
}

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

.search-box button {
  padding: 12px 24px;
  border-radius: 40px;
  border: none;
  background: var(--accent);
  color: #1a1a2e;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-size: 0.95rem;
}

.search-box button:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

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

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式设计 ===== */

/* 平板及以下 */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.6rem;
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* 手机端 */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  nav ul {
    display: none;
  }
  
  .hero {
    padding-top: 100px;
    padding-bottom: 40px;
  }
  
  .hero h1 {
    font-size: 2rem;
    max-width: 100%;
  }
  
  .hero p {
    font-size: 1rem;
    max-width: 100%;
  }
  
  .hero .btn {
    padding: 12px 28px;
    font-size: 1rem;
  }
  
  .section-title {
    margin-bottom: 32px;
  }
  
  .section-title h2 {
    font-size: 1.8rem;
  }
  
  .section-title p {
    font-size: 0.95rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .article-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .stat-item .num {
    font-size: 2.2rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .footer-qr {
    justify-content: flex-start;
  }
  
  .swiper-slide {
    padding: 40px 16px;
  }
  
  .swiper-slide h3 {
    font-size: 1.3rem;
  }
  
  section {
    padding: 60px 0;
  }
  
  .mobile-nav a {
    font-size: 1rem;
  }
  
  #backToTop {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }
}

/* 小手机 */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }
  
  .hero p {
    font-size: 0.9rem;
  }
  
  .section-title h2 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 20px 16px;
  }
  
  .card h3 {
    font-size: 1.1rem;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .stat-item {
    padding: 16px;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .search-box button {
    width: 100%;
  }
}

/* ===== 暗色模式兼容 ===== */
[data-theme="dark"] .card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .howto-step {
  border-color: rgba(255,255,255,0.05);
}

[data-theme="dark"] .hero .btn {
  box-shadow: 0 4px 20px rgba(240,165,0,0.2);
}

[data-theme="dark"] .hero .btn:hover {
  box-shadow: 0 8px 30px rgba(240,165,0,0.4);
}

[data-theme="dark"] header {
  border-bottom-color: rgba(255,255,255,0.05);
}

/* ===== 辅助类 ===== */
.text-center {
  text-align: center;
}

.mt-24 {
  margin-top: 24px;
}

.mt-40 {
  margin-top: 40px;
}

.mt-48 {
  margin-top: 48px;
}

/* ===== 打印样式 ===== */
@media print {
  header, footer, #backToTop, .menu-toggle, .theme-toggle, .mobile-nav {
    display: none !important;
  }
  
  body {
    background: #fff;
    color: #000;
  }
  
  .hero {
    background: #f0f4f8 !important;
    padding-top: 40px;
  }
  
  .hero h1 {
    color: #1a3a5c;
  }
  
  .hero p {
    color: #444;
  }
  
  .card, .article-card, .faq-item, .howto-step {
    background: #fafafa !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  
  .fade-up {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== 动画性能优化 ===== */
@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;
  }
  
  .fade-up {
    opacity: 1 !important;
    transform: none !important;
  }
}