/* Minimal, Google-like UI primitives (Material-inspired) */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-elevated: #f8fafc;
  --text: #1f2937;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.12);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
  --radius: 14px;
  --primary: #1a73e8;
  --primary-ink: #ffffff;
  --danger: #d93025;
  --success: #188038;
  --focus: 0 0 0 4px rgba(26, 115, 232, .18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Microsoft YaHei", sans-serif;
}

/* Night mode */
body.night-mode,
html.dark {
  --bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --surface: rgba(30, 41, 59, 0.6);
  --surface-elevated: rgba(51, 65, 85, 0.8);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(51, 65, 85, 1);
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.3);
  --focus: 0 0 0 4px rgba(59, 130, 246, .25);
}

body.night-mode .appbar,
html.dark .appbar {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid #1e293b;
}

body.night-mode .card,
html.dark .card {
  border: 1px solid #334155;
}

body.night-mode .btn-ghost,
html.dark .btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
body.night-mode .btn-ghost:hover,
html.dark .btn-ghost:hover {
  background: rgba(59, 130, 246, .1);
}

body.night-mode .field input,
body.night-mode .field select,
body.night-mode .field textarea,
html.dark .field input,
html.dark .field select,
html.dark .field textarea {
  background: rgba(15, 23, 42, 0.4);
  border-color: #334155;
  color: var(--text);
}

body.night-mode .flash-error,
html.dark .flash-error {
  border-color: rgba(217, 48, 37, .5);
  background: rgba(217, 48, 37, .15);
  color: #fca5a5;
}
body.night-mode .flash-success,
html.dark .flash-success {
  border-color: rgba(24, 128, 56, .5);
  background: rgba(24, 128, 56, .15);
  color: #86efac;
}
body.night-mode .flash-info,
html.dark .flash-info {
  border-color: rgba(26, 115, 232, .5);
  background: rgba(26, 115, 232, .15);
  color: #93c5fd;
}

body.night-mode th,
body.night-mode td,
html.dark th,
html.dark td {
  border-bottom-color: rgba(51, 65, 85, 1);
}

body.night-mode .badge,
html.dark .badge {
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.4);
  color: var(--text);
}
body.night-mode .badge-success,
html.dark .badge-success {
  border-color: rgba(24, 128, 56, .4);
  background: rgba(24, 128, 56, .15);
  color: #86efac;
}
body.night-mode .badge-warn,
html.dark .badge-warn {
  border-color: rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .15);
  color: #fcd34d;
}

body.night-mode .progress,
html.dark .progress {
  background: rgba(30, 41, 59, 0.8);
  border-color: #334155;
}

body.night-mode .code,
html.dark .code {
  color: #cbd5e1;
}

/* Theme toggle button */
.theme-toggle {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.theme-toggle:hover {
  background: rgba(26, 115, 232, .08);
}
body.night-mode .theme-toggle {
  background: rgba(15, 23, 42, 0.4);
  border-color: #334155;
}
body.night-mode .theme-toggle:hover {
  background: rgba(59, 130, 246, .15);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform .45s ease, opacity .25s ease;
}

body.page-loading::before {
  transform: scaleX(.72);
  opacity: 1;
}

body.page-ready::before {
  transform: scaleX(1);
  opacity: 0;
}

img[data-enhanced-load] {
  opacity: 0;
  transition: opacity .28s ease;
}

img[data-enhanced-load].is-loaded {
  opacity: 1;
}

.content-band {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.quiet-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

html.dark .quiet-panel {
  background: rgba(15,23,42,.42);
}

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

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 248, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.appbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-ink);
  font-weight: 800;
}

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

