/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #A0522D;
  --primary-dark: #8B4513;
  --primary-light: #D2691E;
  --primary-bg: #FDF6EE;
  --accent: #D97706;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --white: #ffffff;
  --bg: #FAFAF8;
  --bg-section: #F5F0E8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(250,250,248,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229,231,235,.6);
  transition: all .3s ease;
}
.navbar.scrolled {
  background: rgba(250,250,248,.98);
  box-shadow: var(--shadow-sm);
}
.nav-container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; gap: 40px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.logo-text {
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}
.logo-sub {
  font-size: 12px; color: #444;
  padding: 2px 8px;
  background: var(--bg-section);
  border-radius: 20px;
}
.nav-links {
  display: flex; align-items: center; gap: 32px;
  margin-left: auto;
}
.nav-links a {
  font-size: 15px; color: var(--text-secondary);
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--primary);
  transform: scaleX(0);
  transition: transform .2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-login {
  font-size: 15px; color: #bbb;
  padding: 8px 16px; border-radius: 8px;
  transition: all .2s;
}
.btn-login:hover { color: #bbb; background: var(--bg-section); }
.btn-login-disabled { cursor: not-allowed; position: relative; display: inline-block; }
.btn-login-disabled:hover::after {
  content: '抱歉，暂未开放！';
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
}
.btn-trial {
  font-size: 15px; font-weight: 600;
  color: white;
  background: var(--primary);
  padding: 8px 20px; border-radius: 8px;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(160,82,45,.3);
}
.btn-trial:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(160,82,45,.4); }

/* 联系官方悬停二维码 */
.btn-trial-qr {
  position: relative;
  cursor: default;
  display: inline-block;
}
.nav-qrcode {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  padding: 12px 12px 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 200;
  white-space: nowrap;
}
.nav-qrcode::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 24px;
  border: 6px solid transparent;
  border-bottom-color: #fff;
}
.nav-qrcode img { display: block; width: 160px; height: auto; border-radius: 4px; }
.nav-qrcode-label { font-size: 12px; color: #666; }
.btn-trial-qr:hover .nav-qrcode { opacity: 1; pointer-events: auto; }

.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all .3s; }
.mobile-menu { display: none; padding: 16px 24px 20px; border-top: 1px solid var(--border-light); }
.mobile-menu a { display: block; padding: 10px 0; font-size: 15px; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }
.mobile-menu a:last-child { border-bottom: none; }
.mobile-trial { color: var(--primary) !important; font-weight: 600; }
.mobile-login-disabled {
  display: block; padding: 10px 0; font-size: 15px;
  color: #bbb; border-bottom: 1px solid var(--border-light);
  cursor: not-allowed;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary);
  color: white; font-size: 16px; font-weight: 600;
  padding: 14px 28px; border-radius: 10px;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(160,82,45,.35);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(160,82,45,.45); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: white;
  color: var(--text-primary); font-size: 16px; font-weight: 500;
  padding: 14px 28px; border-radius: 10px;
  border: 1.5px solid var(--border);
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

/* ===== Section Shared ===== */
.section-container { max-width: 1200px; margin: 0 auto; padding: 80px 24px; }
.section-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--primary);
  background: rgba(160,82,45,.08);
  padding: 6px 14px; border-radius: 20px;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 12px;
}
.section-desc {
  font-size: 17px; color: var(--text-secondary);
  max-width: 560px;
}

/* ===== Form ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 12px 16px;
  font-size: 15px; font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: white;
  transition: all .2s;
  outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(160,82,45,.1); }
.form-input::placeholder { color: var(--text-muted); }

/* ===== Auth Pages ===== */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; }
.auth-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { font-size: 15px; color: var(--text-secondary); margin-bottom: 32px; }
.auth-link { color: var(--primary); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== Admin Layout ===== */
.admin-layout {
  display: flex; min-height: 100vh;
  background: #F4F5F7;
}
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 8px; margin: 16px 0 6px;
}
.nav-section-title:first-child { margin-top: 0; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px; color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 2px;
  text-decoration: none;
}
.sidebar-item:hover { background: var(--bg-section); color: var(--text-primary); }
.sidebar-item.active { background: rgba(160,82,45,.1); color: var(--primary); font-weight: 600; }
.sidebar-item svg { flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto;
  background: var(--primary); color: white;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
}
.admin-main {
  margin-left: 240px; flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: fixed; top: 0; left: 240px; right: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.page-breadcrumb { font-size: 14px; color: var(--text-muted); }
.page-breadcrumb span { color: var(--text-primary); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all .15s;
  position: relative;
}
.topbar-icon-btn:hover { background: var(--bg-section); color: var(--text-primary); }
.topbar-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: #EF4444; border-radius: 50%;
  border: 2px solid white;
}
.admin-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.admin-content { flex: 1; padding: 92px 28px 28px; overflow-auto; }

/* ===== Admin Cards ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; margin-bottom: 28px; }
.admin-stat-card {
  background: white; border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border-light);
  transition: box-shadow .2s;
}
.admin-stat-card:hover { box-shadow: var(--shadow-md); }
.admin-stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-stat-label { font-size: 13px; color: var(--text-secondary); }
.admin-stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.admin-stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.admin-stat-change { font-size: 13px; margin-top: 6px; }
.change-up { color: #16A34A; }
.change-down { color: #DC2626; }

.admin-card {
  background: white; border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.admin-card-header {
  padding: 18px 22px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}
.admin-card-title { font-size: 15px; font-weight: 600; }
.admin-card-body { padding: 0; }



/* ===== Table ===== */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 12px 16px;
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border-light);
}
.admin-table td {
  padding: 10px 16px;
  font-size: 14px; color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFAFA; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-success { background: #DCFCE7; color: #16A34A; }
.badge-warning { background: #FEF9C3; color: #CA8A04; }
.badge-error   { background: #FEE2E2; color: #DC2626; }
.badge-info    { background: #DBEAFE; color: #2563EB; }
.badge-gray    { background: #F3F4F6; color: #6B7280; }
.badge-primary { background: rgba(160,82,45,.12); color: var(--primary); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .mobile-menu-btn { display: flex; margin-left: auto; }
  .mobile-menu.open { display: block; }
  .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}
