:root {
    --bg-body: #f5f7fa; --bg-white: #ffffff; --text-main: #111827; --text-sub: #6b7280; 
    --border-color: #e5e7eb; --primary-dark: #0f172a; --primary-blue: #2563eb; 
    --primary-light: #eff6ff; --warning-bg: #fff7ed; --warning-text: #ea580c; 
    --success-text: #16a34a; --accent-gold: #b45309; --danger-color: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: var(--bg-body); color: var(--text-main); display: flex; height: 100vh; overflow: hidden; }

/* ================= 侧边栏 ================= */
.sidebar { width: 240px; background-color: var(--bg-white); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 20px 16px; z-index: 50; }
.logo-area { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px 8px; font-size: 19px; font-weight: 700; color: var(--primary-dark); }
.logo-icon { width: 32px; height: 32px; background: var(--primary-dark); color: white; border-radius: 8px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; color: var(--text-sub); font-size: 14px; cursor: pointer; transition: all 0.2s; }
.nav-item:hover { background-color: #f3f4f6; color: var(--text-main); }
.nav-item.active { background-color: var(--primary-dark); color: var(--bg-white); font-weight: 500; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.logout-btn { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-sub); font-size: 14px; cursor: pointer; margin-top: auto; transition: color 0.2s;}
.logout-btn:hover { color: var(--text-main); }

/* ================= 主容器 ================= */
.main-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative;}
.top-header { height: 64px; background-color: var(--bg-white); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; flex-shrink: 0; }
.page-title-text { font-size: 18px; font-weight: 600; }
.user-header-area { display: flex; align-items: center; gap: 12px; visibility: hidden; }
.user-header-area.active { visibility: visible; }
.avatar-small { width: 32px; height: 32px; background: #e2e8f0; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 16px;}
.content-scroll { flex: 1; padding: 32px 48px; overflow-y: auto; position: relative; }
.page-section { max-width: 1200px; margin: 0 auto; display: none; }
.page-section.active { display: block; }

/* 状态切换下拉框 */
.debug-select { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-color); background: #f9fafb; font-size: 13px; color: var(--text-sub); outline: none; cursor: pointer; transition: border 0.2s; }
.debug-select:hover, .debug-select:focus { border-color: var(--primary-blue); color: var(--primary-blue); }

/* ================= 卡片基础样式 ================= */
.card { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.item-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.item-desc { font-size: 13px; color: var(--text-sub); display: flex; align-items: center; gap: 8px; }
.item-tag { background: #f3f4f6; padding: 2px 8px; border-radius: 4px; font-size: 12px; color: var(--text-main); }
.btn-dark { background-color: var(--primary-dark); color: white; border: none; padding: 8px 24px; border-radius: 6px; font-size: 14px; cursor: pointer; font-weight: 500; flex-shrink:0; transition: background 0.2s;}
.btn-dark:hover { background: #334155; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; flex-shrink: 0; }
.dot-online { background-color: var(--success-text); }
.unpurchased-pkg-prompt { color: var(--primary-blue); font-weight: 600; cursor: pointer; font-size: 14px;}
.unpurchased-pkg-prompt:hover { text-decoration: underline; }

/* ================= 纯白登录页 ================= */
.login-page-wrapper { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-white); z-index: 999; display: flex; flex-direction: column; align-items: center; }
.login-nav-top { width: 100%; height: 80px; display: flex; align-items: center; padding: 0 40px; position: absolute; top: 0; left: 0; }
.login-box { border-radius: 12px; padding: 48px; width: 440px; box-sizing: border-box; margin-top: 180px; border: 1px solid var(--border-color); background: var(--bg-white);}
.login-title-center { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 40px; color: var(--primary-dark); }
.phone-input-group { border: 1px solid var(--border-color); border-radius: 8px; height: 52px; display: flex; align-items: center; margin-bottom: 24px; transition: border 0.2s;}
.phone-input-group:focus-within { border-color: var(--primary-dark); }
.country-code-sel { width: 64px; text-align: center; font-size: 14px; font-weight: 500; border-right: 1px solid var(--border-color); color: var(--text-main); }
.tel-input-field { flex: 1; border: none; padding: 0 16px; height: 100%; border-radius: 0 8px 8px 0; font-size: 15px; outline:none; }
.code-input-group { display: flex; justify-content: space-between; margin-bottom: 24px; }
.code-input-box { width: 48px; height: 52px; border: 1px solid var(--border-color); border-radius: 8px; text-align: center; font-size: 22px; font-weight: 600; outline:none; transition: border 0.2s;}
.code-input-box:focus { border-color: var(--primary-dark); }
.invitation-input { width: 100%; border: 1px solid var(--border-color); border-radius: 8px; height: 52px; padding: 0 16px; font-size: 14px; margin-bottom: 32px; outline:none; background: #f9fafb;}
.agreement-row { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 8px; margin-bottom: 40px; justify-content: center;}
.btn-login-action { width: 100%; height: 52px; background: #9ca3af; color: white; font-size: 15px; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s;}
.btn-login-action.active { background: var(--primary-dark); }
.back-link { font-size: 13px; color: var(--text-sub); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 24px; transition: color 0.2s;}

/* ================= 悬浮与弹窗 ================= */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(17, 24, 39, 0.5); z-index: 1002; display: none; justify-content: center; align-items: center; }
.float-dl-btn, .float-cs-btn { position: fixed; right: 32px; bottom: 32px; width: 52px; height: 52px; border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 0 8px 20px rgba(0,0,0,0.1); cursor: pointer; z-index: 100; transition: transform 0.2s; }
.float-dl-btn { background: var(--bg-white); border: 1px solid var(--border-color); color: var(--primary-dark); bottom: 100px; }
.float-cs-btn { background: var(--primary-dark); color: white; }
.float-dl-btn:hover, .float-cs-btn:hover { transform: scale(1.05); }
.qr-tooltip { position: absolute; right: 68px; bottom: 0; background: white; padding: 12px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--border-color); display: none; flex-direction: column; align-items: center; width: 140px; color: var(--text-main); }
.float-cs-btn:hover .qr-tooltip { display: flex; }

/* ================= 主页横幅与统计 ================= */
.warning-banner { background-color: var(--warning-bg); border: 1px solid #fed7aa; border-radius: 8px; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.warning-content { display: flex; align-items: center; gap: 12px; }
.warning-icon { color: var(--warning-text); flex-shrink: 0; }
.btn-orange { background-color: var(--warning-text); color: white; border: none; padding: 8px 24px; border-radius: 6px; font-size: 14px; cursor: pointer; font-weight: 500; flex-shrink: 0;}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-box { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; }
.stat-label { font-size: 13px; color: var(--text-sub); margin-bottom: 12px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-main); }
.stat-unit { font-size: 14px; font-weight: normal; color: var(--text-sub); }
.tag-orange { font-size: 12px; background: var(--warning-bg); color: var(--warning-text); padding: 2px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle;}
.tag-red { font-size: 12px; background: #fef2f2; color: var(--danger-color); padding: 2px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle; border: 1px solid #fecaca;}

/* ================= 个人信息 ================= */
.profile-list { background: var(--bg-white); border-radius: 12px; border: 1px solid var(--border-color); overflow:hidden; }
.profile-item-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); }
.profile-item-row:last-child { border-bottom: none; }
.clickable-row { cursor: pointer; transition: background 0.2s; }
.clickable-row:hover { background: #f9fafb; }
.profile-label-text { font-size: 14px; color: var(--text-sub); }
.profile-val-text { font-size: 14px; font-weight: 500; display:flex; align-items:center; gap:8px;}

/* ================= 购买套餐与确认订单 ================= */
.buy-header-wrap { text-align: center; margin-bottom: 40px; margin-top: 10px; }
.buy-title-main { font-size: 28px; font-weight: 800; margin-bottom: 12px; color: var(--primary-dark); }
.step-badge-wrap { display: flex; justify-content: center; align-items: center; margin-bottom: 16px; margin-top: 32px; font-size: 13px; font-weight: 600; color: var(--text-main); }
.step-badge { background: var(--primary-dark); color: white; padding: 2px 10px; border-radius: 12px; font-size: 11px; margin-right: 8px; }
.select-flex { display: flex; justify-content: center; gap: 16px; }
.sel-card { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 40px; cursor: pointer; text-align: center; background: #ffffff; font-size: 14px; font-weight: 500;}
.sel-card.active { border: 1px solid var(--primary-blue); background: var(--primary-light); color: var(--primary-blue); box-shadow: inset 0 0 0 1px var(--primary-blue);}
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.pricing-card { border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; cursor: pointer; background: #ffffff; display: flex; flex-direction: column; position: relative; }
.pricing-card.active { border: 2px solid var(--primary-blue); background: var(--primary-light); }
.tag-status { position: absolute; top: -12px; right: 20px; font-size: 11px; padding: 4px 12px; border-radius: 100px; color: white; font-weight: 500;}
.bg-gold { background: var(--accent-gold); }
.bg-blue { background: var(--primary-blue); }
.pkg-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pkg-apps { font-size: 12px; color: var(--primary-blue); font-weight: 500; margin-bottom: 20px; min-height: 36px; line-height: 1.4;}
.pkg-price { font-size: 32px; font-weight: 700; margin-bottom: 24px; color: var(--text-main); }
.pkg-price span { font-size: 14px; font-weight: normal; color: var(--text-sub); }
.feature-list { list-style: none; padding: 0; margin: 0 0 12px 0; font-size: 13px; color: var(--text-main); flex: 1; }
.feature-item { margin-bottom: 12px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.feature-item svg { width: 16px; height: 16px; color: #10b981; flex-shrink: 0; margin-top: 1px;}
.checkout-bar { position: sticky; bottom: -32px; background: var(--bg-white); border-top: 1px solid var(--border-color); padding: 16px 48px; display: flex; justify-content: space-between; align-items: center; margin: 32px -48px -32px -48px; box-shadow: 0 -4px 20px rgba(0,0,0,0.06); z-index: 20; }
.btn-pay { background: var(--primary-dark); color: white; padding: 14px 48px; font-size: 16px; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; transition: background 0.2s;}

.checkout-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }
.chk-card { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: 12px; padding: 32px; }
.chk-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 14px; }
.chk-label { color: var(--text-sub); }
.chk-val { font-weight: 600; color: var(--text-main); }
.chk-divider { height: 1px; background: var(--border-color); margin: 24px 0; }
.pay-method-btn { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-color); padding: 16px 20px; border-radius: 8px; margin-bottom: 16px; cursor: pointer; }
.pay-method-btn.active { border-color: var(--primary-blue); background: var(--primary-light); box-shadow: inset 0 0 0 1px var(--primary-blue); }
.pay-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-color); margin-left: auto; display: flex; justify-content: center; align-items: center; flex-shrink: 0;}
.pay-method-btn.active .pay-radio { border-color: var(--primary-blue); }
.pay-method-btn.active .pay-radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--primary-blue); }

/* ================= 财务订单 ================= */
.order-card-new { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 16px; padding: 24px; }
.order-card-new.failed { opacity: 0.6; }
.o-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; font-size: 13px; color: var(--text-sub); }
.o-status { padding: 4px 10px; border-radius: 4px; font-weight: 500; display:flex; align-items:center; gap:6px; font-size: 12px;}
.o-status.pending { background: var(--warning-bg); color: var(--warning-text); }
.o-status.failed { background: #fef2f2; color: var(--danger-color); }
.o-status.success { background: #f0fdf4; color: var(--success-text); }
.o-pkg-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--text-main); }
.o-body { display: grid; grid-template-columns: 3fr 2fr 3fr; gap: 24px; }
.o-col { display: flex; flex-direction: column; }
.o-col .o-label:first-child { margin-top: 0; }
.o-label { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; margin-top: 16px;}
.o-val { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px;}
.o-price { font-size: 16px; font-weight: 700; }
.o-price span { font-size: 12px; font-weight: normal; color: var(--text-sub); }
.o-actions { margin-top: 24px; display: flex; gap: 16px; align-items: center; }
.btn-pay-now { background: var(--primary-dark); color: white; border: none; border-radius: 6px; padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-cancel { background: transparent; color: var(--text-sub); border: none; font-size: 13px; cursor: pointer; }
.o-details-box { background: #f9fafb; border-radius: 8px; padding: 16px; font-size: 13px; }
.od-row { display: flex; justify-content: space-between; margin-bottom: 12px; }

/* ================= 推广中心 ================= */
.promo-top-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 24px; }
.promo-card { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; display:flex; flex-direction:column; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.table th, .table td { padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.copy-icon { width: 16px; height: 16px; color: var(--text-sub); cursor: pointer; margin-left: 8px; }