/* ============================================================
   main.css —— 主样式文件
   ============================================================ */

/* ---- 1. CSS 变量（设计品牌） ---- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --accent:        #B8960C;
  --accent-light:  #D4AF37;
  --accent-dark:   #8B6914;
  --accent-subtle: rgba(184, 150, 12, 0.12);

  --bg-primary:    #FAFAF8;
  --bg-secondary:  #F2F2EF;
  --bg-tertiary:   #E8E8E4;
  --bg-card:       #FFFFFF;
  --bg-overlay:    rgba(250, 250, 248, 0.92);

  --text-primary:   #1A1A1A;
  --text-secondary: #555550;
  --text-tertiary:  #8A8A85;
  --text-inverse:   #FFFFFF;

  --border-light:  rgba(0, 0, 0, 0.07);
  --border-medium: rgba(0, 0, 0, 0.12);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.14), 0 8px 24px rgba(0,0,0,0.08);

  --header-height:    56px;
  --sidebar-width:    280px;
  --card-min-width:   300px;
  --card-max-width:   380px;
  --content-max-width: 720px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 999px;

  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:    cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:  150ms;
  --duration-base:  250ms;
  --duration-slow:  400ms;
  --duration-page:  500ms;
}

[data-theme="dark"] {
  --bg-primary:    #111110;
  --bg-secondary:  #1A1A18;
  --bg-tertiary:   #242422;
  --bg-card:       #1E1E1C;
  --bg-overlay:    rgba(17, 17, 16, 0.94);

  --text-primary:   #F0F0EC;
  --text-secondary: #A8A8A0;
  --text-tertiary:  #666660;
  --text-inverse:   #111110;

  --border-light:  rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);

  --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 12px 40px rgba(0,0,0,0.5);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.6);
}

/* ---- 2. 重置与基础 ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  transition: background var(--duration-base) var(--ease-in-out),
              color var(--duration-base) var(--ease-in-out);
}

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

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a { color: var(--accent); text-decoration: none; }
ul, ol { list-style: none; }

/* ---- 3. 应用容器 ---- */
.app-container { min-height: 100vh; position: relative; }

/* ---- 4. 顶部导航栏 ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transform: translateY(-100%);
  transition: transform var(--duration-slow) var(--ease-out-expo),
              background var(--duration-base) var(--ease-in-out);
}
.site-header.visible { transform: translateY(0); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  gap: 8px;
}
.header-left, .header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.header-center { flex: 1; text-align: center; overflow: hidden; }
.header-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.breadcrumb { padding: 0 16px 8px; }
.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.breadcrumb-list li + li::before { content: "/"; opacity: 0.4; margin-right: 6px; }
.breadcrumb-list a { color: var(--text-tertiary); transition: color var(--duration-fast); }
.breadcrumb-list a:hover { color: var(--accent); }

/* ---- 5. 通用图标按钮 ---- */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  transition: background var(--duration-fast), color var(--duration-fast),
              transform var(--duration-fast);
  position: relative;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.icon-btn:active { transform: scale(0.92); background: var(--bg-tertiary); }

/* ---- 6. 侧边栏 ---- */
.sidebar {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}
.sidebar.open { pointer-events: auto; }
.sidebar-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-in-out);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sidebar.open .sidebar-backdrop { opacity: 1; }

.sidebar-nav {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  max-width: 85vw;
  background: var(--bg-card);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--duration-slow) var(--ease-out-expo);
  box-shadow: var(--shadow-xl);
}
.sidebar.open .sidebar-nav { transform: translateX(0); }

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-logo { width: 32px; height: 32px; object-fit: contain; border-radius: var(--radius-sm); }
.sidebar-site-name {
  font-size: 1rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em; flex: 1;
}

