/* ==========================================================================
   AU 发卡网 · PHP 版主题（复刻原 Node 站暗色 + 荧光绿 + 玻璃拟态）
   ========================================================================== */

:root {
  --bg-primary: #0a0c14;
  --bg-secondary: #111420;
  --bg-tertiary: #1a1f2e;

  --accent-primary: #d4ff3f;
  --accent-cyan: #5ce1e6;
  --accent-pink: #ff5c8a;
  --accent-amber: #ffb547;

  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(17, 20, 32, 0.6);
  --radius: 0.5rem;

  --font-sans: 'Inter', 'system-ui', '-apple-system', 'BlinkMacSystemFont',
    'Helvetica Neue', 'Tahoma', 'PingFang SC', 'Microsoft Yahei', 'Arial', sans-serif;
}

[data-theme='light'] {
  --bg-primary: #dfe4ee;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border-color: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.7);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { position: relative; overflow-x: hidden; }

/* 背景光斑层 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(92, 225, 230, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(255, 92, 138, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 70%, rgba(212, 255, 63, 0.08) 0%, transparent 50%);
}

#app { position: relative; z-index: 1; min-height: 100vh; }

::selection { background-color: var(--accent-primary); color: #0a0c14; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- 布局 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main { padding: 88px 16px 96px; }
@media (min-width: 640px) { .main { padding: 80px 24px 40px; } }

footer.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: auto;
}
footer .footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  color: var(--text-muted); font-size: 14px;
}
@media (min-width: 768px) {
  footer .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* ---------- 顶部胶囊导航 ---------- */
.topnav {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 50; width: calc(100% - 24px); max-width: 600px;
}
@media (min-width: 640px) { .topnav { top: 16px; width: calc(100% - 32px); } }

.glass-pill {
  display: flex; align-items: center; gap: 4px;
  height: 48px; padding: 6px; overflow: hidden;
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--border-color); border-radius: 999px;
}
@media (min-width: 640px) { .glass-pill { height: 44px; padding: 8px; } }

.nav-logo {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  height: 36px; width: 36px; border-radius: 8px;
  background: var(--accent-primary); color: #0a0c14; font-weight: 900; font-size: 14px;
}
.nav-menu { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.nav-link {
  display: flex; align-items: center; height: 40px; flex: 0 0 auto;
  border-radius: 999px; padding: 0 12px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); transition: all .2s;
}
.nav-link:hover { color: var(--text-primary); background: var(--border-color); }
.nav-link.active {
  background: var(--accent-primary); color: #0a0c14;
  box-shadow: 0 10px 20px rgba(212,255,63,.2);
}
@media (min-width: 640px) { .nav-link { padding: 0 16px; font-size: 14px; } }

.nav-right { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  height: 36px; width: 36px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(26,31,46,.5); color: var(--text-secondary); transition: all .2s;
}
.icon-btn:hover { background: var(--border-color); color: var(--text-primary); }
.user-chip {
  height: 36px; max-width: 88px; flex: 0 0 auto; display: flex; align-items: center;
  border-radius: 999px; padding: 0 14px; font-size: 13px; font-weight: 600;
  background: var(--accent-primary); color: #0a0c14;
}

/* ---------- 玻璃卡片 ---------- */
.glass-card {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--border-color); border-radius: var(--radius);
}
.card { padding: 20px; }
.section-title { font-size: 18px; font-weight: 700; margin: 0 0 16px; }

/* ---------- 按钮 ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border: 0; border-radius: var(--radius);
  background: var(--accent-primary); color: #0a0c14; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all .2s; box-shadow: 0 10px 20px rgba(212,255,63,.2);
}
.btn-primary:hover { background: rgba(212,255,63,.9); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 1px solid var(--border-color); border-radius: var(--radius);
  background: transparent; color: var(--text-primary); font-weight: 500; font-size: 14px; cursor: pointer;
}
.btn-ghost:hover { background: var(--border-color); }
.btn-danger { background: var(--accent-pink); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; color: var(--text-secondary); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-color); background: var(--bg-tertiary);
  color: var(--text-primary); font-size: 15px; outline: none;
}
.textarea { min-height: 100px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-primary); }
.input::placeholder { color: var(--text-muted); }

/* ---------- 商品网格 ---------- */
.product-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product-card { overflow: hidden; transition: transform .2s, border-color .2s; }
.product-card:hover { transform: translateY(-2px); border-color: rgba(212,255,63,.3); }
.product-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-tertiary); }
.product-body { padding: 16px; }
.product-name { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.product-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { color: var(--accent-primary); font-weight: 700; font-size: 18px; }

/* ---------- 规格选项 ---------- */
.spec-list { display: flex; flex-direction: column; gap: 10px; }
.spec-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius);
  background: var(--bg-tertiary); cursor: pointer;
}
.spec-item.active { border-color: var(--accent-primary); background: rgba(212,255,63,.08); }
.spec-name { font-weight: 600; }
.spec-meta { display: flex; align-items: center; gap: 12px; }

/* ---------- 徽章 / 状态 ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.badge-green { background: rgba(212,255,63,.15); color: var(--accent-primary); }
.badge-cyan { background: rgba(92,225,230,.15); color: var(--accent-cyan); }
.badge-pink { background: rgba(255,92,138,.15); color: var(--accent-pink); }
.badge-amber { background: rgba(255,181,71,.15); color: var(--accent-amber); }
.badge-muted { background: var(--border-color); color: var(--text-secondary); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--border-color); text-align: left; }
.data-table th { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.data-table td { color: var(--text-primary); }

/* ---------- 空态 ---------- */
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.empty-state h3 { margin: 8px 0; color: var(--text-secondary); }

/* ---------- 后台布局 ---------- */
.admin-tabs {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 40;
  width: calc(100% - 24px); max-width: 600px; display: flex; gap: 8px;
  overflow-x: auto; padding: 4px;
}
.admin-tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 999px; font-size: 13px;
  color: var(--text-secondary); background: var(--glass-bg); border: 1px solid var(--border-color);
  white-space: nowrap;
}
.admin-tab.active { background: var(--accent-primary); color: #0a0c14; }

.admin-page { padding-top: 120px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 260px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { padding: 20px; }
.stat-num { font-size: 24px; font-weight: 800; color: var(--accent-primary); }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ---------- 弹窗 / 抽屉 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box { width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-body { padding: 20px; }

/* ---------- 悬浮按钮 ---------- */
.float-contact {
  position: fixed; right: 16px; bottom: 96px; z-index: 40;
  height: 52px; width: 52px; border-radius: 999px; border: 1px solid var(--border-color);
  background: var(--glass-bg); backdrop-filter: blur(12px); color: var(--accent-primary);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}

/* ---------- 安装页 ---------- */
.install-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.install-wrap { width: 100%; max-width: 480px; }
.install-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 20px; }
.install-box { padding: 24px; }
.install-form { display: flex; flex-direction: column; gap: 14px; }
.install-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-secondary); }
.install-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.install-error { background: rgba(255,92,138,.12); border: 1px solid var(--accent-pink); color: var(--accent-pink); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.install-warn { background: rgba(255,181,71,.12); border: 1px solid var(--accent-amber, #ffb547); color: var(--accent-amber, #ffb547); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.install-note { font-size: 12px; line-height: 1.6; color: var(--text-muted); margin-top: -4px; }
.install-note code { color: var(--accent-primary); background: rgba(212,255,63,.1); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.ok-text { color: var(--accent-primary); margin-bottom: 16px; }

/* ---------- 通用 ---------- */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.flex { display: flex; } .flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
