/* ============================
   LinkHub - Design System v2
   Mobile-first responsive
   ============================ */

:root {
  /* Brand Colors */
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --primary-bg: #EEF0FF;
  --secondary: #00CEC9;
  --secondary-dark: #00B5B0;
  --accent: #FD79A8;
  --accent-dark: #E84393;

  /* Semantic Colors */
  --success: #00B894;
  --success-bg: #E6F9F3;
  --warning: #FDCB6E;
  --warning-bg: #FFF5E1;
  --danger: #FF7675;
  --danger-bg: #FFF0F0;
  --info: #74B9FF;
  --info-bg: #EBF6FF;

  /* Neutral Colors */
  --bg: #F8F9FD;
  --surface: #FFFFFF;
  --surface-alt: #FAFBFE;
  --border: #E8EAF0;
  --border-light: #F0F2F8;
  --text: #1A1D29;
  --text-secondary: #5C6070;
  --text-muted: #9CA3B8;
  --text-inverse: #FFFFFF;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
  --gradient-secondary: linear-gradient(135deg, #00CEC9 0%, #74B9FF 100%);
  --gradient-accent: linear-gradient(135deg, #FD79A8 0%, #FDCB6E 100%);
  --gradient-hero: linear-gradient(135deg, #6C5CE7 0%, #8E7CF5 50%, #00CEC9 100%);
  --gradient-card: linear-gradient(135deg, #6C5CE7 0%, #00CEC9 100%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 29, 41, 0.04);
  --shadow-sm: 0 2px 8px rgba(26, 29, 41, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 29, 41, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 29, 41, 0.10);
  --shadow-xl: 0 16px 48px rgba(26, 29, 41, 0.12);
  --shadow-glow: 0 0 24px rgba(108, 92, 231, 0.25);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================
   Reset & Base
   ============================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

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

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

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 16px; /* Prevent iOS zoom */
}

ul, ol {
  list-style: none;
}

/* ============================
   Layout Utilities
   ============================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-wide {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.col {
  flex: 1;
  min-width: 0;
}

/* Grid system - default: 1 column */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 16px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.hide-mobile { display: none; }
.show-mobile { display: block; }

/* ============================
   Typography
   ============================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 1rem; }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.lead {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================
   Buttons
   ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  min-height: 44px; /* Touch target */
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  color: var(--text-inverse);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 16px;
}

.btn-ghost:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}

.btn-danger:hover { background: #FF6B6A; }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================
   Cards
   ============================ */

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 20px;
}

.card-pad-lg {
  padding: 24px;
}

/* ============================
   Navbar
   ============================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}

.navbar-logo:hover { color: var(--text); }

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.navbar-menu {
  display: none; /* Hidden on mobile */
}

.navbar-menu a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.navbar-menu a:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.navbar-menu.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid var(--border-light);
  z-index: 999;
}

.navbar-menu.open a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.navbar-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.navbar-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================
   Sidebar & App Layout
   ============================ */

.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-100%);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-mask.active {
  display: block;
  opacity: 1;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  min-height: 44px;
  min-width: 44px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-header .navbar-logo {
  font-size: 1.15rem;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-nav .nav-section {
  margin-bottom: 8px;
}

.sidebar-nav .nav-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 10px 4px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
  margin-bottom: 2px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-nav .nav-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.sidebar-nav .nav-item.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.sidebar-nav .nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.sidebar-user:hover {
  background: var(--surface-alt);
}

.sidebar-user .avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* #140：退出登录仅图标，放在左下角用户区右侧，紧贴名字 */
.sidebar-logout {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.sidebar-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.main-content {
  flex: 1;
  margin-left: 0;
  padding: 20px 16px;
  min-width: 0;
  width: 100%;
}

.mobile-menu-btn {
  display: inline-flex;
  margin-bottom: 16px;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.4rem;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 2px;
}

.page-header .header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.page-header .header-actions .btn {
  flex: 1;
  min-width: auto;
}

/* ============================
   Stats Cards
   ============================ */

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-card .stat-icon.purple { background: var(--primary-bg); color: var(--primary); }
.stat-card .stat-icon.teal { background: #E6FFFA; color: var(--secondary); }
.stat-card .stat-icon.pink { background: #FFF0F6; color: var(--accent); }
.stat-card .stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-card .stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning-bg); color: #E17055; }

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================
   Tables (mobile: horizontal scroll)
   ============================ */

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;           /* 移动端表格可左右拖动 */
  -webkit-overflow-scrolling: touch;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

table tr:last-child td {
  border-bottom: none;
}

table tbody tr {
  transition: background var(--transition);
}

table tbody tr:hover {
  background: var(--surface-alt);
}

/* ============================
   Badges & Tags
   ============================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: #E17055; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gray { background: var(--border-light); color: var(--text-muted); }

/* ============================
   Forms
   ============================ */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================
   Modal
   ============================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 41, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  min-height: 44px;
  min-width: 44px;
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

/* ============================
   Progress
   ============================ */

.progress {
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ============================
   Avatar
   ============================ */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.72rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.05rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.3rem; }

/* ============================
   Link Card
   ============================ */

.link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 8px;
  min-height: 52px;
}

.link-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.link-card .link-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.link-card .link-info {
  flex: 1;
  min-width: 0;
}

.link-card .link-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.link-card .link-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================
   Timeline
   ============================ */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 3px solid var(--primary);
  z-index: 1;
}

.timeline-item.completed .timeline-dot {
  background: var(--primary);
}

.timeline-item.completed .timeline-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 4px;
  border-left: 1.5px solid white;
  border-bottom: 1.5px solid white;
  rotate: -45deg;
  margin-top: -1px;
}

.timeline-date {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0 4px;
}

.timeline-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================
   Switch Toggle
   ============================ */

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.switch.active { background: var(--primary); }

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition);
  box-shadow: var(--shadow-xs);
}