.sidebar-links {
  flex: 1; overflow-y: auto;
  padding: 12px 8px;
  overscroll-behavior: contain;
}
.sidebar-link-item { margin-bottom: 2px; }
.sidebar-link-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem; font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast),
              transform var(--duration-fast);
  text-align: left;
}
.sidebar-link-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.sidebar-link-btn:active { transform: scale(0.98); }
.sidebar-link-btn.active { background: var(--accent-subtle); color: var(--accent); }

.sidebar-link-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  transition: background var(--duration-fast);
}
.sidebar-link-btn.active .sidebar-link-icon { background: var(--accent-subtle); }

.sidebar-footer {
  padding: 12px 8px 20px;
  border-top: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-footer-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem; color: var(--text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast);
}
.sidebar-footer-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* 侧边栏音乐控制 */
.sidebar-music-control {
  margin-top: 8px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-music-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.sidebar-music-icon {
  flex-shrink: 0;
}

.sidebar-music-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-music-buttons {
  display: flex;
  gap: 4px;
}

.sidebar-music-buttons .sidebar-footer-btn {
  flex: 1;
  justify-content: center;
  padding: 6px;
}

/* ---- 7. 遮罩弹窗（调整尺寸） ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.visible {
  pointer-events: auto;
  opacity: 1;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.overlay-panel {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 75vh;               /* 桌面端高度 */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  transform: translateZ(0);
}

/* 手机端特殊处理 */
@media (max-width: 599px) {
  .overlay {
    align-items: flex-end;
    padding: 0;
  }

  .overlay-panel {
    max-height: 65vh;             /* 手机端更小 */
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    width: 100%;
    max-width: 100%;
    padding: 20px 16px;
  }

  .welcome-title { font-size: 1.25rem; }
  .welcome-subtitle { font-size: 0.8125rem; }
  .welcome-features li { padding: 8px 12px; font-size: 0.8125rem; }
}

.overlay-close-btn {
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  margin-bottom: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast),
              transform var(--duration-fast);
}
.overlay-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.overlay-close-btn:active { transform: scale(0.95); }

/* ---- 8. 欢迎弹窗内容 ---- */
.welcome-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.logo-img { width: 64px; height: 64px; object-fit: contain; }
.welcome-title {
  font-size: 1.625rem; font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary); text-align: center; margin-bottom: 6px;
}
.welcome-subtitle {
  font-size: 0.9375rem; color: var(--text-secondary);
  text-align: center; margin-bottom: 24px;
}
.welcome-description > p { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 12px; }
.welcome-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }
.welcome-features li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-size: 0.875rem; color: var(--text-secondary);
  transition: background var(--duration-fast);
}
.welcome-features li:hover { background: var(--bg-tertiary); }
.feature-icon { font-size: 1.1rem; flex-shrink: 0; }
.section-divider { height: 1px; background: var(--border-light); margin: 24px 0 20px; }
.section-label {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); margin-bottom: 8px;
}
.music-hint { font-size: 0.8125rem; color: var(--text-tertiary); margin-bottom: 12px; }
.music-toggle-row, .music-select-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.welcome-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px; gap: 16px; flex-wrap: wrap;
}

/* ---- 9. Toggle 开关 ---- */
.toggle-switch {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 44px; height: 26px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  position: relative;
  transition: background var(--duration-base) var(--ease-in-out);
  flex-shrink: 0;
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%; background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--duration-base) var(--ease-out-expo);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-label { font-size: 0.875rem; color: var(--text-secondary); }

/* ---- 10. 自定义选择框 ---- */
.custom-select-wrapper { position: relative; display: flex; align-items: center; }
.custom-select {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 8px 36px 8px 12px;
  font-size: 0.875rem; font-family: var(--font-sans);
  color: var(--text-primary); cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
  min-width: 160px;
}
.custom-select:focus { outline: none; border-color: var(--accent); }
.select-arrow { position: absolute; right: 10px; color: var(--text-tertiary); pointer-events: none; }

