/* ============================================
   效率工坊 - 博客样式表 (v2 美化版)
   ============================================ */

/* CSS 变量 */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --accent-gradient: linear-gradient(135deg, #f59e0b, #ef4444);
  --success: #10b981;
  --bg: #f5f3ff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --text: #1e1b4b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: rgba(148, 163, 184, 0.15);
  --shadow-sm: 0 1px 3px rgba(99, 102, 241, 0.06);
  --shadow: 0 4px 20px -4px rgba(99, 102, 241, 0.12), 0 2px 8px -2px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 20px 50px -12px rgba(99, 102, 241, 0.25), 0 8px 20px -6px rgba(99, 102, 241, 0.12);
  --shadow-glow: 0 0 40px -8px rgba(99, 102, 241, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --max-width: 1140px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色主题 */
[data-theme="dark"] {
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #312e81;
  --primary-gradient: linear-gradient(135deg, #818cf8, #a78bfa);
  --accent: #fbbf24;
  --accent-light: #422006;
  --accent-gradient: linear-gradient(135deg, #fbbf24, #f87171);
  --bg: #0f0f1e;
  --bg-card: #1a1a2e;
  --bg-hover: #252540;
  --bg-glass: rgba(26, 26, 46, 0.72);
  --text: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: #2d2d44;
  --border-light: rgba(148, 163, 184, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px -8px rgba(129, 140, 248, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* 装饰背景光斑 */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

body::before {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -200px;
  right: -100px;
  animation: float1 20s ease-in-out infinite;
}

body::after {
  width: 400px;
  height: 400px;
  background: var(--accent);
  bottom: -150px;
  left: -100px;
  animation: float2 25s ease-in-out infinite;
}

[data-theme="dark"] body::before,
[data-theme="dark"] body::after {
  opacity: 0.12;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, 80px) scale(1.1); }
  66% { transform: translate(40px, -40px) scale(0.95); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, -60px) scale(0.9); }
  66% { transform: translate(-40px, 50px) scale(1.05); }
}

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

a:hover {
  color: var(--primary-dark);
}

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

ul {
  list-style: none;
}

::selection {
  background: var(--primary);
  color: #fff;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

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

/* ============================================
   导航栏 — 玻璃态效果
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
  border-bottom-color: var(--border);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--text);
}

.logo-icon {
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition);
}

.nav-logo:hover .logo-icon {
  transform: scale(1.1) rotate(-5deg);
}

.logo-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 4px;
  background: var(--bg-hover);
  padding: 4px;
  border-radius: 14px;
}

.nav-link {
  display: block;
  padding: 8px 18px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

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

.theme-toggle,
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.theme-toggle:hover,
.menu-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: scale(1.05);
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   阅读进度条
   ============================================ */
.reading-progress {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99;
  background: transparent;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: 0 3px 3px 0;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* 页面入场动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.main-content > * {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Hero 区域
   ============================================ */
.hero {
  text-align: center;
  padding: 56px 0 48px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: scaleIn 0.5s ease;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 18px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: shineText 5s linear infinite;
}

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

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-slogan {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px auto 0;
  flex-wrap: wrap;
}

.hero-slogan-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: var(--shadow-sm);
  animation: scaleIn 0.5s ease both;
}

.hero-slogan-tag:nth-child(2) {
  background: linear-gradient(135deg, #8b5cf6 0%, var(--primary) 100%);
}

.hero-slogan-tag:nth-child(3) {
  background: linear-gradient(135deg, var(--accent) 0%, #10b981 100%);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  padding: 16px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 100px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.hero-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.hero-stat .num {
  font-size: 32px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-stat .label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   广告投放预留窗口
   ============================================ */
.ad-slot {
  margin: 24px 0 36px;
  border: 2px dashed rgba(139, 92, 246, 0.35);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(139, 92, 246, 0.06), rgba(236, 72, 153, 0.04));
  transition: border-color var(--transition), background var(--transition);
}

.ad-slot:hover {
  border-color: rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.08));
}

.ad-slot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 36px;
  min-height: 90px;
  position: relative;
}

.ad-slot-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ad-slot-icon {
  font-size: 14px;
}

.ad-slot-content {
  flex: 1;
  text-align: center;
}

.ad-slot-title {
  font-size: 16px;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.ad-slot-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.ad-slot-size {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-card);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 装饰光斑 */
.ad-slot::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
  pointer-events: none;
}

.ad-slot::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 20%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.1), transparent 70%);
  pointer-events: none;
}

/* 暗色模式适配 */
[data-theme="dark"] .ad-slot {
  border-color: rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .ad-slot:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

[data-theme="dark"] .ad-slot-size {
  background: rgba(255, 255, 255, 0.06);
}

/* 响应式 */
@media (max-width: 768px) {
  .ad-slot-inner {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 12px;
  }

  .ad-slot-content {
    order: -1;
  }
}

/* ============================================
   搜索栏
   ============================================ */
.search-bar {
  margin-bottom: 36px;
}

.search-input-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.search-input-wrap svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: color var(--transition);
}

.search-input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

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

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light), var(--shadow);
}

