/* ─── 来写·道耘 — Warm Premium Design ─── */
:root {
  --bg: #f5f2ed;
  --surface: #ffffff;
  --primary: #1a1a2e;
  --primary-light: #25254a;
  --accent: #d4a853;
  --accent-hover: #c49a3f;
  --accent-light: #fdf6e3;
  --accent-glow: rgba(212,168,83,0.08);
  --text: #2c2c3a;
  --text-light: #787880;
  --text-muted: #a8a8b0;
  --border: #e8e4de;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-w: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ─── Nav ─── */
.nav {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff !important;
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { letter-spacing: -0.02em; }
.logo-sub { font-size: 0.65rem; color: var(--accent); margin-left: 2px; font-weight: 400; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: rgba(255,255,255,0.75);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }

.nav-btn {
  color: rgba(255,255,255,0.75) !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid rgba(255,255,255,0.2);
}
.nav-btn:hover { color: #fff !important; background: rgba(255,255,255,0.1) !important; }
.nav-btn-primary {
  background: var(--accent) !important;
  color: var(--primary) !important;
  border-color: var(--accent) !important;
  font-weight: 600;
}
.nav-btn-primary:hover { background: var(--accent-hover) !important; color: var(--primary) !important; }
.nav-user { color: var(--accent); font-size: 0.8rem; margin: 0 8px; }
.nav-link { color: rgba(255,255,255,0.6) !important; font-size: 0.8rem !important; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all 0.2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-md); }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-light); color: #fff; border-color: var(--primary-light); }
.btn-sm { padding: 6px 16px; font-size: 0.8rem; }

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 680px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--primary);
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

/* ─── Container ─── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ─── Forms ─── */
input, textarea, select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-family: var(--font);
  background: var(--surface);
  transition: border-color 0.2s; outline: none;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { min-height: 120px; resize: vertical; }
label { font-size: 0.85rem; font-weight: 500; color: var(--text-light); margin-bottom: 6px; display: block; }
.form-group { margin-bottom: 20px; }
.form-card {
  max-width: 480px; margin: 40px auto; padding: 32px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}

/* ─── Article List ─── */
.article-list { margin: 24px 0; }
.article-item {
  padding: 20px 0; border-bottom: 1px solid var(--border);
}
.article-item:last-child { border-bottom: none; }
.article-item h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; }
.article-item h3 a { color: var(--primary); }
.article-item h3 a:hover { color: var(--accent); }
.article-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 16px; }
.article-content { max-width: 720px; margin: 40px auto; }
.article-content h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; color: var(--primary); }
.article-content .content { margin-top: 32px; font-size: 1rem; line-height: 1.8; }
.article-content .content p { margin-bottom: 1.2em; }
.article-content .content h2 { font-size: 1.4rem; margin-top: 1.5em; margin-bottom: 0.5em; color: var(--primary); }
.article-content .content h3 { font-size: 1.15rem; margin-top: 1.2em; margin-bottom: 0.4em; }

/* ─── Tags ─── */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 100px;
  background: var(--accent-light); color: var(--accent-hover);
  font-size: 0.75rem; font-weight: 500;
}
.tag:hover { background: var(--accent); color: #fff; }

/* ─── Auth ─── */
.auth-card { max-width: 400px; margin: 60px auto; text-align: center; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 24px; color: var(--primary); }
.auth-link { margin-top: 16px; font-size: 0.9rem; color: var(--text-light); }

/* ─── Footer ─── */
.footer {
  margin-top: auto;
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 40px 24px 24px;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-col p { font-size: 0.85rem; line-height: 1.7; color: rgba(255,255,255,0.6); }
.footer-col a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ─── Alerts ─── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--accent-light); color: #8b6b2a; border: 1px solid #fde68a; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ─── Pagination ─── */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 32px 0; }
.pagination a, .pagination span {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 0.85rem; border: 1px solid var(--border);
  color: var(--text-light); background: var(--surface);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
}

/* ─── Dashboard ─── */
.dashboard { max-width: 800px; margin: 40px auto; }
.dashboard h1 { font-size: 1.5rem; margin-bottom: 24px; color: var(--primary); }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  text-align: center; padding: 24px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Article Grid ─── */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.article-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; transition: all 0.25s; }
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-card-body { padding: 20px; }
.article-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.article-card h3 a { color: var(--primary); }
.article-card h3 a:hover { color: var(--accent); }
.article-excerpt { font-size: 0.85rem; color: var(--text-light); line-height: 1.6; }
.article-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); }

/* ─── Categories ─── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.category-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; text-align: center; box-shadow: var(--shadow); transition: all 0.25s; }
.category-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.category-card h3 { font-size: 1.1rem; font-weight: 600; }
.category-card .count { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Loading ─── */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Fade In ─── */
.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Style Buttons (for生成器) ─── */
.style-btn { cursor: pointer; transition: all 0.2s; }
.style-btn:hover { border-color: var(--accent) !important; }
.style-btn.active { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-hover) !important; }

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .nav-inner { padding: 0 16px; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 6px 10px; font-size: 0.8rem; }
  .hero { padding: 40px 16px 30px; }
  .hero h1 { font-size: 2rem; }
  .card-grid { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