/* ---- 11. 按钮 ---- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 0.9375rem; font-weight: 600;
  letter-spacing: -0.01em;
  transition: background var(--duration-fast), transform var(--duration-fast),
              box-shadow var(--duration-fast);
}
.btn-primary:hover {
  background: var(--accent); color: white;
  box-shadow: 0 4px 16px rgba(184, 150, 12, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.97) translateY(0); box-shadow: none; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-full);
  background: var(--bg-secondary); color: var(--text-secondary);
  font-size: 0.875rem; font-weight: 500;
  border: 1px solid var(--border-medium);
  transition: background var(--duration-fast), color var(--duration-fast),
              transform var(--duration-fast);
  width: 100%; justify-content: center; margin-top: 8px;
}
.btn-secondary:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:active { transform: scale(0.97); }

.btn-text {
  padding: 8px 12px; font-size: 0.9375rem; font-weight: 500;
  color: var(--accent); border-radius: var(--radius-md);
  transition: background var(--duration-fast); flex-shrink: 0;
}
.btn-text:hover { background: var(--accent-subtle); }

/* ---- 12. 复选框 ---- */
.no-show-again {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  font-size: 0.8125rem; color: var(--text-secondary);
}
.no-show-again input { display: none; }
.checkbox-custom {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-medium);
  background: var(--bg-secondary); flex-shrink: 0;
  position: relative;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.no-show-again input:checked + .checkbox-custom { background: var(--accent); border-color: var(--accent); }
.no-show-again input:checked + .checkbox-custom::after {
  content: ""; position: absolute;
  top: 2px; left: 5px;
  width: 5px; height: 9px;
  border: 2px solid white; border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ---- 13. 搜索面板 ---- */
.search-panel {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transform: translateY(-100%);
  transition: transform var(--duration-slow) var(--ease-out-expo);
  max-height: 80vh; display: flex; flex-direction: column;
}
.search-panel.open { transform: translateY(0); }
.search-panel-inner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}
.search-input-wrapper {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--bg-secondary); border-radius: var(--radius-full);
  padding: 8px 14px;
  transition: background var(--duration-fast);
}
.search-input-wrapper:focus-within { background: var(--bg-tertiary); box-shadow: 0 0 0 2px var(--accent-subtle); }
.search-icon { color: var(--text-tertiary); flex-shrink: 0; }
.search-input {
  flex: 1; border: none; background: none;
  font-size: 1rem; font-family: var(--font-sans);
  color: var(--text-primary); outline: none; min-width: 0;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-results { flex: 1; overflow-y: auto; padding: 12px 16px 20px; overscroll-behavior: contain; }
.search-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 0; color: var(--text-tertiary); font-size: 0.875rem;
}
.search-result-item {
  padding: 12px 14px; border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--duration-fast), transform var(--duration-fast);
  margin-bottom: 4px;
}
.search-result-item:hover { background: var(--bg-secondary); transform: translateX(4px); }
.search-result-item:active { transform: scale(0.99); }
.search-result-section {
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: 3px;
}
.search-result-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.search-result-snippet { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }
.search-result-snippet mark { background: var(--accent-subtle); color: var(--accent); border-radius: 2px; padding: 0 2px; }
.search-no-results { text-align: center; padding: 40px 0; color: var(--text-tertiary); font-size: 0.875rem; }
.search-group-label {
  font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 14px 4px; margin-top: 8px;
}

/* ---- 14. 更多菜单 ---- */
.more-menu { position: fixed; inset: 0; z-index: 250; pointer-events: none; }
.more-menu.open { pointer-events: auto; }
.more-menu-backdrop { position: absolute; inset: 0; }
.more-menu-panel {
  position: absolute;
  top: calc(var(--header-height) + 8px); right: 12px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 6px; min-width: 180px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  transform: scale(0.92) translateY(-8px);
  transform-origin: top right;
  opacity: 0;
  transition: transform var(--duration-base) var(--ease-out-expo),
              opacity var(--duration-base) var(--ease-out-expo);
}
.more-menu.open .more-menu-panel { transform: scale(1) translateY(0); opacity: 1; }
.more-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast),
              transform var(--duration-fast);
  text-align: left;
}
.more-menu-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.more-menu-item:active { transform: scale(0.97); }
.more-menu-divider { height: 1px; background: var(--border-light); margin: 4px 8px; }