.search-input:focus + svg,
.search-input-wrap:has(.search-input:focus) svg {
  color: var(--primary);
}

/* ============================================
   章节标题
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ============================================
   文章列表
   ============================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 交错入场动画 */
.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
.article-card:nth-child(7) { animation-delay: 0.35s; }
.article-card:nth-child(8) { animation-delay: 0.4s; }
.article-card:nth-child(9) { animation-delay: 0.45s; }

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.article-card-cover {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

/* 渐变封面变体 */
.article-card-cover.cover-0 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.article-card-cover.cover-1 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.article-card-cover.cover-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.article-card-cover.cover-3 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.article-card-cover.cover-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.article-card-cover.cover-5 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.article-card-cover.cover-6 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.article-card-cover.cover-7 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.article-card-cover.cover-8 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }

[data-theme="dark"] .article-card-cover {
  opacity: 0.85;
}

.article-card-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.article-card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M0 0h20v20H0V0zm20 20h20v20H20V20z'/%3E%3C/g%3E%3C/svg%3E");
}

.article-card-cover span {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
  transition: transform var(--transition);
}

.article-card:hover .article-card-cover span {
  transform: scale(1.15);
}

.article-card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
  transition: color var(--transition);
}

.article-card:hover .article-card-title {
  color: var(--primary);
}

.article-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.article-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.tag:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.tag-accent {
  background: var(--accent-light);
  color: var(--accent);
}

.article-card-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   文章详情
   ============================================ */
