/* ============================================================
   PipeSurvey — 后端管理 UI
   设计风格: 简洁现代，参考 Sketch.com 的干净留白与层次感
   ============================================================ */

/* ========== CSS 变量 ========== */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #3B82F6;
  --primary-subtle: #EFF6FF;
  --gradient: linear-gradient(135deg, #2563EB 0%, #7C3AED 50%, #EC4899 100%);
  --gradient-subtle: linear-gradient(135deg, #EFF6FF 0%, #F5F3FF 100%);

  --success: #10B981;
  --success-bg: #ECFDF5;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;

  --bg: #F8FAFC;
  --bg-alt: #F1F5F9;
  --card-bg: #FFFFFF;
  --card-border: #E2E8F0;

  --text: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --text-inverse: #FFFFFF;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.10);

  --nav-height: 64px;
  --sidebar-width: 220px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ========== 导航栏 ========== */
nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
}
nav .logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-inverse);
  letter-spacing: -0.01em;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
nav .logo::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--gradient);
  border-radius: 50%;
}
nav .nav-link {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
nav .nav-link:hover {
  color: #fff;
  border-bottom-color: var(--primary-light);
  text-decoration: none;
}
nav .nav-link.active {
  color: #fff;
  border-bottom-color: var(--primary-light);
}
#nav-auth {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ========== 容器 ========== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

.container-narrow {
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}
.card:hover {
  box-shadow: var(--shadow-lg);
}
.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
.card-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

/* ========== 页面头部 ========== */
.page-header {
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-header p {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font);
  background: var(--card-bg);
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}
.form-group textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}
.form-group .hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
  line-height: 1.5;
}

/* 用户名特殊状态 */
.username-wrapper { position: relative; }
.username-status {
  font-size: 12px; margin-top: 4px; min-height: 18px;
}
.username-status.ok { color: var(--success); }
.username-status.error { color: var(--danger); }
.username-status.checking { color: var(--text-tertiary); }