/* ---- 15. 设置面板 ---- */
.settings-panel { max-width: 480px; }
.panel-title {
  font-size: 1.375rem; font-weight: 800;
  letter-spacing: -0.025em; color: var(--text-primary);
  margin-bottom: 28px; padding-right: 80px;
}
.settings-section { margin-bottom: 28px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section-title {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); margin-bottom: 12px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 0.9375rem; color: var(--text-primary); flex: 1; }

/* ---- 16. 首页 Hero ---- */
.home-view { min-height: 100vh; }
.hero-section {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 80px 24px 60px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-gradient {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(184, 150, 12, 0.08) 0%, transparent 70%);
}
.hero-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(184,150,12,0.06) 1px, transparent 1px);
  background-size: 32px 32px; opacity: 0.6;
}
[data-theme="dark"] .hero-pattern { opacity: 0.3; }
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 640px; }
.hero-logo-wrapper { display: flex; justify-content: center; margin-bottom: 28px; }
.hero-logo { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.1)); }
.hero-title { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; color: var(--text-primary); margin-bottom: 16px; }
.hero-title .accent { color: var(--accent); }
.hero-subtitle { font-size: clamp(1rem, 2.5vw, 1.25rem); color: var(--text-secondary); line-height: 1.6; margin-bottom: 40px; font-weight: 400; }
.hero-scroll-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--text-tertiary); animation: bounce-hint 2s ease-in-out infinite; }

/* ---- 17. 卡片轮播 ---- */
.cards-section { padding: 0 0 80px; overflow: hidden; }
.cards-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px 24px; max-width: 1200px; margin: 0 auto;
}
.cards-section-title { font-size: clamp(1.25rem, 3vw, 1.625rem); font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); }
.cards-nav { display: flex; gap: 8px; }
.cards-nav-btn {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--bg-secondary); border: 1px solid var(--border-medium);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  transition: background var(--duration-fast), transform var(--duration-fast),
              border-color var(--duration-fast), color var(--duration-fast);
  flex-shrink: 0;
}
.cards-nav-btn:hover { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); transform: scale(1.05); }
.cards-nav-btn:active { transform: scale(0.95); }
.cards-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.cards-carousel-wrapper {
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.cards-carousel-wrapper:active { cursor: grabbing; }

.cards-carousel {
  display: flex; gap: 20px;
  padding: 8px 32px 24px;
  transition: transform var(--duration-slow) var(--ease-out-expo);
  will-change: transform;
}

.section-card {
  flex: 0 0 var(--card-min-width);
  max-width: var(--card-max-width);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease-out-expo),
              box-shadow var(--duration-base) var(--ease-out-expo),
              border-color var(--duration-base);
  box-shadow: var(--shadow-sm);
  -webkit-user-select: none;
  user-select: none;
}
.section-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--border-medium); }
.section-card:active { transform: translateY(-2px) scale(0.99); box-shadow: var(--shadow-md); }

.card-image-area {
  width: 100%; aspect-ratio: 16 / 9;
  background: var(--bg-secondary); position: relative; overflow: hidden;
}
.card-image-area img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration-slow) var(--ease-out-expo); }
.section-card:hover .card-image-area img { transform: scale(1.04); }
.card-image-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}
.card-body { padding: 20px 20px 22px; }
.card-tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--accent-subtle); color: var(--accent);
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.card-title { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 8px; line-height: 1.3; }
.card-desc { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.6; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.card-articles-count { font-size: 0.75rem; color: var(--text-tertiary); }
.card-enter-btn { display: flex; align-items: center; gap: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--accent); transition: gap var(--duration-fast); }
.section-card:hover .card-enter-btn { gap: 8px; }