.article-detail {
  max-width: 800px;
  margin: 0 auto;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.article-back:hover {
  color: var(--primary);
  border-color: var(--primary);
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.article-detail-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.article-detail-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.article-detail-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* ============================================
   Markdown 渲染样式
   ============================================ */
.markdown-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  scroll-margin-top: 90px;
}

.markdown-body h1 {
  font-size: 28px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.markdown-body h2 {
  font-size: 23px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.markdown-body h3 {
  font-size: 19px;
}

.markdown-body h4 {
  font-size: 17px;
}

.markdown-body p {
  margin-bottom: 18px;
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 18px;
  padding-left: 26px;
}

.markdown-body ul {
  list-style: none;
}

.markdown-body ul li {
  position: relative;
  margin-bottom: 8px;
}

.markdown-body ul li::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-gradient);
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body ol li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin-top: 8px;
  margin-bottom: 0;
}

.markdown-body blockquote {
  margin: 20px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--primary);
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.markdown-body blockquote::before {
  content: '"';
  position: absolute;
  top: -6px;
  left: 14px;
  font-size: 36px;
  color: var(--primary);
  opacity: 0.2;
  font-family: Georgia, serif;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

.markdown-body pre {
  margin: 20px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.markdown-body pre code {
  display: block;
  padding: 20px;
  background: #1a1b2e;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
  color: #e2e8f0;
  font-weight: 400;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.markdown-body th,
.markdown-body td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-body th {
  background: var(--bg-hover);
  font-weight: 700;
  color: var(--text);
}

.markdown-body tbody tr {
  transition: background var(--transition-fast);
}

.markdown-body tbody tr:hover {
  background: var(--bg-hover);
}

.markdown-body img {
  border-radius: var(--radius-sm);
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.markdown-body hr {
  margin: 36px 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.markdown-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: all var(--transition);
}

.markdown-body a:hover {
  color: var(--primary-dark);
  text-decoration-thickness: 2px;
}

.markdown-body strong {
  font-weight: 700;
  color: var(--text);
}

.markdown-body .task-list-item {
  list-style: none;
}

.markdown-body .task-list-item::before {
  display: none;
}

.markdown-body .task-list-item input {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* 文章底部 */
.article-detail-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.article-nav-item {
  flex: 1;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
}

.article-nav-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.article-nav-item .nav-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.article-nav-item .nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-nav-item.next {
  text-align: right;
}

/* ============================================
   标签页
   ============================================ */
.tags-page {
  max-width: 820px;
  margin: 0 auto;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 28px 0;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.tag-cloud-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow);
}

.tag-cloud-item.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.4);
}

.tag-cloud-count {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-weight: 700;
}

.tag-cloud-item.active .tag-cloud-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ============================================
   关于页面
   ============================================ */
.about-page {
  max-width: 780px;
  margin: 0 auto;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.about-card:hover {
  box-shadow: var(--shadow);
}

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

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

.about-avatar {
  width: 100px;
  height: 100px;
  border-radius: 28px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  margin: 0 auto 22px;
  box-shadow: 0 12px 32px -8px rgba(99, 102, 241, 0.4);
  animation: avatarFloat 3s ease-in-out infinite;
}

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

.about-name {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.about-bio {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.about-skill {
  padding: 7px 16px;
  border-radius: 22px;
  background: var(--bg-hover);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
  cursor: default;
}

.about-skill:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
}

.about-contact {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

.about-contact a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.about-contact a:hover {
  background: var(--primary-gradient);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.4);
}

/* ============================================
   应用中心页面
   ============================================ */
.apps-page {
  max-width: 1040px;
  margin: 0 auto;
}

.apps-upload-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  margin-bottom: 32px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.apps-upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 0;
}

.apps-upload-zone:hover,
.apps-upload-zone.dragover {
  border-color: var(--primary);
}

.apps-upload-zone:hover::before,
.apps-upload-zone.dragover::before {
  opacity: 0.05;
}

.apps-upload-zone .upload-icon {
  font-size: 52px;
  margin-bottom: 16px;
  display: inline-block;
  position: relative;
  z-index: 1;
  transition: transform var(--transition);
}

.apps-upload-zone:hover .upload-icon {
  transform: translateY(-4px) scale(1.1);
}

.apps-upload-zone h3 {
  font-size: 18px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.apps-upload-zone p {
  color: var(--text-muted);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.apps-upload-zone input[type="file"] {
  display: none;
}

.app-upload-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.3s ease;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.form-textarea {
  resize: vertical;
  min-height: 84px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.5);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(99, 102, 241, 0.6);
}

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #ef4444;
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.app-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  background: var(--primary-gradient);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition);
}

.app-card:hover .app-card-icon {
  transform: scale(1.08) rotate(-5deg);
}

.app-card-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.app-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

.app-card-info {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.app-card-info span {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-hover);
  border-radius: 6px;
  font-weight: 500;
}

.app-card-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 72px;
  margin-bottom: 20px;
  opacity: 0.4;
  animation: floatIcon 3s ease-in-out infinite;
}

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

.empty-state h3 {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 700;
}

.empty-state p {
  font-size: 14px;
}

/* ============================================
   回到顶部
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(99, 102, 241, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px -6px rgba(99, 102, 241, 0.6);
}

/* ============================================
   页脚
   ============================================ */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-brand .logo-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all var(--transition);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================
   加载动画
   ============================================ */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   提示消息
   ============================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.toast.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .menu-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-stats {
    gap: 12px;
  }

  .hero-stat {
    padding: 12px 20px;
    min-width: 90px;
  }

  .hero-stat .num {
    font-size: 26px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-detail-title {
    font-size: 26px;
  }

  .about-card {
    padding: 28px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .article-nav {
    flex-direction: column;
  }

  .article-nav-item.next {
    text-align: left;
  }

  .main-content {
    padding: 24px 16px;
  }

  .reading-progress {
    top: 68px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 28px;
  }

  .hero-badge {
    font-size: 12px;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 10px;
  }

  .hero-stat {
    flex: 1;
    min-width: 0;
  }

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

  .nav-container {
    padding: 0 16px;
  }
}

/* ============================================
   会员登录/注册
   ============================================ */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 36px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: scaleIn 0.35s ease;
}

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

.auth-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: floatIcon 3s ease-in-out infinite;
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.auth-form {
  text-align: left;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-link a {
  color: var(--primary);
  font-weight: 600;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* 导航栏用户区域 */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}

.nav-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nav-user .btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* 下载量徽章 */
.download-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .download-badge {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #a5b4fc !important;
}

/* ============ 应用列表：免费/收费筛选 ============ */
.apps-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.app-filter-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-hover);
  padding: 4px;
  border-radius: 10px;
}

.app-filter-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
}