.nav a {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
}
.nav a:hover { background: rgba(26,115,232,.08); color: var(--text); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad { padding: 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.h1 { font-size: 22px; margin: 0; }
.h2 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  user-select: none;
}
.btn:focus { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(0.98); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(17,24,39,.04); }
.btn-danger { background: var(--danger); color: #fff; }

.field label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 8px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 16px;
}
.field textarea {
  min-height: 200px;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: var(--focus); border-color: rgba(26,115,232,.45); }

.flash {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
}
.flash-stack {
  display: grid;
  gap: 8px;
}
.flash-error { border-color: rgba(217,48,37,.35); background: rgba(217,48,37,.06); color: #991b1b; }
.flash-success { border-color: rgba(24,128,56,.35); background: rgba(24,128,56,.06); color: #14532d; }
.flash-info { border-color: rgba(26,115,232,.35); background: rgba(26,115,232,.06); color: #1e3a8a; }
.flash-warn { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); color: #92400e; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid rgba(17,24,39,.08); font-size: 13px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 700; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(17,24,39,.03);
}
.badge-success { border-color: rgba(24,128,56,.25); background: rgba(24,128,56,.06); color: var(--success); }
.badge-warn { border-color: rgba(245,158,11,.28); background: rgba(245,158,11,.10); color: #92400e; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 860px) { .row { grid-template-columns: 1fr; } }

.sp-12 { height: 12px; }
.sp-16 { height: 16px; }
.sp-20 { height: 20px; }

/* Visual helpers */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-label {
  color: var(--muted);
  font-size: 12px;
}
.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.metric-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(17,24,39,.08);
  overflow: hidden;
  border: 1px solid rgba(17,24,39,.10);
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
}
.progress.progress-success > span { background: var(--success); }
.progress.progress-danger > span { background: var(--danger); }

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: #374151;
}

/* 首页和大厅页面样式 */
.main-content { max-width: 1400px; margin: 0 auto; padding: 32px 24px; }

.zone-section { margin-bottom: 48px; }
.zone-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.zone-title-group { display: flex; align-items: center; gap: 12px; }
.zone-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.zone-icon.free { background: linear-gradient(135deg, #22c55e, #16a34a); }
.zone-icon.premium { background: linear-gradient(135deg, #f59e0b, #d97706); }
.zone-icon.creator { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.zone-icon.skill { background: linear-gradient(135deg, #ec4899, #db2777); }
.zone-icon.knowledge { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.zone-icon.tool { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.zone-icon.tutorial { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.zone-title { font-family: var(--font); font-size: 20px; font-weight: 800; color: var(--text); }
.zone-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.zone-badge.free { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.zone-badge.premium { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.zone-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.zone-more { font-size: 13px; color: #3b82f6; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.zone-more:hover { text-decoration: underline; }

.category-section { margin-bottom: 32px; }
.category-tabs { display: flex; gap: 12px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 8px; }
.category-tab { padding: 10px 20px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 10px; cursor: pointer; font-size: 14px; font-family: inherit; transition: all 0.2s; white-space: nowrap; }
.category-tab:hover { background: var(--surface-elevated); color: var(--text); }
.category-tab.active { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; border-color: transparent; }
.category-content { display: none; }
.category-content.active { display: block; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); padding: 20px; text-align: center; text-decoration: none; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.card:hover { border-color: #3b82f6; box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card-icon { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.card-icon.green { background: #ffffff; }
.card-icon.blue { background: #ffffff; }
.card-icon.purple { background: #ffffff; }
.card-icon.orange { background: #ffffff; }
.card-icon.cyan { background: #ffffff; }
.card-icon.pink { background: #ffffff; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-desc { font-size: 12px; color: var(--muted); line-height:  1.4; }
.card-tag { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.card-tag.free { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.card-tag.premium { background: rgba(245, 158, 11, 0.15); color: #d97706; }

.creator-section { background: var(--surface); border-radius: 16px; padding: 32px; border: 1px solid var(--border); }
.creator-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.creator-card { background: var(--surface-elevated); border-radius: 12px; padding: 24px; text-align: center; }
.creator-card h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.creator-card p { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.creator-btn { display: inline-block; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.creator-btn.primary { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }
.creator-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4); }
.creator-btn.secondary { background: var(--surface); color: #7c3aed; border: 1px solid var(--border); }
.creator-btn.secondary:hover { background: #f5f3ff; }

.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: #3b82f6; }
.footer-copyright { font-size: 13px; color: var(--muted); }

.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; border: none; border-radius: 10px; font-size: 18px; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s; }
.back-to-top.show { opacity: 1; visibility: visible; }

@media (max-width: 768px) {
    .zone-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 大厅页面专用wrapper */
.hall-wrapper {
    max-width: 1400px;
    margin: 0 -24px;
    padding: 32px 24px 64px;
}