.cards-dots { display: flex; justify-content: center; gap: 6px; padding-top: 4px; }
.cards-dot {
  width: 6px; height: 6px; border-radius: var(--radius-full);
  background: var(--border-medium);
  transition: width var(--duration-base) var(--ease-out-expo), background var(--duration-base);
  cursor: pointer; border: none;
}
.cards-dot.active { width: 20px; background: var(--accent); }

/* ---- 18. 子页面 ---- */
.subpage-view { min-height: 100vh; padding-top: var(--header-height); }
.subpage-hero {
  position: relative; height: 240px;
  overflow: hidden; display: flex; align-items: flex-end;
}
@media (min-width: 768px) { .subpage-hero { height: 300px; } }
.subpage-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}
.subpage-hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.subpage-hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg-primary) 0%, rgba(0,0,0,0) 60%);
}
.subpage-hero-content { position: relative; z-index: 1; padding: 24px 24px 28px; max-width: 800px; width: 100%; margin: 0 auto; }
.subpage-title { font-size: clamp(1.625rem, 4vw, 2.5rem); font-weight: 900; letter-spacing: -0.03em; color: var(--text-primary); margin-bottom: 6px; }
.subpage-subtitle { font-size: 0.9375rem; color: var(--text-secondary); }

.subpage-body { display: flex; max-width: 1100px; margin: 0 auto; padding: 0 16px 80px; gap: 40px; align-items: flex-start; }
.toc-sidebar {
  flex-shrink: 0; width: 220px;
  position: sticky; top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto; overscroll-behavior: contain;
  display: none;
}
@media (min-width: 900px) { .toc-sidebar { display: block; } }
.toc-inner { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 16px; }
.toc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toc-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); }
.toc-nav { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
  display: block; padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem; color: var(--text-secondary);
  line-height: 1.4;
  transition: background var(--duration-fast), color var(--duration-fast),
              padding-left var(--duration-fast);
  cursor: pointer;
}
.toc-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.toc-link.active { color: var(--accent); background: var(--accent-subtle); }
.toc-link.level-2 { padding-left: 20px; }
.toc-link.level-3 { padding-left: 32px; font-size: 0.75rem; }

.subpage-content { flex: 1; min-width: 0; padding-top: 24px; }

.articles-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
.article-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 20px; border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease-out-expo),
              box-shadow var(--duration-base), border-color var(--duration-fast);
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-medium); }
.article-card:active { transform: scale(0.99); box-shadow: var(--shadow-sm); }
.article-card-title { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); margin-bottom: 8px; }
.article-card-excerpt { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.6; }
.article-card-meta { margin-top: 14px; display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-tertiary); }

/* 文章正文排版 */
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.25;
  color: var(--text-primary); margin-top: 2em; margin-bottom: 0.75em;
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.article-body h1 { font-size: 1.875rem; }
.article-body h2 { font-size: 1.375rem; }
.article-body h3 { font-size: 1.125rem; }
.article-body h4 { font-size: 1rem; }
.article-body p { font-size: 1rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 1.2em; }
.article-body ul, .article-body ol { margin-bottom: 1.2em; padding-left: 1.5em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { font-size: 1rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 0.4em; }
.article-body strong { font-weight: 700; color: var(--text-primary); }
.article-body em { font-style: italic; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: 12px 16px;
  margin: 1.5em 0; background: var(--accent-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.article-body blockquote p { margin-bottom: 0; color: var(--text-primary); font-style: italic; }
.article-body hr { border: none; border-top: 1px solid var(--border-light); margin: 2em 0; }

.image-placeholder {
  width: 100%; aspect-ratio: 16 / 9;
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-tertiary); font-size: 0.8125rem;
  margin: 1.5em 0; border: 2px dashed var(--border-medium);
}
.image-placeholder-icon { font-size: 2rem; opacity: 0.5; }

/* ---- 19. 浮动工具栏 ---- */
.fab-group {
  position: fixed; bottom: 24px; right: 20px;
  z-index: 150;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.fab {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast),
              transform var(--duration-fast), box-shadow var(--duration-fast);
}
.fab:hover {
  background: var(--text-primary); color: var(--bg-primary);
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
}
.fab:active { transform: scale(0.93); box-shadow: var(--shadow-sm); }

/* 返回首页按钮（带文字） */
.fab-home-btn {
  width: auto !important;
  height: 44px;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}

.fab-home-btn:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* 电脑端进一步增大 */
@media (min-width: 769px) {
  .fab-home-btn {
    height: 48px;
    padding: 10px 24px;
    font-size: 1rem;
  }
}

.fab-home-icon {
  display: flex;
  align-items: center;
}

.fab-home-text {
  white-space: nowrap;
}

/* ---- 20. 页面转场遮罩 ---- */
.page-transition { position: fixed; inset: 0; z-index: 500; pointer-events: none; overflow: hidden; }
.transition-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-light), var(--accent-dark));
  background-size: 200% 100%;
  transform: scaleX(0); transform-origin: left;
  border-radius: 0 2px 2px 0;
}

