﻿/* ============================
   YouHappy — 清新版样式表
   设计语言：轻盈、留白、克制
   ============================ */

:root {
  --bg: #fafafa;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --primary: #0891b2;
  --primary-light: #cffafe;
  --primary-dark: #0e7490;
  --accent: #6366f1;
  --accent-light: #eef2ff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -2px rgba(0,0,0,0.03);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.dark-mode {
  --bg: #0f172a;
  --bg-subtle: #1e293b;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================
   Header
   ========================================== */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}

body.dark-mode header {
  background: rgba(15,23,42,0.85);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

nav a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-buttons .user-greeting {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1.4;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-ghost:hover {
  color: var(--primary);
  background: var(--bg-subtle);
}

.btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

/* ==========================================
   Hero
   ========================================== */

.hero {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-subtle) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, var(--primary-light) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, var(--accent-light) 0%, transparent 50%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.search-box {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: 0.9rem 1.25rem;
  padding-right: 5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

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

.search-box button {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  padding: 0 1.25rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.search-box button:hover {
  background: var(--primary-dark);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 50;
  overflow: hidden;
}

.search-results.active { display: block; }

.search-result-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover { background: var(--bg-subtle); }

.search-result-item strong {
  color: var(--text);
  font-weight: 600;
}

.search-result-item p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ==========================================
   Section general
   ========================================== */

.section {
  padding: 4rem 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ==========================================
   Categories
   ========================================== */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.category-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.category-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Category icon backgrounds */
.cat-software .category-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.cat-books .category-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.cat-audio .category-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.cat-design .category-icon { background: linear-gradient(135deg, #ec4899, #db2777); }
.cat-data .category-icon { background: linear-gradient(135deg, #10b981, #059669); }
.cat-other .category-icon { background: linear-gradient(135deg, #64748b, #475569); }

/* ==========================================
   Resource cards
   ========================================== */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}

.resource-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.resource-thumbnail {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}

.resource-content {
  padding: 1.25rem;
}

.resource-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.tag {
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 20px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.resource-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.resource-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.resource-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.resource-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-download {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-download:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.load-more {
  text-align: center;
  margin-top: 2rem;
}

.btn-load-more {
  padding: 0.6rem 2.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-load-more:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ==========================================
   Upload section (home)
   ========================================== */

.upload-section-home {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.upload-section-home h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.upload-section-home p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.upload-area {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
}

.upload-area .icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.upload-area h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.upload-area p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-progress {
  margin-top: 1rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================
   External resources section
   ========================================== */

.external-section .external-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.875rem;
}

.external-link {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
}

.external-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.external-link .name {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.external-link .desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ==========================================
   Footer
   ========================================== */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-section ul li a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--primary);
}

/* ==========================================
   Back to top
   ========================================== */

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

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

.back-to-top:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ==========================================
   Dark mode toggle
   ========================================== */

.dark-mode-toggle {
  position: fixed;
  bottom: 4.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.dark-mode-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ==========================================
   Modal
   ========================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.modal.active { display: flex; }

.modal-content {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.25s ease-out;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-modal:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

/* ==========================================
   Toast
   ========================================== */

.toast-container {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease-out;
}

.toast.removing {
  opacity: 0;
  transform: translateX(40px);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: var(--text); }
.toast-info { background: var(--primary); }

/* ==========================================
   Animations
   ========================================== */

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

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================
   Page header (for subpages)
   ========================================== */

.page-header {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.page-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* ==========================================
   Card for content pages
   ========================================== */

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.content-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.content-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.content-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

/* ==========================================
   FAQ
   ========================================== */

.faq-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-answer {
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 1.5rem;
  border-left: 2px solid var(--primary);
}

/* ==========================================
   Steps (upload guide)
   ========================================== */

.steps { margin-top: 1.5rem; }

.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ==========================================
   Tips & Warning boxes
   ========================================== */

.tips-box {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1rem;
}

.tips-box h3 {
  color: var(--primary-dark);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.tips-box ul {
  list-style: none;
  padding: 0;
}

.tips-box ul li {
  padding: 0.2rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.warning-box {
  background: #fef2f2;
  border-left: 3px solid var(--danger);
  padding: 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1rem;
}

.warning-box h3 {
  color: var(--danger);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.warning-box ul {
  list-style: none;
  padding: 0;
}

.warning-box ul li {
  padding: 0.2rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================
   Auth pages (login / register)
   ========================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  padding: 1.5rem;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.auth-box .auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-box h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.auth-box .auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.back-home {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-home:hover { color: var(--primary); }

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
}

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

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

.auth-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

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

/* ==========================================
   Upload form (full page)
   ========================================== */

.upload-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.upload-header {
  background: var(--primary);
  color: #fff;
  padding: 2.5rem;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.upload-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.upload-header p {
  opacity: 0.85;
  font-size: 0.95rem;
}

.upload-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.upload-form .form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.upload-form .form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.upload-form .form-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.upload-area-large {
  background: var(--bg-subtle);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area-large:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area-large.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-info {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 44px;
  cursor: text;
}

.tags-input input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 100px;
  font-size: 0.9rem;
  background: transparent;
  color: var(--text);
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 0.85rem;
}

.tag-remove {
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.tag-remove:hover { opacity: 1; }

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 2.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
   Category filter bar
   ========================================== */

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.resource-count {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================
   Login prompt overlay
   ========================================== */

.login-prompt {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.login-prompt h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-prompt p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ==========================================
   Contact cards
   ========================================== */

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-card {
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.contact-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.contact-card .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* ==========================================
   Mission cards (about page)
   ========================================== */

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.mission-card {
  padding: 2rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  text-align: center;
}

.mission-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.mission-card p {
  opacity: 0.9;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================
   Team
   ========================================== */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.team-member {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.team-member:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.team-avatar {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
}

.team-member h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.team-member p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================
/* ==========================================
   Skeleton loading (骨架屏)
   ========================================== */

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-thumb {
  width: 100%;
  height: 140px;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-body {
  padding: 1.25rem;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-line:last-child {
  width: 60%;
  margin-bottom: 0;
}

.skeleton-line-short {
  width: 40%;
  height: 14px;
  margin-bottom: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-thumb-single {
  height: 200px;
}

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

/* ==========================================
   Hamburger menu (移动端导航)
   ========================================== */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  gap: 4px;
  z-index: 110;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

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

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

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

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 98;
}

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

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    padding: 5rem 1.5rem 2rem;
    gap: 0.5rem;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 100;
    transition: right 0.3s ease;
  }

  nav.open {
    right: 0;
  }

  nav a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    width: 100%;
  }

  .header-content nav a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

/* ==========================================
  Responsive
  ========================================== */

@media (max-width: 768px) {
  .hero { padding: 3rem 1.5rem 2.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .section { padding: 2.5rem 1rem; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .resource-grid { grid-template-columns: 1fr; }
  .header-content { height: 56px; }
  nav a { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
  .form-row { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .page-header { padding: 2rem 1.5rem; }
  .page-header h1 { font-size: 1.5rem; }
  .back-home { position: static; margin-bottom: 1rem; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================
   External resources (updated)
   ========================================== */

.external-group {
  margin-bottom: 2rem;
}

.external-group-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.external-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================
   Animated mascot - 小卡通吉祥物
   ========================================== */

.mascot-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.mascot-svg {
  width: 36px;
  height: 36px;
  animation: mascotFloat 2.5s ease-in-out infinite;
}

.mascot-body {
  fill: var(--primary);
}

.mascot-eye {
  fill: #fff;
}

.mascot-mouth {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
}

.mascot-cheek {
  fill: rgba(255,255,255,0.3);
}

/* 眨眼动画 */
.mascot-wrapper:hover .mascot-eye-left,
.mascot-wrapper:hover .mascot-eye-right {
  animation: mascotBlink 0.4s ease;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-3deg); }
  50% { transform: translateY(-3px) rotate(2deg); }
  75% { transform: translateY(-6px) rotate(-1deg); }
}

@keyframes mascotBlink {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

/* 星星闪烁装饰 */
.mascot-star {
  animation: starTwinkle 2s ease-in-out infinite;
  transform-origin: center;
}

.mascot-star:nth-child(1) { animation-delay: 0s; }
.mascot-star:nth-child(2) { animation-delay: 0.7s; }
.mascot-star:nth-child(3) { animation-delay: 1.4s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* 资源分类区域的小卡片装饰 */
.categories-mascot {
  text-align: center;
  margin-bottom: 1.5rem;
}

.categories-mascot .mascot-svg {
  width: 44px;
  height: 44px;
}