.switch.active::after {
  transform: translateX(20px);
}

/* ============================
   Tab Bar
   ============================ */

.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}

.tab-item:hover { color: var(--primary); }

.tab-item.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================
   Section Spacing
   ============================ */

.section {
  padding: 48px 0;
}

.section-sm {
  padding: 32px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ============================
   Hero
   ============================ */

.hero {
  position: relative;
  padding: 48px 0 32px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.08), transparent 70%);
  border-radius: 50%;
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 206, 201, 0.06), transparent 70%);
  border-radius: 50%;
}

.hero-content {
  max-width: 100%;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero .lead {
  font-size: 1rem;
  margin-bottom: 24px;
  max-width: 100%;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-actions .btn {
  width: 100%;
  justify-content: center;
}

.hero .social-proof {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}

.hero-visual {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

/* ============================
   Feature Card
   ============================ */

.feature-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  height: 100%;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.feature-icon.purple { background: var(--primary-bg); color: var(--primary); }
.feature-icon.teal { background: #E6FFFA; color: var(--secondary); }
.feature-icon.pink { background: #FFF0F6; color: var(--accent); }
.feature-icon.blue { background: var(--info-bg); color: var(--info); }
.feature-icon.green { background: var(--success-bg); color: var(--success); }
.feature-icon.orange { background: var(--warning-bg); color: #E17055; }

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================
   Pricing
   ============================ */

.pricing-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.pricing-card.featured::before {
  content: '推荐';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.pricing-card .plan-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pricing-card .plan-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.pricing-card .plan-price .currency {
  font-size: 1.2rem;
  vertical-align: top;
}

.pricing-card .plan-price .period {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-card .plan-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.pricing-features {
  flex: 1;
  margin-bottom: 24px;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pricing-features li .check {
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.pricing-features li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ============================
   Toast (mobile-friendly)
   ============================ */

.toast-container {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
  width: 100%;
  border-left: 4px solid var(--primary);
  animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast .toast-icon { font-size: 1.1rem; }
.toast .toast-msg { font-size: 0.88rem; color: var(--text); }

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================
   Phone Preview
   ============================ */

.phone-preview {
  width: 280px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 6px solid #1a1d29;
  position: relative;
}

.phone-header {
  background: var(--gradient-primary);
  padding: 28px 20px 22px;
  text-align: center;
  color: white;
}

.phone-header .phone-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.phone-header .phone-name {
  font-size: 1rem;
  font-weight: 700;
}

.phone-header .phone-bio {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 2px;
}

.phone-body {
  padding: 12px;
  max-height: 340px;
  overflow-y: auto;
}

/* ============================
   Chart Bars
   ============================ */

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding: 8px 0;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 24px;
}

.chart-bar .bar {
  width: 100%;
  max-width: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  transition: height 0.6s ease;
  position: relative;
  min-height: 3px;
}

.chart-bar:hover .bar { opacity: 0.85; }

.chart-bar .bar-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================
   Commission Tree
   ============================ */

.commission-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
}

.commission-level { text-align: center; }

.commission-level .level-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  margin: 0 auto 8px;
}

.commission-level.l1 .level-circle { background: var(--gradient-primary); }
.commission-level.l2 .level-circle { background: var(--gradient-secondary); }
.commission-level.l3 .level-circle { background: var(--gradient-accent); }

.commission-level .level-label { font-size: 0.82rem; font-weight: 600; }
.commission-level .level-rate { font-size: 1.1rem; font-weight: 800; margin: 2px 0; }

.commission-arrow {
  font-size: 1.3rem;
  color: var(--text-muted);
  transform: rotate(90deg);
}

/* ============================
   Quick Actions
   ============================ */

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  min-height: 60px;
}

.quick-action:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.quick-action .qa-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.quick-action .qa-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.quick-action .qa-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================
   Referral / Promo
   ============================ */

.promo-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.promo-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1.5px dashed var(--border);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.promo-link-box .promo-url {
  flex: 1;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ============================
   Balance Card
   ============================ */

.balance-card {
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.balance-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.balance-card .bl-amount {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
}

.balance-card .bl-stats {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.balance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

/* Earnings withdraw grid - 1.2fr / 1fr on desktop, stacked on mobile */
.grid-withdraw { grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-withdraw { grid-template-columns: 1fr 1.2fr; } }

/* Balance card stats row - wraps on mobile */
.bl-stats { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }

/* Promo QR row - stacks on mobile */
.promo-qr-row { display: flex; gap: 16px; align-items: center; flex-direction: column; }
.promo-qr-preview {
  width: 140px; height: 140px;
  background: var(--surface-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}
@media (min-width: 600px) {
  .promo-qr-row { flex-direction: row; }
  .promo-qr-preview { width: 160px; height: 160px; }
}

/* ============================
   CTA Section
   ============================ */

.cta-section {
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-section h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.cta-section .cta-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
}

/* ============================
   Admin Additional
   ============================ */

.revenue-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 12px 0;
}

.revenue-bar > div {
  transition: opacity var(--transition);
  cursor: pointer;
}

.revenue-bar > div:hover { opacity: 0.8; }

.risk-alert {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--danger);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.risk-alert.high { border-left-color: var(--danger); }
.risk-alert.medium { border-left-color: var(--warning); }
.risk-alert.low { border-left-color: var(--info); }

.risk-alert .risk-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.withdraw-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 12px;
}

.config-section {
  margin-bottom: 28px;
}

.config-section > h3 {
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* ============================
   FAQ
   ============================ */

.faq-hero {
  background: var(--gradient-hero);
  padding: 48px 0 36px;
  text-align: center;
  color: white;
}

.faq-hero h1 { font-size: 1.8rem; margin-bottom: 6px; }
.faq-hero p { font-size: 0.92rem; opacity: 0.85; margin-bottom: 20px; }

.faq-search {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  padding: 0 16px;
}

.faq-search input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 16px;
  outline: none;
}

.faq-search .search-icon {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

.faq-content {
  padding: 32px 16px;
  max-width: 900px;
  margin: 0 auto;
}

.faq-section { margin-bottom: 40px; }
.faq-section h2 { font-size: 1.2rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.faq-section .section-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }

.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--surface);
  overflow: hidden;
}

.faq-q {
  padding: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.faq-q .arrow { transition: transform 0.25s; font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; margin-left: 8px; }
.faq-q .q-badge { background: var(--primary-bg); color: var(--primary); padding: 2px 7px; border-radius: var(--radius-xs); font-size: 0.72rem; font-weight: 600; margin-right: 8px; flex-shrink: 0; }
.faq-a { padding: 0 16px 16px; display: none; color: var(--text-secondary); font-size: 0.85rem; line-height: 1.7; }
.faq-a p { margin-bottom: 8px; }
.faq-a ul { padding-left: 16px; margin: 6px 0; }
.faq-a li { margin-bottom: 3px; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .arrow { transform: rotate(180deg); }
.faq-item.open { border-color: var(--primary); }

.guide-steps { counter-reset: step; list-style: none; padding: 0; }
.guide-steps li {
  counter-increment: step;
  padding: 14px 14px 14px 48px;
  position: relative;
  margin-bottom: 8px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
  font-size: 0.85rem;
}

.guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 14px;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
}

.platform-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.platform-tabs::-webkit-scrollbar { display: none; }

.platform-tab {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.platform-tab:hover { border-color: var(--primary); color: var(--primary); }
.platform-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.platform-guide { display: none; }
.platform-guide.active { display: block; }

.highlight-box {
  background: var(--primary-bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.83rem;
}

/* ============================
   Dashboard specific
   ============================ */

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 0.84rem; font-weight: 500; color: var(--text); }
.activity-time { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

.page-preview-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.page-preview-mini:hover { box-shadow: var(--shadow-sm); }

.page-preview-mini .pp-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.page-preview-mini .pp-info { flex: 1; min-width: 0; }
.page-preview-mini .pp-name { font-size: 0.88rem; font-weight: 600; }
.page-preview-mini .pp-url { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-preview-mini .pp-stats { display: flex; gap: 12px; margin-top: 2px; flex-wrap: wrap; }
.page-preview-mini .pp-stat { font-size: 0.72rem; color: var(--text-secondary); }
.page-preview-mini .pp-stat strong { color: var(--text); }

/* ============================
   Builder - mobile stacked layout
   ============================ */

.builder-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.builder-panel-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-light);
  margin-bottom: 0;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.builder-panel-tabs::-webkit-scrollbar { display: none; }

.builder-panel-tab {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}

.builder-panel-tab.active {
  background: var(--gradient-primary);
  color: white;
}

.builder-panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: none;
}

.builder-panel.active {
  display: block;
}

.builder-center {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-header h3 { font-size: 0.95rem; }

.panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.page-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 6px;
  border: 1.5px solid transparent;
}

.page-list-item:hover { background: var(--surface-alt); }
.page-list-item.active { background: var(--primary-bg); border-color: var(--primary); }

.page-list-item .pl-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.page-list-item .pl-info { flex: 1; min-width: 0; }
.page-list-item .pl-name { font-size: 0.84rem; font-weight: 600; }
.page-list-item .pl-stats { font-size: 0.72rem; color: var(--text-muted); }

.editor-section { margin-bottom: 20px; }

.editor-section-title {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.link-editor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface);
}

.link-editor-item .drag-handle { cursor: grab; color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }
.link-editor-item .le-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.link-editor-item .le-info { flex: 1; min-width: 0; }
.link-editor-item .le-title {
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  width: 100%;
  outline: none;
  background: transparent;
  font-size: 16px; /* iOS zoom fix */
}

.link-editor-item .le-url {
  font-size: 0.74rem;
  color: var(--text-muted);
  border: none;
  width: 100%;
  outline: none;
  background: transparent;
  font-size: 16px;
}

.link-editor-item .le-jump-type {
  font-size: 0.74rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  width: 100%;
  outline: none;
  background: var(--surface);
  padding: 4px 6px;
  margin-top: 4px;
  font-size: 16px;
}

/* Link type pills (replaces ugly select) */
.link-type-pills { display:flex; flex-wrap:wrap; gap:5px; margin:6px 0 2px; }
.link-type-pill { padding:5px 10px; border-radius:var(--radius-xs); font-size:0.7rem; font-weight:600; cursor:pointer; border:1.5px solid var(--border); background:var(--surface); color:var(--text-secondary); transition:all 0.2s; white-space:nowrap; display:inline-flex; align-items:center; gap:3px; }
.link-type-pill:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-bg); }
.link-type-pill.active { background:var(--primary); color:white; border-color:var(--primary); }

/* Image upload area */
.image-upload-area { border:2px dashed var(--border); border-radius:var(--radius-sm); padding:14px; text-align:center; cursor:pointer; transition:all 0.2s; margin:4px 0; background:var(--surface-alt); min-height:40px; display:flex; align-items:center; justify-content:center; }
.image-upload-area:hover { border-color:var(--primary); background:var(--primary-bg); }
.image-upload-area.has-image { border-style:solid; border-color:var(--success); padding:6px; }
.image-upload-area img { max-width:100%; max-height:100px; border-radius:var(--radius-xs); display:block; }

/* Copy button */
.copy-btn { display:inline-flex; align-items:center; gap:3px; padding:4px 10px; border-radius:var(--radius-xs); font-size:0.72rem; font-weight:600; border:1px solid var(--border); background:var(--surface-alt); color:var(--primary); cursor:pointer; transition:all 0.2s; white-space:nowrap; }
.copy-btn:hover { background:var(--primary-bg); }
.copy-btn.copied { background:var(--success-bg); color:var(--success); border-color:var(--success); }

/* App scheme reminder */
.app-reminder { font-size:0.68rem; color:#E17055; margin-top:1px; display:flex; align-items:center; gap:3px; }

/* Click indicator */
.click-indicator { font-size:0.65rem; color:var(--text-muted); display:inline-flex; align-items:center; gap:2px; flex-shrink:0; }
.click-indicator .click-dot { width:5px; height:5px; border-radius:50%; background:var(--primary); display:inline-block; }

/* Link type tag in editor */
.le-type-tag { font-size:0.65rem; padding:1px 6px; border-radius:8px; font-weight:600; display:inline-block; margin-bottom:3px; }
.le-type-tag.tag-url { background:var(--info-bg); color:var(--info); }
.le-type-tag.tag-app { background:var(--warning-bg); color:#E17055; }
.le-type-tag.tag-text { background:#E6FFFA; color:var(--secondary); }
.le-type-tag.tag-qr { background:#FFF0F6; color:var(--accent); }
.le-type-tag.tag-wxid { background:var(--success-bg); color:var(--success); }
.le-type-tag.tag-img { background:var(--primary-bg); color:var(--primary); }

/* QR Code modal */
.qr-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:10000; align-items:center; justify-content:center; }
.qr-modal.active { display:flex; }
.qr-modal-content { background:white; border-radius:var(--radius-lg); padding:28px; text-align:center; max-width:340px; width:90%; }
.qr-modal-content canvas,.qr-modal-content img { margin:0 auto; display:block; }
.qr-modal-content .qr-title { font-size:1rem; font-weight:700; margin:10px 0 4px; }
.qr-modal-content .qr-url { font-size:0.76rem; color:var(--text-muted); margin-bottom:14px; word-break:break-all; }
.qr-modal-content .qr-tip { font-size:0.74rem; color:var(--text-muted); margin-top:10px; }

/* Page view overlay modal */
.pv-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:9999; align-items:center; justify-content:center; padding:20px; }
.pv-overlay.active { display:flex; }
.pv-modal { background:var(--surface); border-radius:var(--radius-lg); max-width:90vw; max-height:85vh; overflow-y:auto; box-shadow:var(--shadow-xl); animation:pvFadeIn 0.25s ease; width:100%; max-width:420px; }
@keyframes pvFadeIn { from{opacity:0;transform:scale(0.9);} to{opacity:1;transform:scale(1);} }
.pv-modal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--border-light); }
.pv-modal-header h3 { font-size:0.95rem; margin:0; }
.pv-modal-close { width:36px; height:36px; border-radius:50%; border:none; background:var(--surface-alt); cursor:pointer; font-size:1rem; color:var(--text-muted); display:flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; }
.pv-modal-close:hover { background:var(--danger-bg); color:var(--danger); }
.pv-modal-body { padding:18px; }
.pv-modal-body img { max-width:100%; border-radius:var(--radius-sm); display:block; margin:0 auto; }
.pv-modal-body .text-content { font-size:0.88rem; line-height:1.8; color:var(--text); white-space:pre-wrap; word-break:break-word; }
.pv-modal-body .qr-img { max-width:240px; margin:0 auto; display:block; }
.pv-modal-body .qr-tip { text-align:center; font-size:0.76rem; color:var(--text-muted); margin-top:10px; }

/* WeChat copy row */
.wechat-copy-row { display:flex; gap:6px; align-items:center; }

.link-editor-item .le-actions { display: flex; gap: 2px; flex-shrink: 0; }

.link-editor-item .le-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.82rem;
  min-height: 44px;
  min-width: 44px;
}

.link-editor-item .le-btn:hover { background: var(--surface-alt); color: var(--text); }
.link-editor-item .le-btn.delete:hover { background: var(--danger-bg); color: var(--danger); }

.theme-color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-color {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
}

.theme-color:hover { transform: scale(1.1); }
.theme-color.active { border-color: var(--text); transform: scale(1.05); }

.icon-picker { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.icon-picker::-webkit-scrollbar { height: 4px; }
.icon-picker::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.icon-option {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: all var(--transition);
}

.icon-option:hover { border-color: var(--primary); }
.icon-option.active { border-color: var(--primary); background: var(--primary-bg); }

.preview-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-label .live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.add-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  min-height: 48px;
  box-sizing: border-box;
  line-height: 1.2;
}

.add-link-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.add-link-row { display: flex; gap: 8px; align-items: stretch; }
.add-link-row .add-link-btn { flex: 1; }
.add-link-row .add-link-btn.guide-btn { flex: 0 0 auto; }

.builder-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.builder-navbar .bn-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* #138：手机端 builder 导航栏优化 —— 按钮紧凑化 + 横向滚动兜底，
   避免发布/下架按钮在窄屏下溢出被遮挡而无法点击 */
@media (max-width: 599px) {
  .builder-navbar {
    height: auto;
    min-height: 56px;
    padding: 8px 10px;
    gap: 6px;
    z-index: 1000;
  }
  .builder-navbar .btn {
    padding: 8px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .builder-navbar .bn-actions {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    gap: 4px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .builder-navbar .bn-actions::-webkit-scrollbar { display: none; }
}

/* ============================
   Auth Pages (Login/Register)
   ============================ */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #EEF0FF 0%, #E6FFFA 100%);
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
}

.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 6px; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); font-size: 0.88rem; margin-bottom: 28px; }
.auth-card .form-group { margin-bottom: 16px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ============================
   Footer
   ============================ */

.site-footer {
  background: var(--text);
  color: var(--text-muted);
  padding: 36px 0;
}

.site-footer .footer-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.site-footer .footer-col h4 {
  color: white;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.site-footer .footer-col a {
  display: block;
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 3px 0;
}

.site-footer .footer-bottom {
  text-align: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem;
}

/* ============================
   Guide Modal
   ============================ */

.guide-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
}

.guide-modal-overlay.active {
  display: flex;
}

.guide-modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.guide-modal .gm-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.guide-modal .gm-body {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(85vh - 60px);
}

.guide-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.guide-tab {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.guide-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.guide-panel { display: none; }
.guide-panel.active { display: block; }

/* ============================
   Success / Error Pages
   ============================ */

.result-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

.result-page .result-icon { font-size: 3.5rem; margin-bottom: 12px; }
.result-page h2 { margin-bottom: 4px; }
.result-page p { color: var(--text-muted); margin-bottom: 20px; font-size: 0.9rem; }

/* ============================
   Page View (public)
   ============================ */

.page-view-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background-attachment: fixed;
}

.page-view-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 380px;
  width: 100%;
  overflow: hidden;
}

.page-view-header {
  padding: 32px 20px 24px;
  text-align: center;
  color: white;
}

.page-view-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 3px solid rgba(255,255,255,0.3);
}

.page-view-name { font-size: 1.15rem; font-weight: 700; }
.page-view-bio { font-size: 0.82rem; opacity: 0.85; margin-top: 2px; }
.page-view-body { padding: 16px; }
.page-view-footer { text-align: center; padding: 12px; font-size: 0.76rem; color: var(--text-muted); }

/* ============================
   Util
   ============================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* ============================
   RESPONSIVE BREAKPOINTS
   ============================ */

/* ---- Tablet (≥ 600px) ---- */
@media (min-width: 600px) {
  .container, .container-wide, .container-narrow { padding: 0 24px; }

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

  .hero-actions {
    flex-direction: row;
  }
  .hero-actions .btn { width: auto; }

  .cta-section .cta-actions {
    flex-direction: row;
  }

  .stat-card { padding: 20px; }
  .stat-card .stat-value { font-size: 1.8rem; }

  .page-header {
    flex-direction: row;
    align-items: center;
  }
  .page-header .header-actions { width: auto; }
  .page-header .header-actions .btn { flex: none; }

  .modal-overlay { align-items: center; padding: 20px; }
  .modal {
    border-radius: var(--radius-lg);
    transform: scale(0.95);
  }
  .modal-overlay.active .modal { transform: scale(1); }

  .modal-footer { flex-direction: row; justify-content: flex-end; }

  .risk-alert { flex-direction: row; align-items: flex-start; }

  .balance-card { padding: 32px 28px; }
  .balance-card .bl-amount { font-size: 2.6rem; }

  .commission-tree { flex-direction: row; justify-content: center; }
  .commission-arrow { transform: rotate(0deg); }

  .builder-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .builder-panel-tabs { display: none; }
  .builder-panel { display: block !important; }
  .builder-center { grid-column: 1 / -1; }

  .site-footer .footer-grid {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 32px;
  }

  .guide-modal-overlay { align-items: center; padding: 20px; }
  .guide-modal {
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 90%;
  }

  .page-view-wrapper { padding: 32px; }
}

/* ---- Desktop (≥ 768px) ---- */
@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.3rem; }

  .navbar-menu { display: flex; align-items: center; gap: 4px; }
  .navbar-menu.open { display: flex; }
  .navbar-toggle { display: none; }
  .navbar-inner { height: 68px; }
  .navbar-logo { font-size: 1.35rem; }
  .logo-icon { width: 38px; height: 38px; font-size: 1.2rem; }

  .container, .container-wide, .container-narrow { padding: 0 32px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .hide-mobile { display: block; }
  .show-mobile { display: none; }
  .sidebar-close-btn { display: none; }

  .section { padding: 64px 0; }
  .section-title { font-size: 1.8rem; }
  .hero h1 { font-size: 2.8rem; }
  .hero { padding: 64px 0 48px; }

  .sidebar {
    transform: translateX(0);
    position: fixed;
  }
  .sidebar-mask { display: none !important; }
  .main-content { margin-left: 260px; padding: 28px 32px; }
  .mobile-menu-btn { display: none; }

  .card-body { padding: 24px; }

  /* Larger auth card */
  .auth-card { padding: 40px 36px; }
  .auth-card h1 { font-size: 1.7rem; }
}

/* ---- Large Desktop (≥ 1024px) ---- */
@media (min-width: 1024px) {
  h1 { font-size: 2.5rem; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }

  .hero h1 { font-size: 3.2rem; }
  .hero-content { max-width: 680px; }

  .section-title { font-size: 2rem; }

  .stat-card .stat-value { font-size: 2rem; }

  /* Builder: 3-column layout */
  .builder-layout {
    grid-template-columns: 320px 1fr 320px;
  }
  .builder-center { grid-column: auto; }
  .builder-panel-tabs { display: none !important; }
  .builder-panel { display: flex !important; flex-direction: column; }

  .theme-color-grid { grid-template-columns: repeat(6, 1fr); }
  .icon-picker { flex-wrap: nowrap; }

  .faq-hero { padding: 56px 0 40px; }
  .faq-hero h1 { font-size: 2rem; }

  .cta-section { padding: 56px 40px; }
  .cta-section h2 { font-size: 2rem; }
}

/* ---- Extra Large (≥ 1280px) ---- */
@media (min-width: 1280px) {
  h1 { font-size: 3rem; }
  .hero h1 { font-size: 3.5rem; }
  .section-title { font-size: 2.25rem; }
  .builder-layout {
    grid-template-columns: 360px 1fr 340px;
  }
}

/* ============================
   Animations
   ============================ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.5s ease forwards; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float { animation: float 3s ease-in-out infinite; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Empty State (for builder, dashboard, etc.) */
.empty-state { text-align:center; padding:40px 20px; color:var(--text-muted); }
.empty-state .es-icon { font-size:2.5rem; margin-bottom:12px; }

/* ============================
   Link Modal (Builder popup editor) v2
   ============================ */

/* Link list items (simplified right panel) */
.link-list-item { display:flex; align-items:center; gap:8px; padding:8px 6px; border-bottom:1px solid var(--border-light); transition:background 0.15s; border-radius:var(--radius-xs); }
.link-list-item:hover { background:var(--surface-alt); }
.link-list-item .lli-drag { color:var(--text-muted); cursor:grab; font-size:0.9rem; flex-shrink:0; padding:4px; }
.link-list-item .lli-icon { width:32px; height:32px; border-radius:var(--radius-xs); display:flex; align-items:center; justify-content:center; font-size:0.85rem; flex-shrink:0; }
.link-list-item .lli-info { flex:1; min-width:0; }
.link-list-item .lli-title { font-size:0.82rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.link-list-item .lli-type { font-size:0.66rem; color:var(--primary); display:inline-block; padding:1px 6px; border-radius:8px; background:var(--primary-bg); margin-top:2px; }
.link-list-item .lli-type.ty-unlock { background:#FFF0F6; color:var(--accent); }
.link-list-item .lli-actions { display:flex; gap:2px; flex-shrink:0; }
.link-list-item .lli-btn { min-width:30px; min-height:30px; display:flex; align-items:center; justify-content:center; border-radius:var(--radius-xs); cursor:pointer; font-size:0.78rem; color:var(--text-muted); transition:all 0.15s; }
.link-list-item .lli-btn:hover { background:var(--primary-bg); color:var(--primary); }
.link-list-item .lli-btn.del:hover { background:var(--danger-bg); color:var(--danger); }
.unlock-badge { display:inline-block; font-size:0.6rem; padding:1px 5px; border-radius:6px; background:var(--accent); color:white; margin-left:4px; vertical-align:middle; }

/* Link editor modal overlay */
.link-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:5000; align-items:flex-end; justify-content:center; }
.link-modal-overlay.active { display:flex; }
.link-modal { background:var(--surface); border-radius:var(--radius-lg) var(--radius-lg) 0 0; width:100%; max-width:560px; max-height:90vh; overflow-y:auto; box-shadow:var(--shadow-xl); animation:slideUpLink 0.3s ease; }
@keyframes slideUpLink { from{transform:translateY(100%);} to{transform:translateY(0);} }
.link-modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border-light); position:sticky; top:0; background:var(--surface); z-index:1; }
.link-modal-header h3 { font-size:1rem; margin:0; }
.link-modal-close { min-width:36px; min-height:36px; border-radius:50%; border:none; background:var(--surface-alt); cursor:pointer; font-size:1rem; color:var(--text-muted); display:flex; align-items:center; justify-content:center; }
.link-modal-body { padding:20px; }
.link-modal-footer { padding:16px 20px; border-top:1px solid var(--border-light); display:flex; gap:8px; position:sticky; bottom:0; background:var(--surface); }

/* Link type pills (large, mobile-friendly) */
.lt-pills { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.lt-pill { padding:14px 10px; border-radius:var(--radius-sm); font-size:0.82rem; font-weight:600; cursor:pointer; border:2px solid var(--border); background:var(--surface); color:var(--text-secondary); transition:all 0.2s; text-align:center; display:flex; flex-direction:column; align-items:center; gap:4px; min-height:60px; justify-content:center; }
.lt-pill:hover { border-color:var(--primary); color:var(--primary); }
.lt-pill.active { border-color:var(--primary); background:var(--primary-bg); color:var(--primary); }
.lt-pill .lt-icon { font-size:1.3rem; }
.lt-pill .lt-label { font-size:0.72rem; }

/* Image upload zone (inside link modal) */
.img-upload-zone { border:2px dashed var(--border); border-radius:var(--radius-sm); padding:20px; text-align:center; cursor:pointer; transition:all 0.2s; margin-top:8px; background:var(--surface-alt); }
.img-upload-zone:hover { border-color:var(--primary); background:var(--primary-bg); }
.img-upload-zone.has-img { border-style:solid; border-color:var(--primary); padding:8px; }
.img-upload-zone img { max-width:100%; max-height:160px; border-radius:var(--radius-xs); margin:0 auto; display:block; }
.img-upload-zone .up-hint { color:var(--text-muted); font-size:0.82rem; }
.img-upload-zone .up-hint .up-ico { font-size:1.6rem; display:block; margin-bottom:4px; }

/* Avatar cropper modal */
.crop-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:6000; align-items:center; justify-content:center; flex-direction:column; }
.crop-overlay.active { display:flex; }
.crop-container { width:90vw; max-width:400px; max-height:60vh; background:#000; border-radius:var(--radius-sm); overflow:hidden; }
.crop-container img { max-width:100%; display:block; }
.crop-actions { display:flex; gap:12px; margin-top:16px; }
.crop-actions .btn { min-width:100px; }

/* Avatar custom row */
.avatar-custom-row { display:flex; align-items:center; gap:8px; margin-top:12px; padding:10px; background:var(--surface-alt); border-radius:var(--radius-sm); }
.avatar-custom-row .ac-preview { width:48px; height:48px; border-radius:50%; overflow:hidden; flex-shrink:0; background:var(--primary-bg); }
.avatar-custom-row .ac-preview img { width:100%; height:100%; object-fit:cover; }
.avatar-custom-row .ac-info { flex:1; font-size:0.78rem; color:var(--text-muted); }

/* ============================
   Unlock mechanism (visitor page)
   ============================ */
.link-card.locked { opacity:0.4; filter:grayscale(0.6); pointer-events:none; cursor:not-allowed; background:var(--surface-alt); }
.link-card.locked .link-title, .link-card.locked .link-url { color:var(--text-muted); }
.link-card.unlock-highlight { border-color:var(--accent); background:#FFF0F6; animation:unlockPulse 2s infinite; }
@keyframes unlockPulse { 0%,100%{box-shadow:0 0 0 0 rgba(253,121,168,0.3);} 50%{box-shadow:0 0 0 6px rgba(253,121,168,0);} }
.unlock-badge-view { display:inline-block; font-size:0.62rem; padding:2px 6px; border-radius:6px; background:var(--accent); color:white; margin-left:6px; vertical-align:middle; font-weight:600; }
.unlock-banner { background:linear-gradient(135deg,var(--accent),#FDCB6E); color:white; text-align:center; padding:8px 12px; font-size:0.78rem; font-weight:600; display:none; }
.unlock-banner.show { display:block; animation:unlockPulse 2s infinite; }

/* ============================
   Link Modal & Unlock Responsive
   ============================ */
@media (min-width:400px) { .lt-pills { grid-template-columns:1fr 1fr 1fr; } }
@media (min-width:768px) {
  .link-modal-overlay { align-items:center; }
  .link-modal { border-radius:var(--radius-lg); }
}

/* ===== #新需求：概览「最近2次访问主页 / 点击链接」相对时间卡片 ===== */
.last-times { display:flex; flex-direction:column; gap:8px; margin-top:4px; }
.lt-main, .lt-sub { display:flex; flex-direction:column; gap:1px; }
.lt-main .lt-abs { font-size:1rem; font-weight:800; color:var(--primary); line-height:1.2; font-variant-numeric:tabular-nums; }
.lt-main .lt-rel { font-size:0.72rem; color:var(--text-muted); }
.lt-sub .lt-abs { font-size:0.82rem; color:var(--text-secondary); line-height:1.2; font-variant-numeric:tabular-nums; }
.lt-sub .lt-rel { font-size:0.68rem; color:var(--text-muted); }
.lt-ref { font-size:0.7em; font-weight:600; color:var(--text-muted); opacity:0.7; margin-left:4px; }
.lt-none { font-size:0.85rem; color:var(--text-muted); }

/* ===== 指标卡「眼睛」按需加载按钮（点击眼睛才计算重型指标，避免刷新即全表统计） ===== */
.ov-eye-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-light, #e5e9f2);
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  outline: none;
}
.ov-eye-btn:hover { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.ov-eye-btn svg { display: block; }
