:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #5b21b6;
  --primary-glow: rgba(124, 58, 237, 0.35);
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --green: #10b981;
  --green-light: #34d399;
  --orange: #f59e0b;
  --orange-light: #fbbf24;
  --red: #ef4444;
  --red-light: #f87171;
  --blue: #3b82f6;
  --dark: #1e1b4b;
  --dark2: #312e81;
  --gray: #94a3b8;
  --gray-light: #e2e8f0;
  --gray-dark: #64748b;
  --white: #ffffff;
  --bg: #0f0a1e;
  --bg2: #1a1333;
  --bg3: #231c3d;
  --card-shadow: 0 4px 24px rgba(124, 58, 237, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --gradient1: linear-gradient(135deg, #7c3aed, #06b6d4);
  --gradient2: linear-gradient(135deg, #5b21b6, #7c3aed);
  --gradient3: linear-gradient(135deg, #7c3aed, #ec4899);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; }
img { max-width: 100%; }

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

/* Header */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2);
  color: white; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}
.header h1 { font-size: 18px; font-weight: 600; }
.header-btn { background: none; border: none; color: white; font-size: 20px; cursor: pointer; padding: 4px 8px; }

/* Tabs */
.tabs { display: flex; background: var(--bg2); border-bottom: 1px solid var(--glass-border); overflow-x: auto; }
.tabs .tab {
  flex: 1; padding: 12px 8px; text-align: center; font-size: 14px;
  color: var(--gray); cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all .2s;
}
.tabs .tab.active { color: var(--primary-light); border-bottom-color: var(--primary); font-weight: 600; }

/* Cards */
.card {
  background: var(--bg3); border-radius: var(--radius); padding: 16px;
  margin: 12px 0; box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: #fff; }

/* Content Card */
.content-card {
  background: var(--bg3); border-radius: var(--radius); padding: 14px;
  margin: 10px 0; box-shadow: var(--card-shadow); cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 1px solid var(--glass-border);
}
.content-card:active { transform: scale(0.98); }
.content-card:hover { box-shadow: 0 8px 32px rgba(124, 58, 237, 0.2); border-color: var(--primary); }
.content-card .title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.content-card .title-row h3 { font-size: 15px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.content-card .preview { font-size: 13px; color: var(--gray-dark); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.content-card .meta { display: flex; align-items: center; justify-content: space-between; }
.content-card .author { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-dark); }
.content-card .author img { width: 24px; height: 24px; border-radius: 50%; }
.content-card .price { color: var(--orange-light); font-size: 18px; font-weight: 700; }
.content-card .price small { font-size: 12px; font-weight: 400; }

/* Tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag-fc3d { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.tag-pl3 { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.tag-featured { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.tag-green { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.tag-presale { background: rgba(6,182,212,0.15); color: #22d3ee; border: 1px solid rgba(6,182,212,0.3); }
.tag-streak { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.tag-refundable { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.tag-red { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.tag-black { background: rgba(100,116,139,0.2); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }

/* 加大红/黑结果标签 */
.result-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; padding: 4px 14px; border-radius: 8px;
  font-size: 16px; font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.result-tag-red {
  background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(220,38,38,0.15));
  color: #fca5a5; border: 2px solid rgba(239,68,68,0.5);
  box-shadow: 0 0 16px rgba(239,68,68,0.2);
}
.result-tag-black {
  background: linear-gradient(135deg, rgba(71,85,105,0.3), rgba(51,65,85,0.2));
  color: #cbd5e1; border: 2px solid rgba(100,116,139,0.5);
  box-shadow: 0 0 16px rgba(100,116,139,0.15);
}
/* 详情页大红/黑标记 */
.result-badge-big {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 28px; border-radius: 12px;
  font-size: 28px; font-weight: 900; letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  margin-bottom: 12px;
}
.result-badge-red {
  background: linear-gradient(135deg, rgba(239,68,68,0.3), rgba(185,28,28,0.15));
  color: #fca5a5; border: 2px solid rgba(239,68,68,0.6);
  box-shadow: 0 0 32px rgba(239,68,68,0.25), inset 0 0 20px rgba(239,68,68,0.05);
}
.result-badge-black {
  background: linear-gradient(135deg, rgba(71,85,105,0.35), rgba(30,41,59,0.2));
  color: #e2e8f0; border: 2px solid rgba(148,163,184,0.5);
  box-shadow: 0 0 32px rgba(100,116,139,0.2), inset 0 0 20px rgba(100,116,139,0.05);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; border: none; cursor: pointer; transition: all .2s;
  position: relative; overflow: hidden;
}
.btn-primary { background: var(--gradient1); color: white; box-shadow: 0 4px 16px var(--primary-glow); }
.btn-primary:active { background: var(--primary-dark); box-shadow: none; }
.btn-green { background: linear-gradient(135deg, #10b981, #34d399); color: white; }
.btn-green:active { background: #059669; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary-light); border-radius: 8px; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-disabled { opacity: 0.5; pointer-events: none; }

/* Pay method selector */
.pay-methods { display: flex; gap: 10px; margin-bottom: 16px; }
.pay-method {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 12px;
  border-radius: var(--radius-sm); border: 2px solid var(--glass-border);
  background: var(--bg); cursor: pointer; transition: all .2s;
}
.pay-method.active { border-color: var(--primary); background: rgba(124,58,237,0.1); }
.pay-method .pay-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pay-method .pay-icon.wechat { background: rgba(7,193,96,0.15); }
.pay-method .pay-icon.alipay { background: rgba(0,166,255,0.15); }
.pay-method .pay-icon.balance { background: var(--gradient1); color: white; font-size: 14px; }
.pay-method .pay-name { font-size: 14px; font-weight: 500; color: #e2e8f0; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #cbd5e1; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; transition: border .2s;
  background: var(--bg); color: #e2e8f0;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 01.753 1.659l-4.796 5.48a1 1 0 01-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg2); border-radius: 16px 16px 0 0; padding: 20px;
  width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .3s;
  border: 1px solid var(--glass-border);
  border-bottom: none;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 17px; font-weight: 600; color: #fff; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray); }

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
  background: var(--bg2); border-top: 1px solid var(--glass-border);
  display: flex; padding: 6px 0 env(safe-area-inset-bottom);
  max-width: 480px; margin: 0 auto;
  backdrop-filter: blur(20px);
}
.bottom-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 4px 0; font-size: 11px; color: var(--gray);
  cursor: pointer; transition: color .2s;
}
.bottom-nav .nav-item.active { color: var(--primary-light); }
.bottom-nav .nav-item .nav-icon { font-size: 22px; margin-bottom: 2px; }
.bottom-nav .nav-item .badge {
  position: absolute; top: -2px; right: -6px; background: var(--red);
  color: white; font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}

/* Empty State */
.empty { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* Toast */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(124, 58, 237, 0.9); color: white; padding: 12px 24px;
  border-radius: var(--radius-sm); font-size: 14px; z-index: 2000;
  opacity: 0; transition: opacity .3s; backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; }

/* Announcement Bar */
.announce-bar {
  background: rgba(245, 158, 11, 0.1); color: var(--orange-light); padding: 8px 16px;
  font-size: 13px; display: flex; align-items: center; gap: 6px;
  overflow: hidden; border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}
.announce-bar .announce-icon { flex-shrink: 0; }

/* Balance */
.balance-card {
  background: var(--gradient2); border-radius: var(--radius); padding: 20px; color: white;
  margin: 12px 0; box-shadow: 0 4px 24px var(--primary-glow);
  position: relative; overflow: hidden;
}
.balance-card::before {
  content: ''; position: absolute; top: -30%; right: -20%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.balance-card .amount { font-size: 32px; font-weight: 700; margin: 8px 0; }
.balance-card .label { font-size: 13px; opacity: 0.9; }

/* Menu List */
.menu-list { background: var(--bg3); border-radius: var(--radius); margin: 12px 0; overflow: hidden; border: 1px solid var(--glass-border); }
.menu-item {
  display: flex; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border); cursor: pointer; transition: background .15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: rgba(124, 58, 237, 0.1); }
.menu-item .menu-icon { width: 32px; font-size: 18px; text-align: center; margin-right: 12px; }
.menu-item .menu-text { flex: 1; font-size: 15px; color: #e2e8f0; }
.menu-item .menu-arrow { color: var(--gray); font-size: 14px; }
.menu-item .menu-badge { background: var(--red); color: white; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-right: 8px; }

/* Loading */
.loading { text-align: center; padding: 20px; color: var(--gray); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--glass-border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Status Dot */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.status-dot-green { background: var(--green); }
.status-dot-red { background: var(--red); }
.status-dot-gray { background: var(--gray); }

/* Scroll padding */
.has-bottom-nav { padding-bottom: 70px; }
.has-header { padding-top: 52px; }

/* Merchant Home */
.merchant-header {
  background: var(--gradient2); color: white; padding: 24px 16px; text-align: center;
  position: relative; overflow: hidden;
}
.merchant-header::before {
  content: ''; position: absolute; top: -50%; right: -30%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.merchant-header::after {
  content: ''; position: absolute; bottom: -40%; left: -20%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%);
  border-radius: 50%;
}
.merchant-header .avatar { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); margin: 0 auto 8px; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.merchant-header .shop-name { font-size: 20px; font-weight: 700; position: relative; z-index: 1; }
.merchant-header .bio { font-size: 13px; opacity: 0.85; margin-top: 4px; position: relative; z-index: 1; }
.merchant-stats { display: flex; justify-content: center; gap: 32px; margin-top: 16px; position: relative; z-index: 1; }
.merchant-stats .stat-item { text-align: center; }
.merchant-stats .stat-value { font-size: 20px; font-weight: 700; }
.merchant-stats .stat-label { font-size: 12px; opacity: 0.8; }

/* Glow Effects */
.glow-text { text-shadow: 0 0 20px var(--primary-glow); }
.glow-border { box-shadow: 0 0 20px var(--primary-glow), inset 0 0 20px rgba(124, 58, 237, 0.05); }
.glow-line { height: 1px; background: linear-gradient(90deg, transparent, var(--primary), transparent); margin: 12px 0; }

/* Category Tabs */
.cat-tabs { display: flex; gap: 10px; padding: 14px 16px; overflow-x: auto; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  display: flex; align-items: center; gap: 6px; padding: 8px 18px;
  border-radius: 24px; font-size: 14px; font-weight: 500;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--gray); cursor: pointer; white-space: nowrap; transition: all .25s;
}
.cat-tab.active {
  background: var(--primary); color: white; border-color: var(--primary);
  box-shadow: 0 4px 16px var(--primary-glow);
}
.cat-tab .cat-icon { font-size: 16px; }

/* Banner Carousel */
.banner-wrap { padding: 12px 16px; }
.banner-card {
  border-radius: var(--radius); overflow: hidden; position: relative;
  height: 140px; background: var(--gradient1);
  box-shadow: 0 4px 20px var(--primary-glow);
}
.banner-card .banner-content { padding: 24px; color: white; position: relative; z-index: 1; }
.banner-card .banner-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.banner-card .banner-desc { font-size: 13px; opacity: 0.85; }
.banner-card::after {
  content: ''; position: absolute; right: -20px; bottom: -40px; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%); border-radius: 50%;
}

/* Section Header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
}
.section-header .title { font-size: 17px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 6px; }
.section-header .more { font-size: 13px; color: var(--gray); cursor: pointer; }

/* Merchant Recommend Card */
.merchant-recommend {
  display: flex; gap: 10px; padding: 0 16px 8px; overflow-x: auto;
}
.merchant-recommend::-webkit-scrollbar { display: none; }
.merchant-card {
  min-width: 140px; background: var(--bg3); border-radius: var(--radius); padding: 14px;
  text-align: center; border: 1px solid var(--glass-border); cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.merchant-card:active { transform: scale(0.96); }
.merchant-card .m-avatar { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 8px; background: var(--gradient1); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.merchant-card .m-name { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant-card .m-stat { font-size: 11px; color: var(--gray); }

/* Append content section */
.append-section { margin-top: 12px; padding: 12px; background: rgba(124,58,237,0.08); border-radius: var(--radius-sm); border: 1px dashed var(--primary); }
.append-section .append-title { font-size: 13px; color: var(--primary-light); font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.append-section .append-text { font-size: 13px; color: var(--gray-dark); line-height: 1.6; }
.append-section .append-time { font-size: 11px; color: var(--gray); margin-top: 4px; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp .4s ease-out; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 8px var(--primary-glow); } 50% { box-shadow: 0 0 24px var(--primary-glow); } }
.glow-anim { animation: glow 2s ease-in-out infinite; }

/* Particle BG */
.particle-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(135deg, #0f0a1e 0%, #1a1333 50%, #0f0a1e 100%);
}
.particle-bg .dot {
  position: absolute; width: 2px; height: 2px; background: var(--primary);
  border-radius: 50%; opacity: 0.3; animation: float 15s infinite;
}
@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* Logout button fix - make sure it's clickable */
.btn-logout {
  width: 100%; padding: 12px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; background: transparent; border: 1px solid var(--red);
  color: var(--red-light); cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.btn-logout:active { background: rgba(239,68,68,0.15); }

/* Stat card grid */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat-grid .stat-item {
  background: var(--bg3); border-radius: var(--radius-sm); padding: 12px 8px;
  text-align: center; border: 1px solid var(--glass-border);
}
.stat-grid .stat-item .val { font-size: 18px; font-weight: 700; color: var(--primary-light); }
.stat-grid .stat-item .lbl { font-size: 11px; color: var(--gray-dark); margin-top: 2px; }

/* Merchant dashboard header */
.merchant-header-custom {
  background: var(--gradient2); color: white; padding: 20px 16px;
  position: relative; overflow: hidden;
}
.merchant-header-custom::before { content: ''; position: absolute; top: -50%; right: -30%; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.merchant-header-custom::after { content: ''; position: absolute; bottom: -40%; left: -20%; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.06); }
.merchant-header-custom .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; position: relative; z-index: 1; }
.merchant-header-custom .shop-name { font-size: 20px; font-weight: 700; }

/* Quick actions grid */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 16px; background: var(--bg2); border-bottom: 1px solid var(--glass-border); }
.quick-action {
  display: flex; flex-direction: column; align-items: center; padding: 12px 4px;
  cursor: pointer; border-radius: var(--radius-sm); transition: background .15s;
}
.quick-action:active { background: rgba(124,58,237,0.1); }
.quick-action .qa-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 6px; background: var(--glass); border: 1px solid var(--glass-border); }
.quick-action .qa-text { font-size: 11px; color: var(--gray-dark); text-align: center; }

/* Income card */
.income-card { background: var(--gradient2); color: white; border-radius: var(--radius); padding: 20px; margin: 12px 0; position: relative; overflow: hidden; box-shadow: 0 4px 24px var(--primary-glow); }
.income-card::before { content: ''; position: absolute; top: -30%; right: -20%; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.income-card::after { content: ''; position: absolute; bottom: -30%; left: -15%; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.06); }
.income-card .amount { font-size: 32px; font-weight: 700; margin: 8px 0; position: relative; z-index: 1; }
.income-card .label { font-size: 13px; opacity: 0.9; position: relative; z-index: 1; }
.income-card .actions { position: relative; z-index: 1; }

/* Content manage card */
.content-manage-card {
  background: var(--bg3); border-radius: var(--radius); padding: 16px;
  margin: 10px 0; border: 1px solid var(--glass-border);
}
.content-manage-card .top-row { display: flex; justify-content: space-between; align-items: flex-start; }
.content-manage-card .info { flex: 1; }
.content-manage-card .title { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.content-manage-card .meta { font-size: 12px; color: var(--gray-dark); }
.content-manage-card .status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.status-approved { background: rgba(16,185,129,0.15); color: var(--green-light); border: 1px solid rgba(16,185,129,0.3); }
.status-pending { background: rgba(245,158,11,0.15); color: var(--orange-light); border: 1px solid rgba(245,158,11,0.3); }
.status-offline { background: rgba(100,116,139,0.15); color: var(--gray); border: 1px solid rgba(100,116,139,0.3); }

.action-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.appendix-count { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 11px; background: rgba(124,58,237,0.15); color: var(--primary-light); margin-left: 6px; }

/* SVG Icon System */
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
}
.icon svg { width: 100%; height: 100%; }

/* Appendix Modal */
.appendix-list { max-height: 300px; overflow-y: auto; }
.appendix-item {
  padding: 10px; background: rgba(124,58,237,0.06); border-radius: var(--radius-sm);
  margin-bottom: 8px; border: 1px dashed rgba(124,58,237,0.2);
  display: flex; align-items: flex-start; gap: 8px;
}
.appendix-item .text { flex: 1; font-size: 13px; color: var(--gray-dark); line-height: 1.6; }
.appendix-item .time { font-size: 11px; color: var(--gray); margin-top: 4px; }
.appendix-item .del-btn {
  background: none; border: none; color: var(--red-light); cursor: pointer;
  font-size: 16px; padding: 2px 4px; flex-shrink: 0;
}

.upload-box{background:var(--bg3);border:1px dashed var(--glass-border);border-radius:var(--radius);padding:20px;text-align:center;cursor:pointer;min-height:80px;display:flex;align-items:center;justify-content:center;transition:border-color .2s}
.upload-box:hover{border-color:var(--primary)}

/* ============================================
   Admin Dark Theme System
   ============================================ */

.admin-wrap { display: flex; min-height: 100vh; background: var(--bg); }

/* Sidebar */
.admin-sidebar {
  width: 220px; background: var(--bg2); border-right: 1px solid var(--glass-border);
  position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
  display: flex; flex-direction: column;
}
.admin-sidebar .sidebar-logo {
  padding: 18px 20px; border-bottom: 1px solid var(--glass-border);
  font-size: 16px; font-weight: 700; color: var(--primary-light);
  display: flex; align-items: center; gap: 8px;
}
.admin-sidebar .sidebar-logo .logo-icon {
  width: 32px; height: 32px; background: var(--gradient1); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.admin-sidebar .nav-section { padding: 8px 0; flex: 1; }
.admin-sidebar .nav-label {
  padding: 8px 20px 4px; font-size: 11px; color: var(--gray);
  text-transform: uppercase; letter-spacing: 1px;
}
.admin-sidebar .nav-item {
  display: flex; align-items: center; padding: 11px 20px;
  cursor: pointer; transition: all .15s; font-size: 14px;
  color: var(--gray-dark); gap: 10px; text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-sidebar .nav-item:hover { background: rgba(124,58,237,0.1); color: #e2e8f0; }
.admin-sidebar .nav-item.active {
  background: rgba(124,58,237,0.15); color: var(--primary-light);
  border-left-color: var(--primary); font-weight: 600;
}
.admin-sidebar .nav-item .nav-icon { font-size: 17px; width: 22px; text-align: center; }
.admin-sidebar .nav-item .nav-badge {
  margin-left: auto; background: var(--red); color: white;
  font-size: 11px; padding: 1px 6px; border-radius: 10px; font-weight: 600;
}
.admin-sidebar .sidebar-footer {
  padding: 16px 20px; border-top: 1px solid var(--glass-border);
}
.admin-sidebar .sidebar-footer .user-info { font-size: 13px; color: var(--gray-dark); margin-bottom: 8px; }
.admin-sidebar .sidebar-footer .logout-btn {
  width: 100%; padding: 8px; border-radius: var(--radius-sm); font-size: 13px;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: var(--red-light); cursor: pointer; transition: all .2s;
}
.admin-sidebar .sidebar-footer .logout-btn:hover { background: rgba(239,68,68,0.2); }

/* Admin Main */
.admin-main { margin-left: 220px; flex: 1; padding: 24px; min-height: 100vh; max-width: calc(100vw - 220px); }
.admin-container { max-width: 100%; padding: 0 24px; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.admin-topbar h1 { font-size: 22px; font-weight: 700; color: #fff; }
.admin-topbar .topbar-meta { font-size: 13px; color: var(--gray-dark); }

/* Admin Stat Cards */
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 28px; }
.admin-stat-card {
  background: var(--bg3); border-radius: var(--radius); padding: 28px 24px;
  border: 1px solid var(--glass-border); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.admin-stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.admin-stat-card::before {
  content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
  border-radius: 50%; opacity: 0.06;
}
.admin-stat-card.purple::before { background: var(--primary); }
.admin-stat-card.green::before { background: var(--green); }
.admin-stat-card.orange::before { background: var(--orange); }
.admin-stat-card.red::before { background: var(--red); }
.admin-stat-card .stat-icon { font-size: 36px; margin-bottom: 16px; }
.admin-stat-card .stat-value { font-size: 34px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.admin-stat-card .stat-label { font-size: 14px; color: var(--gray-dark); }
.admin-stat-card .stat-trend { font-size: 12px; margin-top: 8px; font-weight: 600; }
.admin-stat-card .stat-trend.up { color: var(--green-light); }
.admin-stat-card .stat-trend.down { color: var(--red-light); }

/* Admin Table */
.admin-card {
  background: var(--bg3); border-radius: var(--radius); padding: 28px;
  margin-bottom: 24px; border: 1px solid var(--glass-border); width: 100%;
}
.admin-card-title {
  font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.admin-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.admin-search {
  flex: 1; min-width: 240px; padding: 10px 16px; border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); background: var(--bg); color: #e2e8f0; font-size: 14px;
  outline: none; transition: border-color .2s;
}
.admin-search:focus { border-color: var(--primary); }
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 14px 18px; text-align: left; font-size: 13px; font-weight: 600;
  color: var(--gray-dark); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border); white-space: nowrap;
}
.admin-table td {
  padding: 16px 18px; font-size: 14px; color: #e2e8f0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(124,58,237,0.06); }
.admin-table .col-sm { color: var(--gray-dark); font-size: 12px; }

/* Admin Status Badges */
.badge { display: inline-block; padding: 5px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.badge-green { background: rgba(16,185,129,0.15); color: var(--green-light); border: 1px solid rgba(16,185,129,0.3); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--orange-light); border: 1px solid rgba(245,158,11,0.3); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red-light); border: 1px solid rgba(239,68,68,0.3); }
.badge-gray { background: rgba(100,116,139,0.15); color: var(--gray); border: 1px solid rgba(100,116,139,0.3); }
.badge-purple { background: rgba(124,58,237,0.15); color: var(--primary-light); border: 1px solid rgba(124,58,237,0.3); }
.badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* Admin Buttons */
.btn-xs { padding: 6px 14px; font-size: 13px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; transition: all .2s; }
.btn-xs-green { background: var(--green); color: white; }
.btn-xs-green:hover { background: #059669; }
.btn-xs-red { background: var(--red); color: white; }
.btn-xs-red:hover { background: #b91c1c; }
.btn-xs-purple { background: var(--primary); color: white; }
.btn-xs-purple:hover { background: var(--primary-dark); }
.btn-xs-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--gray-dark); }
.btn-xs-outline:hover { border-color: var(--primary); color: var(--primary-light); }

/* Admin Form */
.admin-form { background: var(--bg3); border-radius: var(--radius); padding: 24px; border: 1px solid var(--glass-border); }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form .form-group { margin-bottom: 16px; }
.admin-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #cbd5e1; }
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; padding: 9px 14px; border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); font-size: 14px; background: var(--bg);
  color: #e2e8f0; outline: none; transition: border-color .2s;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--primary); }
.admin-form textarea { min-height: 100px; resize: vertical; }
.admin-form select { appearance: none; cursor: pointer; }

/* Admin Pagination */
.admin-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.admin-pagination .page-info { font-size: 13px; color: var(--gray-dark); }
.admin-pagination .page-btns { display: flex; gap: 4px; }
.admin-pagination .page-btn {
  min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid var(--glass-border);
  background: var(--bg); color: var(--gray-dark); transition: all .15s;
}
.admin-pagination .page-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.admin-pagination .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Admin Login */
.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f0a1e 0%, #1a1333 50%, #0f0a1e 100%);
  padding: 20px;
}
.admin-login-box {
  width: 100%; max-width: 380px; background: var(--bg3); border-radius: var(--radius);
  padding: 36px 32px; border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.admin-login-box .login-logo { text-align: center; margin-bottom: 28px; }
.admin-login-box .login-logo .logo-icon { font-size: 40px; margin-bottom: 8px; }
.admin-login-box .login-logo h2 { font-size: 22px; font-weight: 700; color: #fff; }
.admin-login-box .login-logo p { font-size: 13px; color: var(--gray-dark); margin-top: 4px; }

/* Merchant Login */
.merchant-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f0a1e 0%, #1a1333 100%);
  padding: 20px;
}
.merchant-login-box {
  width: 100%; max-width: 360px; background: var(--bg3); border-radius: var(--radius);
  padding: 32px 24px; border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.merchant-login-box .login-header { text-align: center; margin-bottom: 28px; }
.merchant-login-box .login-header .login-icon { font-size: 44px; margin-bottom: 12px; }
.merchant-login-box .login-header h2 { font-size: 20px; font-weight: 700; color: #fff; }
.merchant-login-box .login-header p { font-size: 13px; color: var(--gray-dark); margin-top: 4px; }
.merchant-login-box .login-tabs { display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 24px; }
.merchant-login-box .login-tab { flex: 1; padding: 10px; text-align: center; font-size: 14px; font-weight: 600; border-radius: 8px; cursor: pointer; color: var(--gray-dark); transition: all .2s; }
.merchant-login-box .login-tab.active { background: var(--primary); color: white; }
.merchant-login-box .login-tab:hover:not(.active) { color: #e2e8f0; }

/* Merchant Settings Page */
/* ===== 系统设置页面样式 ===== */
.settings-section {
  background: var(--bg3); border-radius: 14px; margin-bottom: 20px;
  border: 1px solid var(--glass-border); overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.settings-section-header {
  padding: 16px 20px; font-size: 15px; font-weight: 700; color: #fff;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(124,58,237,0.05));
  letter-spacing: 0.5px;
}
.settings-section-header .icon { font-size: 18px; }

/* 设置项 - 统一支持两种类名 */
.settings-item,
.settings-item[data-setting] {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04); cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: rgba(124,58,237,0.08); }
.settings-item:active { background: rgba(124,58,237,0.15); transform: scale(0.995); }

/* 图标区域 */
.settings-item > .icon,
.settings-item .settings-icon {
  font-size: 22px; width: 40px; height: 40px; 
  display: flex; align-items: center; justify-content: center;
  background: rgba(124,58,237,0.12);
  border-radius: 10px; margin-right: 14px;
  flex-shrink: 0;
}

/* 文字信息区 */
.settings-item > .info,
.settings-item .settings-text {
  flex: 1; min-width: 0;
}
.settings-item .label,
.settings-item .settings-text > strong {
  font-size: 14.5px; font-weight: 600; color: #e8ecf4; display: block; line-height: 1.3;
}
.settings-item .hint,
.settings-item .settings-desc {
  font-size: 12px; color: var(--gray-dark); margin-top: 3px; display: block;
}

/* 数值显示 */
.settings-item > .value,
.settings-item .settings-value {
  font-size: 15px; font-weight: 700; color: var(--primary-light);
  background: rgba(124,58,237,0.1);
  padding: 4px 12px; border-radius: 8px;
  margin-right: 10px; white-space: nowrap;
}

/* 箭头 */
.settings-item > .arrow,
.settings-item .settings-arrow {
  color: var(--gray); font-size: 18px; font-weight: 300;
  flex-shrink: 0;
  transition: transform .2s;
}
.settings-item:hover > .arrow,
.settings-item:hover .settings-arrow {
  transform: translateX(2px); color: var(--primary-light);
}

/* Merchant Stats Page */
.stats-card {
  background: var(--bg3); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; border: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 14px;
}
.stats-card .stats-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stats-card .stats-info { flex: 1; }
.stats-card .stats-value { font-size: 22px; font-weight: 800; color: #fff; }
.stats-card .stats-label { font-size: 12px; color: var(--gray-dark); margin-top: 2px; }
.stats-card .stats-change { font-size: 11px; font-weight: 600; margin-top: 4px; }
.stats-card .stats-change.up { color: var(--green-light); }
.stats-card .stats-change.down { color: var(--red-light); }

/* Content Preview Card */
.preview-card {
  background: var(--bg3); border-radius: var(--radius); padding: 14px;
  margin: 8px 0; border: 1px solid var(--glass-border);
  cursor: pointer; transition: all .15s;
}
.preview-card:active { transform: scale(0.98); }
.preview-card:hover { border-color: var(--primary); }
.preview-card .preview-title { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.preview-card .preview-desc { font-size: 13px; color: var(--gray-dark); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview-card .preview-meta { display: flex; justify-content: space-between; align-items: center; }
.preview-card .preview-stat { font-size: 12px; color: var(--gray-dark); }
.preview-card .preview-price { color: var(--orange-light); font-size: 18px; font-weight: 700; }

/* Chart Area */
.chart-card { background: var(--bg3); border-radius: var(--radius); padding: 20px; border: 1px solid var(--glass-border); margin-bottom: 20px; }
.chart-card .chart-title { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.chart-placeholder { height: 160px; display: flex; align-items: flex-end; gap: 6px; padding: 8px 0; }
.chart-bar { flex: 1; background: var(--gradient1); border-radius: 4px 4px 0 0; min-height: 8px; opacity: 0.7; transition: opacity .2s; }
.chart-bar:hover { opacity: 1; }
.chart-bar-label { font-size: 10px; color: var(--gray-dark); text-align: center; margin-top: 4px; }

/* Trend line placeholder */
.trend-line { height: 80px; display: flex; align-items: center; gap: 2px; position: relative; }
.trend-line svg { width: 100%; height: 100%; }

/* Notification Bell */
.notif-bell {
  position: relative; cursor: pointer; font-size: 20px; padding: 4px 8px;
  transition: transform .2s;
}
.notif-bell:hover { transform: scale(1.1); }
.notif-bell .notif-dot {
  position: absolute; top: 2px; right: 4px; width: 8px; height: 8px;
  background: var(--red); border-radius: 50%; border: 2px solid var(--bg2);
}
.notif-bell .notif-count {
  position: absolute; top: -4px; right: -4px; background: var(--red);
  color: white; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg2);
}

/* Mobile-friendly admin improvements */
@media (max-width: 768px) {
  .admin-sidebar { width: 60px; }
  .admin-sidebar .sidebar-logo .logo-text { display: none; }
  .admin-sidebar .nav-item .nav-text { display: none; }
  .admin-sidebar .nav-item .nav-badge { display: none; }
  .admin-sidebar .nav-label { display: none; }
  .admin-sidebar .sidebar-footer { display: none; }
  .admin-main { margin-left: 60px; padding: 16px; max-width: calc(100vw - 60px); }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-form .form-row { grid-template-columns: 1fr; }
  .admin-container { padding: 0 16px; }
}

/* Enhanced merchant income page */
.income-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.income-mini-card {
  background: var(--bg3); border-radius: var(--radius-sm); padding: 14px;
  border: 1px solid var(--glass-border);
}
.income-mini-card .val { font-size: 20px; font-weight: 800; color: #fff; }
.income-mini-card .lbl { font-size: 12px; color: var(--gray-dark); margin-top: 2px; }

/* Coupon card */
.coupon-card {
  background: var(--bg3); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; border: 1px solid var(--glass-border);
  position: relative; overflow: hidden;
}
.coupon-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--gradient1); border-radius: 4px 0 0 4px;
}
.coupon-card .coupon-amount { font-size: 28px; font-weight: 800; color: var(--primary-light); }
.coupon-card .coupon-amount small { font-size: 14px; }
.coupon-card .coupon-name { font-size: 15px; font-weight: 600; color: #fff; margin: 4px 0; }
.coupon-card .coupon-meta { font-size: 12px; color: var(--gray-dark); }

/* Team tree */
.team-member {
  background: var(--bg3); border-radius: var(--radius); padding: 14px;
  margin-bottom: 10px; border: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 12px;
}
.team-member .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gradient1); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.team-member .info { flex: 1; }
.team-member .name { font-size: 14px; font-weight: 600; color: #fff; }
.team-member .meta { font-size: 12px; color: var(--gray-dark); }

/* QR code display */
.qr-modal-content { text-align: center; padding: 24px; }
.qr-modal-content .qr-img { width: 200px; height: 200px; margin: 0 auto 16px; background: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.qr-modal-content .qr-amount { font-size: 28px; font-weight: 800; color: var(--primary-light); margin-bottom: 8px; }
.qr-modal-content .qr-tip { font-size: 13px; color: var(--gray-dark); }

/* Announcement modal */
.announce-modal { background: var(--bg2); border-radius: 16px 16px 0 0; padding: 20px; width: 100%; max-width: 480px; }
.announce-modal .announce-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 12px; text-align: center; }
.announce-modal .announce-time { font-size: 12px; color: var(--gray-dark); text-align: center; margin-bottom: 16px; }
.announce-modal .announce-body { font-size: 14px; color: #e2e8f0; line-height: 1.8; }

/* User apply page */
.apply-progress { display: flex; align-items: center; justify-content: center; gap: 0; margin: 24px 0; }
.apply-step { display: flex; flex-direction: column; align-items: center; }
.apply-step .step-num {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; border: 2px solid var(--glass-border); color: var(--gray-dark);
  background: var(--bg); z-index: 1; position: relative;
}
.apply-step.active .step-num { border-color: var(--primary); color: var(--primary-light); background: rgba(124,58,237,0.1); }
.apply-step.done .step-num { border-color: var(--green); color: var(--green-light); background: rgba(16,185,129,0.1); }
.apply-step .step-lbl { font-size: 12px; color: var(--gray-dark); margin-top: 6px; }
.apply-step .step-line { flex: 1; height: 2px; background: var(--glass-border); margin: 0 8px; margin-bottom: 22px; min-width: 40px; }
.apply-step.done .step-line { background: var(--green); }

/* Order detail card */
.order-card {
  background: var(--bg3); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; border: 1px solid var(--glass-border);
}
.order-card .order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-card .order-no { font-size: 12px; color: var(--gray-dark); }
.order-card .order-content { padding: 10px 0; border-top: 1px solid var(--glass-border); }
.order-card .order-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.order-card .order-price { font-size: 16px; font-weight: 700; color: var(--orange-light); }

/* Balance log */
.log-item {
  display: flex; align-items: center; padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.log-item:last-child { border-bottom: none; }
.log-item .log-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-right: 12px; flex-shrink: 0; }
.log-item .log-text { flex: 1; }
.log-item .log-title { font-size: 14px; color: #e2e8f0; }
.log-item .log-time { font-size: 12px; color: var(--gray-dark); margin-top: 2px; }
.log-item .log-amount { font-size: 16px; font-weight: 700; }
.log-item .log-amount.pos { color: var(--green-light); }
.log-item .log-amount.neg { color: var(--red-light); }

/* Scroll behavior */
html { scroll-behavior: smooth; }
.fade-in { animation: fadeInUp .4s ease-out; }

/* Better select for dark theme */
select option { background: var(--bg2); color: #e2e8f0; }

/* Tab bar highlight */
.tab-bar { display: flex; background: var(--bg2); border-radius: var(--radius-sm); padding: 4px; margin: 12px 0; gap: 4px; }
.tab-bar .tab-btn {
  flex: 1; padding: 8px 12px; text-align: center; font-size: 13px; font-weight: 600;
  border-radius: 8px; cursor: pointer; color: var(--gray-dark); transition: all .2s;
}
.tab-bar .tab-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 8px var(--primary-glow); }

/* Loading overlay */
.loading-overlay { position: fixed; inset: 0; background: rgba(15,10,30,0.8); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.loading-overlay .loading-inner { text-align: center; }
.loading-overlay .loading-icon { font-size: 36px; animation: spin 1s linear infinite; display: inline-block; }

/* ============================================
   用户端白色清爽主题覆盖
   body:not(.dark-theme) 确保只影响用户端
   ============================================ */

body:not(.dark-theme) { background: #f5f6fa; color: #333; }

body:not(.dark-theme) .header {
  background: #fff; color: #333;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  backdrop-filter: none;
}
body:not(.dark-theme) .header h1 { color: #1a1a1a; }
body:not(.dark-theme) .header-btn { color: #555; }

body:not(.dark-theme) .tabs { background: #fff; border-bottom: 1px solid #f0f0f0; }
body:not(.dark-theme) .tabs .tab { color: #999; border-bottom-color: transparent; }
body:not(.dark-theme) .tabs .tab.active { color: #7c3aed; border-bottom-color: #7c3aed; }

body:not(.dark-theme) .card {
  background: #fff; border: 1px solid #f0f0f0;
  border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  backdrop-filter: none;
}
body:not(.dark-theme) .card-title { color: #1a1a1a; }

body:not(.dark-theme) .content-card {
  background: #fff; border: 1px solid #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); backdrop-filter: none;
}
body:not(.dark-theme) .content-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: #7c3aed; }
body:not(.dark-theme) .content-card .title-row h3 { color: #1a1a1a; }
body:not(.dark-theme) .content-card .preview { color: #999; }
body:not(.dark-theme) .content-card .author { color: #999; }
body:not(.dark-theme) .content-card .price { color: #ef4444; }

body:not(.dark-theme) .menu-list {
  background: #fff; border: 1px solid #f0f0f0;
  border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
body:not(.dark-theme) .menu-item { border-bottom-color: #f5f5f5; }
body:not(.dark-theme) .menu-item:active { background: #f7f5ff; }
body:not(.dark-theme) .menu-item .menu-text { color: #333; }
body:not(.dark-theme) .menu-item .menu-arrow { color: #ccc; }

body:not(.dark-theme) .bottom-nav {
  background: #fff; border-top-color: #eee; backdrop-filter: none;
}
body:not(.dark-theme) .bottom-nav .nav-item { color: #bbb; }
body:not(.dark-theme) .bottom-nav .nav-item.active { color: #7c3aed; }

body:not(.dark-theme) .modal-overlay { background: rgba(0,0,0,0.4); backdrop-filter: none; }
body:not(.dark-theme) .modal {
  background: #fff; border-radius: 16px; border-bottom: none; border: none;
}
body:not(.dark-theme) .modal-header { border-bottom-color: #f0f0f0; }
body:not(.dark-theme) .modal-header h3 { color: #1a1a1a; }
body:not(.dark-theme) .modal-close { color: #999; }

body:not(.dark-theme) .toast { background: rgba(124, 58, 237, 0.9); backdrop-filter: none; }

body:not(.dark-theme) .balance-card {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border-radius: 16px; box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

body:not(.dark-theme) .form-group label { color: #555; }
body:not(.dark-theme) .form-group input,
body:not(.dark-theme) .form-group textarea,
body:not(.dark-theme) .form-group select {
  background: #f8f9fc; border-color: #e5e7eb; color: #333;
}
body:not(.dark-theme) .form-group input:focus,
body:not(.dark-theme) .form-group textarea:focus {
  border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
body:not(.dark-theme) .form-group input::placeholder { color: #bbb; }
body:not(.dark-theme) select option { background: #fff; color: #333; }

body:not(.dark-theme) .pay-method { background: #f8f9fc; border-color: #e5e7eb; }
body:not(.dark-theme) .pay-method.active { border-color: #7c3aed; background: #f5f3ff; }
body:not(.dark-theme) .pay-method .pay-name { color: #333; }

body:not(.dark-theme) .btn-outline { border-color: #7c3aed; color: #7c3aed; }
body:not(.dark-theme) .empty { color: #999; }
body:not(.dark-theme) .loading { color: #999; }

body:not(.dark-theme) .stat-grid .stat-item {
  background: #fff; border-color: #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
body:not(.dark-theme) .stat-grid .stat-item .val { color: #7c3aed; }
body:not(.dark-theme) .stat-grid .stat-item .lbl { color: #999; }

body:not(.dark-theme) .spinner { border-color: #e5e7eb; border-top-color: #7c3aed; }

body:not(.dark-theme) .log-item { border-bottom-color: #f5f5f5; }
body:not(.dark-theme) .log-item .log-title { color: #333; }
body:not(.dark-theme) .log-item .log-time { color: #999; }
body:not(.dark-theme) .log-item .log-amount.pos { color: #10b981; }
body:not(.dark-theme) .log-item .log-amount.neg { color: #7c3aed; }

body:not(.dark-theme) .announce-bar { background: #fffbeb; color: #92400e; border-bottom-color: #fef3c7; }

body:not(.dark-theme) .order-card {
  background: #fff; border-color: #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
body:not(.dark-theme) .order-card .order-no { color: #999; }
body:not(.dark-theme) .order-card .order-title { color: #1a1a1a; }
body:not(.dark-theme) .order-card .order-price { color: #ef4444; }

body:not(.dark-theme) .coupon-card {
  background: #fff; border-color: #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
body:not(.dark-theme) .coupon-card .coupon-amount { color: #7c3aed; }
body:not(.dark-theme) .coupon-card .coupon-name { color: #1a1a1a; }
body:not(.dark-theme) .coupon-card .coupon-meta { color: #999; }

body:not(.dark-theme) .apply-step .step-num { background: #fff; border-color: #e5e7eb; color: #999; }
body:not(.dark-theme) .apply-step.active .step-num { border-color: #7c3aed; color: #7c3aed; background: #f5f3ff; }
body:not(.dark-theme) .apply-step .step-line { background: #e5e7eb; }

body:not(.dark-theme) .tab-bar { background: #f0f1f5; }
body:not(.dark-theme) .tab-bar .tab-btn { color: #999; }

body:not(.dark-theme) .income-mini-card { background: #fff; border-color: #f0f0f0; }
body:not(.dark-theme) .income-mini-card .val { color: #1a1a1a; }
body:not(.dark-theme) .income-mini-card .lbl { color: #999; }

body:not(.dark-theme) .content-manage-card { background: #fff; border-color: #f0f0f0; }
body:not(.dark-theme) .content-manage-card .title { color: #1a1a1a; }
body:not(.dark-theme) .content-manage-card .meta { color: #999; }

body:not(.dark-theme) .preview-card { background: #fff; border-color: #f0f0f0; }
body:not(.dark-theme) .preview-card:hover { border-color: #7c3aed; }
body:not(.dark-theme) .preview-card .preview-title { color: #1a1a1a; }
body:not(.dark-theme) .preview-card .preview-desc { color: #999; }
body:not(.dark-theme) .preview-card .preview-stat { color: #999; }
body:not(.dark-theme) .preview-card .preview-price { color: #ef4444; }

body:not(.dark-theme) .stats-card { background: #fff; border-color: #f0f0f0; }
body:not(.dark-theme) .stats-card .stats-value { color: #1a1a1a; }
body:not(.dark-theme) .stats-card .stats-label { color: #999; }

body:not(.dark-theme) .chart-card { background: #fff; border-color: #f0f0f0; }
body:not(.dark-theme) .chart-card .chart-title { color: #1a1a1a; }

body:not(.dark-theme) .section-header .title { color: #1a1a1a; }
body:not(.dark-theme) .section-header .more { color: #999; }