/* ---- 21. 移动端目录抽屉 ---- */
.toc-mobile-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  margin-bottom: 16px; cursor: pointer;
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  transition: background var(--duration-fast);
  width: 100%;
}
.toc-mobile-trigger:hover { background: var(--bg-tertiary); }
.toc-mobile-trigger svg { transition: transform var(--duration-base) var(--ease-out-expo); }
.toc-mobile-trigger.open svg { transform: rotate(180deg); }
.toc-mobile-content {
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  padding: 8px; margin-bottom: 20px;
  display: none; border: 1px solid var(--border-light);
}
.toc-mobile-content.open { display: block; }

@media (min-width: 900px) {
  .toc-mobile-trigger, .toc-mobile-content { display: none; }
}

/* ---- 22. 响应式断点 ---- */
@media (max-width: 899px) {
  .subpage-body { flex-direction: column; padding: 0 16px 80px; gap: 0; }
  .cards-carousel { padding: 8px 20px 24px; gap: 14px; }
  .cards-header { padding: 0 20px 20px; }
}

@media (max-width: 599px) {
  .cards-carousel { padding: 8px 16px 20px; gap: 12px; }
  .section-card { flex: 0 0 80vw; max-width: 80vw; }
  .cards-header { padding: 0 16px 16px; }
  .cards-nav { display: none; }
  .fab-group { bottom: 20px; right: 16px; }
  .subpage-hero-content { padding: 20px 16px 24px; }
  .more-menu-panel { right: 8px; }
}

@media (min-width: 1200px) {
  .section-card { flex: 0 0 340px; }
  .cards-carousel { padding: 8px 48px 24px; gap: 24px; }
  .cards-header { padding: 0 48px 28px; }
  .subpage-body { padding: 0 48px 80px; }
}

/* ---- 23. 焦点样式 ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---- 24. 滚动条美化 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ---- 25. 选中颜色 ---- */
::selection { background: var(--accent-subtle); color: var(--accent-dark); }

/* ---- 26. 打印样式 ---- */
@media print {
  .site-header, .sidebar, .music-player, .fab-group,
  .search-panel, .more-menu, .toc-sidebar, .page-transition { display: none !important; }
  .subpage-view { padding-top: 0; }
  .subpage-content { max-width: 100%; }
  body { font-size: 12pt; color: #000; }
}

/* ---- 圆形旋转文字 ---- */
.circular-text-container {
  margin: 0 auto 28px;
  position: relative;
  width: 180px;
  height: 180px;
  transform-origin: center;
  will-change: transform;
  cursor: default;
}

.circular-text {
  width: 100%;
  height: 100%;
  position: relative;
}

.circular-text span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-block;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
  transform-origin: 0 0;
  white-space: nowrap;
  transition: color 0.3s;
}

.circular-text:hover span {
  color: var(--accent);
}