.app-filter-tab:hover {
  color: var(--text);
}

.app-filter-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.price-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}

.price-badge.free {
  background: rgba(34, 197, 94, .14);
  color: #16a34a;
}

.price-badge.paid {
  background: rgba(245, 158, 11, .16);
  color: #d97706;
}

[data-theme="dark"] .price-badge.free {
  background: rgba(34, 197, 94, .2);
  color: #4ade80;
}

[data-theme="dark"] .price-badge.paid {
  background: rgba(245, 158, 11, .22);
  color: #fbbf24;
}

/* 付费应用提示文案 */
.app-card-hint {
  font-size: 12px;
  color: #d97706;
  background: rgba(245, 158, 11, .1);
  border: 1px dashed rgba(245, 158, 11, .35);
  border-radius: 6px;
  padding: 4px 8px;
  margin: 0 0 10px;
}

[data-theme="dark"] .app-card-hint {
  color: #fbbf24;
  background: rgba(245, 158, 11, .14);
  border-color: rgba(245, 158, 11, .4);
}

/* ============ 小工具编辑弹窗 ============ */
.edit-modal {
  width: min(480px, 92vw);
  height: auto;
  max-height: 88vh;
  flex-direction: column;
}

.edit-body {
  padding: 20px 24px 24px;
  overflow: auto;
}

.edit-body .form-group {
  margin-bottom: 16px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .nav-user {
    margin-right: 0;
  }

  .nav-user-name {
    display: none;
  }

  .auth-card {
    padding: 32px 24px;
  }
}

/* ============ 首页 HTML 小工具窗口 ============ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-hover);
  border-radius: var(--radius-sm);
  padding: 20px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .15s, box-shadow .15s;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, .12);
}

.tool-card-icon {
  font-size: 34px;
  line-height: 1;
}

.tool-card-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.tool-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  min-height: 32px;
}

.tool-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* 小工具排序按钮：紧凑方形，避免与「打开/编辑/删除」挤在一行 */
.tool-move-btn {
  padding: 0 8px;
  min-width: 30px;
  font-size: 13px;
  line-height: 1;
}

.tool-move-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tool-card.has-cover {
  padding: 0 0 16px;
  overflow: hidden;
}

.tool-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-hover);
}

.tool-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.tool-card:hover .tool-card-cover img {
  transform: scale(1.04);
}

.tool-card-cover-icon {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, .92);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.tool-upload {
  border: 2px dashed var(--bg-hover);
  cursor: pointer;
  color: var(--text-muted);
}

.tool-upload:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tool-upload-icon {
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  color: var(--primary);
}

/* 小工具翻页 */
.tool-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.tool-page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.tool-page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tool-page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .25);
}

/* ============ 工具打开弹窗 ============ */
.tool-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.tool-modal {
  width: min(960px, 95vw);
  height: min(82vh, 720px);
  background: var(--bg-card);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.tool-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-hover);
}

.tool-modal-title {
  font-weight: 700;
  color: var(--text);
}

.tool-modal-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tool-modal-close {
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}

.tool-modal-close:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.tool-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ============ 下载广告弹窗 ============ */
.ad-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.ad-modal {
  width: 380px;
  max-width: 92vw;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.ad-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ad-box {
  border: 2px dashed var(--bg-hover);
  border-radius: 10px;
  padding: 18px 14px;
  background: var(--bg-hover);
}

.ad-box-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.ad-box-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ad-ph {
  margin-top: 12px;
  padding: 22px;
  background: rgba(99, 102, 241, .08);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.ad-skip {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

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

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}
