/* === CSS Custom Properties (Theme) === */
:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #888888;
  --border: #e5e5e5;
  --accent: #4a90d9;
  --accent-hover: #3a7bc8;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-title: 'DeYiHei', '得意黑', sans-serif;
  --font-heading: 'SimHei', '黑体', sans-serif;
  --font-body: 'SimSun', '宋体', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a2e;
    --card-bg: rgba(255,255,255,0.05);
    --text: #e0e0e0;
    --text-secondary: #888888;
    --border: rgba(255,255,255,0.08);
    --accent: #5ba0e8;
    --accent-hover: #7db8f0;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  }
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #888888;
  --border: #e5e5e5;
  --accent: #4a90d9;
  --accent-hover: #3a7bc8;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --card-bg: rgba(255,255,255,0.05);
  --text: #e0e0e0;
  --text-secondary: #888888;
  --border: rgba(255,255,255,0.08);
  --accent: #5ba0e8;
  --accent-hover: #7db8f0;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* === 全局重置 === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
  transition: background var(--transition), color var(--transition);
}

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

/* === 字体声明 === */
@font-face {
  font-family: 'DeYiHei';
  src: url('https://cdn.jsdelivr.net/npm/deyihei@1.0.0/DeYiHei.woff2') format('woff2');
  font-display: swap;
}

/* === 主题切换按钮 === */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all var(--transition);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.theme-toggle:hover { transform: scale(1.1); box-shadow: var(--shadow-lg); }

/* === 全屏 Snap 滚动 === */
.snap-container {
  height: 100vh; width: 100vw;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
.snap-section {
  scroll-snap-align: start;
  height: 100vh; width: 100vw;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* === 导航指示器 === */
.nav-dots {
  position: fixed; right: 16px; top: 50%;
  transform: translateY(-50%); z-index: 999;
  display: flex; flex-direction: column; gap: 10px;
}
.nav-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-secondary); opacity: 0.4;
  cursor: pointer; transition: all 0.3s ease;
  border: 2px solid transparent;
}
.nav-dot.active { opacity: 1; background: var(--accent); transform: scale(1.3); }

/* === 第一屏：标题区 === */
.hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  justify-content: flex-start; padding-top: 10vh;
  transition: background 0.5s ease;
}
[data-theme="light"] .hero-section {
  background: linear-gradient(135deg, #4a6cf7 0%, #667eea 50%, #764ba2 100%);
}
.hero-section .logo-watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.10; width: 280px; height: auto;
  pointer-events: none; user-select: none;
}
.hero-section .site-title {
  font-family: var(--font-title);
  font-size: clamp(28px, 5vw, 48px);
  color: #ffffff; letter-spacing: 2px;
  text-align: center; z-index: 1;
  animation: fadeInUp 1s ease forwards;
}
.hero-section .site-subtitle {
  font-size: 14px; color: rgba(255,255,255,0.45);
  margin-bottom: 48px; z-index: 1;
  animation: fadeInUp 1s ease 0.2s forwards;
  opacity: 0; animation-fill-mode: forwards;
}
.hero-section .announcement-box {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 500px; width: 90%; margin: 0 auto; z-index: 1;
  animation: fadeInUp 1s ease 0.4s forwards;
  opacity: 0; animation-fill-mode: forwards;
}
.hero-section .announcement-label {
  font-size: 11px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 3px;
  margin-bottom: 10px; font-family: var(--font-heading);
}
.hero-section .announcement-text {
  font-size: 14px; color: #d0d0d0;
  line-height: 1.8; font-family: var(--font-heading);
  white-space: pre-wrap; word-break: break-word;
}
.hero-section .scroll-hint {
  position: absolute; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.3); font-size: 28px; z-index: 1;
  animation: bounce 2s ease infinite;
}
.hero-section .scroll-hint-text {
  display: block; font-size: 10px; text-align: center;
  color: rgba(255,255,255,0.2); margin-top: 4px;
  font-family: var(--font-body);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

/* === 第二屏：文档列表 === */
.docs-section { background: var(--bg); padding: 60px 24px; justify-content: flex-start; }
.section-title {
  font-family: var(--font-title);
  font-size: clamp(22px, 4vw, 32px);
  text-align: center; margin-bottom: 32px; color: var(--text);
}
.doc-list { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 560px; }
.doc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition); text-decoration: none;
  color: var(--text); box-shadow: var(--shadow);
}
.doc-card:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.doc-card .doc-icon {
  font-size: 24px; flex-shrink: 0; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74,144,217,0.1); border-radius: var(--radius-sm); color: var(--accent);
}
.doc-card .doc-info { flex: 1; min-width: 0; }
.doc-card .doc-name {
  font-family: var(--font-heading); font-size: 15px; font-weight: bold;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-card .doc-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.doc-card .doc-arrow { color: var(--text-secondary); font-size: 16px; transition: transform 0.3s; }
.doc-card:hover .doc-arrow { transform: translateX(4px); color: var(--accent); }

/* === 第三屏：新闻 === */
.news-section { background: var(--bg); padding: 60px 24px 20px; justify-content: flex-start; }
.news-list { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 600px; }
.news-card {
  display: flex; gap: 12px;
  background: var(--card-bg); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.news-card:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); }