/* 选填标签 */
.optional-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-alt);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 400;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  width: 100%;
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  color: #fff;
  text-decoration: none;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1.5px solid var(--card-border);
}
.btn-secondary:hover {
  background: #fff;
  border-color: var(--text-tertiary);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0 12px;
}
.btn-ghost:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  color: #fff;
  text-decoration: none;
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  color: #fff;
  text-decoration: none;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-xs {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 500;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.btn-xs:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-xs.danger { color: var(--danger); border-color: transparent; background: var(--danger-bg); }
.btn-xs.danger:hover { background: var(--danger); color: #fff; }
.btn-xs.success { color: var(--success); border-color: transparent; background: var(--success-bg); }
.btn-xs.success:hover { background: var(--success); color: #fff; }
.btn-xs.primary { color: var(--primary); border-color: transparent; background: var(--primary-subtle); }
.btn-xs.primary:hover { background: var(--primary); color: #fff; }

.btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ========== 提示 ========== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert::before {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.alert-error {
  background: var(--danger-bg);
  color: #991B1B;
  border: 1px solid #FECACA;
}
.alert-error::before { content: '⚠'; }
.alert-success {
  background: var(--success-bg);
  color: #065F46;
  border: 1px solid #A7F3D0;
}
.alert-success::before { content: '✓'; }
.alert-info {
  background: var(--primary-subtle);
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}
.alert-info::before { content: 'ℹ'; }

/* ========== 状态徽标 ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.status-active {
  background: var(--success-bg);
  color: #065F46;
}
.status-active::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
}
.status-disabled {
  background: var(--danger-bg);
  color: #991B1B;
}
.status-disabled::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--danger);
  border-radius: 50%;
}
.status-expired {
  background: var(--warning-bg);
  color: #92400E;
}
.status-expired::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--warning);
  border-radius: 50%;
}
.status-pending {
  background: var(--warning-bg);
  color: #92400E;
}
.status-pending::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--warning);
  border-radius: 50%;
}

/* ========== 信息行 ========== */
.info-grid {
  display: grid;
  gap: 0;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
}
.info-row:last-child { border-bottom: none; }
.info-row .label {
  color: var(--text-secondary);
  font-size: 14px;
}
.info-row .value {
  font-weight: 600;
  font-size: 14px;
}

/* ========== 表格 ========== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}
td { color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
th {
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
tr:hover td {
  background: #FAFBFC;
}

/* ========== 英雄区（首页） ========== */
.hero {
  text-align: center;
  padding: 36px 24px 16px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, rgba(124,58,237,0.05) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  position: relative;
}
.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
  position: relative;
}
.hero .btn {
  width: auto;
  min-width: 160px;
  margin: 0 8px;
}

/* ========== 特性网格（首页） ========== */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 16px;
}
.feature {
  text-align: center;
  padding: 28px 20px;
  cursor: default;
  transition: all var(--transition-slow);
  animation: featureIn 0.5s ease both;
}
.feature:hover {
  transform: translateY(-6px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-xl);
}
.feature .icon {
  font-size: 36px;
  margin-bottom: 14px;
  display: block;
  transition: transform var(--transition);
}
.feature:hover .icon {
  transform: scale(1.18);
}
.feature h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  transition: color var(--transition);
}
.feature:hover h3 {
  color: var(--primary);
}
.feature p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

@keyframes featureIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.feature:nth-child(1) { animation-delay: 0.00s; }
.feature:nth-child(2) { animation-delay: 0.06s; }
.feature:nth-child(3) { animation-delay: 0.12s; }
.feature:nth-child(4) { animation-delay: 0.18s; }
.feature:nth-child(5) { animation-delay: 0.24s; }
.feature:nth-child(6) { animation-delay: 0.30s; }
.feature:nth-child(7) { animation-delay: 0.36s; }
.feature:nth-child(8) { animation-delay: 0.42s; }
.feature:nth-child(9) { animation-delay: 0.48s; }
.feature:nth-child(10) { animation-delay: 0.54s; }
.feature:nth-child(11) { animation-delay: 0.60s; }
.feature:nth-child(12) { animation-delay: 0.66s; }
.feature:nth-child(13) { animation-delay: 0.72s; }
.feature:nth-child(14) { animation-delay: 0.78s; }
.feature:nth-child(15) { animation-delay: 0.84s; }
.feature:nth-child(16) { animation-delay: 0.90s; }

/* ========== 更新日志 ========== */
.changelog-entry {
  padding: 20px 0;
  border-bottom: 1px solid var(--card-border);
}
.changelog-entry:last-child { border-bottom: none; }
.changelog-entry .version {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.changelog-entry .version::before {
  content: '#';
  color: var(--text-tertiary);
  margin-right: 4px;
  font-weight: 400;
}
.changelog-entry .date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.changelog-entry ul {
  margin-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

/* ========== 登录/注册页专用 ========== */
.auth-container {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  position: relative;
}
.auth-container::before {
  content: '';
  position: fixed;
  top: -400px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, rgba(124,58,237,0.04) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.auth-card .auth-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
}
.auth-card .auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-card .auth-footer a {
  font-weight: 600;
}

/* QQ 群提示 */
.qq-tip {
  background: var(--warning-bg);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 20px;
  font-size: 13px;
  color: #92400E;
  line-height: 1.8;
}
.qq-tip b { color: var(--warning); }

/* ========== 底部提示 ========== */
.bottom-message {
  text-align: center;
  padding: 28px 24px;
  margin-top: 12px;
  background: var(--gradient-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
}
.bottom-message .bottom-message-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}
.bottom-message p {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.6;
}

/* ========== 联系我 ========== */
.contact-section {
  text-align: center;
  padding: 24px;
  margin-top: 20px;
}
.contact-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.contact-items {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.contact-item {
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-alt);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.contact-item:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* ========== 页脚 ========== */
footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ========== 管理后台 ========== */
.admin-wrapper {
  display: flex;
  min-height: calc(100vh - var(--nav-height));
}
.sidebar {
  width: var(--sidebar-width);
  background: var(--card-bg);
  border-right: 1px solid var(--card-border);
  padding: 16px 0;
  flex-shrink: 0;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidebar a:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none;
}
.sidebar a.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.main-content {
  flex: 1;
  padding: 32px;
  overflow-x: auto;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card .num {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.stat-card .label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 500;
}
.stat-card.warn .num { color: var(--warning); }
.stat-card.danger .num { color: var(--danger); }

/* 邀请码盒子 */
.invite-code-box {
  background: var(--gradient-subtle);
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}
.invite-code-box .code-text {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--primary);
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 420px;
  max-width: 100%;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text);
}
.modal-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}
.plan-group, .expiry-group {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.plan-btn, .expiry-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.plan-btn:hover, .expiry-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.plan-btn.active, .expiry-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.modal-footer {
  display: flex; gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.modal-footer .btn { width: auto; }
.expiry-preview {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 8px;
  min-height: 20px;
}

/* ========== 工具提示 ========== */
.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tip);
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.tooltip:hover::after { opacity: 1; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  nav { padding: 0 16px; gap: 16px; }
  .hide-mobile { display: none; }
  #nav-auth { gap: 16px; }
  .container { padding: 20px 16px; }
  .container-narrow { padding: 24px 16px; }

  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .hero { padding: 24px 16px 12px; }

  .card { padding: 20px; border-radius: var(--radius-md); }
  .auth-card { padding: 28px 24px; }
  .page-header h1 { font-size: 22px; }

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

  .admin-wrapper { flex-direction: column; }
  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    gap: 4px;
  }
  .sidebar a {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 14px;
    font-size: 13px;
  }
  .sidebar a:hover,
  .sidebar a.active {
    border-left: none;
    border-bottom-color: var(--primary);
  }
  .main-content { padding: 20px 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  nav .nav-link { font-size: 13px; }
  .hero h1 { font-size: 24px; }
  .stats-grid { grid-template-columns: 1fr; }

  /* 表格操作按钮保持在一行 */
  .table-wrapper .btn-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
  }
  .table-wrapper .btn-xs {
    padding: 0 6px;
    font-size: 11px;
    height: 26px;
    white-space: nowrap;
  }
}