.news-card .news-img { width: 100px; height: 80px; flex-shrink: 0; object-fit: cover; background: var(--border); }
.news-card .news-info { padding: 10px 10px 10px 0; display: flex; flex-direction: column; justify-content: center; }
.news-card .news-title {
  font-family: var(--font-heading); font-size: 14px; font-weight: bold; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card .news-date { font-size: 10px; color: var(--text-secondary); }
.news-more { text-align: center; padding: 14px 0 6px; font-size: 13px; }
.mobile-hint { display: none; }
@media (max-width: 768px) {
  .mobile-hint { display: block; text-align: center; font-size: 11px; color: var(--text-secondary); padding-bottom: 8px; }
}

/* === 页脚 === */
.site-footer {
  text-align: center; padding: 16px 20px 8px;
  border-top: 1px solid var(--border); margin-top: auto; width: 100%;
}
.site-footer p { font-size: 10px; color: var(--text-secondary); margin: 0 0 4px; }

/* === 通用按钮 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-heading); font-size: 14px; font-weight: bold;
  border: none; cursor: pointer; transition: all 0.2s ease; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* === 弹窗 === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 24px; width: 90%; max-width: 500px; max-height: 80vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s ease;
}
.modal-title {
  font-family: var(--font-heading); font-size: 16px; margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-close {
  cursor: pointer; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: none; background: transparent;
  font-size: 18px; color: var(--text-secondary); transition: all 0.2s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* === 响应式 === */
@media (max-width: 768px) {
  html { font-size: 14px; }
  .hero-section { padding-top: 6vh; }
  .hero-section .logo-watermark { width: 180px; }
  .hero-section .site-title { font-size: clamp(22px, 7vw, 32px); }
  .hero-section .site-subtitle { font-size: 12px; margin-bottom: 32px; }
  .hero-section .announcement-box { padding: 16px 18px; width: 92%; }
  .hero-section .announcement-text { font-size: 13px; }
  .hero-section .scroll-hint { bottom: 20px; font-size: 22px; }

  .doc-list, .news-list { max-width: 100%; }
  .doc-card { padding: 14px 16px; }
  .doc-card .doc-name { font-size: 13px; }
  .doc-card .doc-icon { width: 34px; height: 34px; font-size: 20px; }
  .news-card .news-img { width: 72px; height: 60px; }
  .news-card .news-title { font-size: 12px; }

  .section-title { font-size: clamp(18px, 5vw, 26px); margin-bottom: 20px; }

  .nav-dots { right: 8px; gap: 8px; }
  .nav-dot { width: 8px; height: 8px; }

  .theme-toggle { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 16px; }

  .modal { width: 95%; padding: 18px; }

  .stats-grid { grid-template-columns: 1fr; }
  .dashboard-content { padding: 12px; }
  .tabs { flex-wrap: wrap; }
  .tab-btn { padding: 6px 14px; font-size: 12px; }

  .login-card { padding: 28px 20px; }
  .login-title { font-size: 18px; }

  .detail-hero { height: 20vh; min-height: 110px; }
  .detail-body { padding: 16px; }
  .detail-title { font-size: 19px; }
  .detail-nav { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .hero-section .site-title { font-size: 20px; }
  .hero-section { padding-top: 5vh; }
  .hero-section .announcement-box { width: 95%; padding: 14px; }
  .doc-card { padding: 12px; gap: 8px; }
  .content-item { flex-direction: column; gap: 8px; align-items: flex-start; }
  .content-item-actions { align-self: flex-end; }
}
