/* 来单啦用户中心 —— 移动端优先，品牌色与官网一致（Primary #2E7DF6） */
:root {
    --primary: #2E7DF6;
    --primary-dark: #1E63D8;
    --primary-soft: #EAF2FE;
    --primary-soft-stroke: #C9E2FF;
    --success: #12B76A;
    --success-soft: #E6F8F0;
    --warning: #F79009;
    --warning-soft: #FFF6E8;
    --danger: #E5484D;
    --text: #1A1D23;
    --sub-text: #6B7280;
    --tertiary-text: #9AA1AC;
    --page-bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --border-light: #EDF0F5;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(16, 24, 40, 0.06);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--page-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
[hidden] { display: none !important; }

.app-shell {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--page-bg);
    padding-bottom: env(safe-area-inset-bottom);
}

/* ============ 顶部栏 ============ */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}

.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.brand svg { width: 28px; height: 28px; }

.link-btn, .text-btn {
    background: none; border: none; padding: 4px 2px;
    color: var(--primary); font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit;
}

/* ============ 登录页 ============ */
.login-view { padding: 0 16px 40px; }

.login-hero { text-align: center; padding: 56px 0 28px; }

.login-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-logo svg { width: 64px; height: 64px; }

.login-hero h1 { font-size: 22px; font-weight: 800; }
.login-hero p { margin-top: 6px; color: var(--sub-text); font-size: 14px; }

.login-card { display: flex; flex-direction: column; gap: 14px; }

.login-tip { font-size: 12px; color: var(--tertiary-text); text-align: center; }

.login-footer {
    margin-top: 24px; text-align: center;
    font-size: 13px; color: var(--tertiary-text);
    display: flex; gap: 8px; justify-content: center;
}

/* ============ 卡片与表单 ============ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 16px;
    margin-bottom: 14px;
}

.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--sub-text); }

input, select {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #F8FAFC;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

input:focus, select:focus { border-color: var(--primary); background: #fff; }

.readonly-input { background: #F3F5F9; color: var(--sub-text); }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 46px; padding: 0 18px;
    border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: opacity 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(46, 125, 246, 0.26); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--sub-text); border: 1px solid var(--border-light); }
.btn-block { width: 100%; }

.stack-form { display: flex; flex-direction: column; gap: 10px; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sub-text); }
.check-row input { width: 18px; height: 18px; }

.hint { font-size: 12px; color: var(--tertiary-text); margin-top: 8px; }

/* ============ 主界面 ============ */
.main-view { padding: 14px 16px 0; }

.profile-head {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, #2E7DF6 0%, #4B93FF 100%);
    color: #fff; box-shadow: 0 8px 24px rgba(46, 125, 246, 0.28);
}

.avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.24);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700;
}

.profile-head-text { flex: 1; min-width: 0; }
.profile-head-text h2 { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head-text p { font-size: 13px; opacity: 0.88; }

.vip-badge {
    flex-shrink: 0;
    padding: 5px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 12px; font-weight: 600;
}

.info-list { display: flex; flex-direction: column; }
.info-list > div {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.info-list > div:last-child { border-bottom: none; }
.info-list dt { color: var(--sub-text); flex-shrink: 0; }
.info-list dd { text-align: right; word-break: break-all; }

.invite-code {
    font-size: 30px; font-weight: 800; letter-spacing: 4px;
    color: var(--primary); text-align: center; padding: 6px 0 12px;
}

.invite-link-row { display: flex; gap: 8px; }
.invite-link-row input { flex: 1; font-size: 13px; }
.invite-link-row .btn { flex-shrink: 0; height: 46px; }

.links-card { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.links-card a { color: var(--sub-text); }

/* ============ 推广 / 佣金 ============ */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

.stat-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px;
    display: flex; flex-direction: column; gap: 2px;
}

.stat-label { font-size: 12px; color: var(--sub-text); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.3; }
.stat-value.small { font-size: 19px; letter-spacing: 1px; }
.stat-unit { font-size: 12px; color: var(--tertiary-text); }

.filter-card { padding: 14px 16px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub-text); }
.filter-item input { height: 42px; font-size: 14px; }
.filter-actions { display: flex; gap: 10px; margin-top: 12px; }
.filter-actions .btn { flex: 1; }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 6px 2px 10px;
}
.section-head h3 { font-size: 15px; font-weight: 700; }
.section-head span { font-size: 12px; color: var(--tertiary-text); }
.section-head.inside { padding-top: 0; }

.list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.row {
    background: var(--card-bg); border-radius: 14px;
    box-shadow: var(--shadow); padding: 14px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}

.row-main { min-width: 0; flex: 1; }
.row-title { font-size: 15px; font-weight: 600; }
.row-sub { font-size: 12.5px; color: var(--sub-text); margin-top: 4px; }
.row-side { text-align: right; flex-shrink: 0; }
.row-amount { font-size: 16px; font-weight: 700; color: var(--primary); }
.row-time { font-size: 12px; color: var(--tertiary-text); margin-top: 4px; }

.tag {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
    background: var(--primary-soft); color: var(--primary-dark);
}
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.orange { background: var(--warning-soft); color: var(--warning); }
.tag.gray { background: #F1F3F7; color: var(--sub-text); }
.tag.red { background: #FDECEC; color: var(--danger); }

.empty {
    text-align: center; color: var(--tertiary-text);
    font-size: 13px; padding: 26px 0;
    background: var(--card-bg); border-radius: 14px; box-shadow: var(--shadow);
}

/* ============ 佣金汇总 ============ */
.commission-summary { background: #fff; }

.commission-main {
    padding: 4px 0 12px;
    border-bottom: 1px dashed var(--border-light);
    margin-bottom: 12px;
}
.commission-main span { font-size: 13px; color: var(--sub-text); }
.commission-main strong {
    display: block; font-size: 34px; font-weight: 800;
    color: var(--primary); line-height: 1.25;
}

.commission-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px 8px; margin-bottom: 6px;
}
.commission-grid > div { display: flex; flex-direction: column; gap: 2px; }
.commission-grid span { font-size: 12px; color: var(--sub-text); }
.commission-grid b { font-size: 15px; font-weight: 700; }

/* ============ 账户行 ============ */
.account-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.account-row:last-child { border-bottom: none; }
.account-main { min-width: 0; }
.account-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.account-sub { font-size: 12px; color: var(--sub-text); margin-top: 2px; }
.account-actions { display: flex; gap: 10px; flex-shrink: 0; }
.account-actions button { background: none; border: none; color: var(--sub-text); font-size: 12.5px; cursor: pointer; font-family: inherit; }
.account-actions button.danger { color: var(--danger); }

/* ============ 底部导航 ============ */
.bottom-space { height: 78px; }

.tabbar {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 100%; max-width: 560px;
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-light);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 30;
}

.tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 9px 0 8px;
    background: none; border: none; cursor: pointer;
    font-size: 11.5px; font-family: inherit;
    color: var(--tertiary-text);
}
.tab .tab-icon { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: 0.6; }
.tab.active { color: var(--primary); font-weight: 600; }
.tab.active .tab-icon { filter: none; opacity: 1; }

/* ============ 弹窗 / 提示 ============ */
.modal-mask {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(16, 24, 40, 0.45);
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0;
}

.modal {
    width: 100%; max-width: 560px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 12px;
    max-height: 90vh; overflow-y: auto;
    animation: slide-up 0.22s ease-out;
}

@keyframes slide-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }

.modal h3 { font-size: 17px; font-weight: 700; }
.modal-sub { font-size: 13px; color: var(--sub-text); }
.modal-sub b { color: var(--primary); font-size: 16px; }

.toast {
    position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    max-width: 78%;
    padding: 11px 18px;
    background: rgba(26, 29, 35, 0.88);
    color: #fff;
    font-size: 14px;
    border-radius: 10px;
    text-align: center;
    pointer-events: none;
}

@media (min-width: 600px) {
    body { background: #EEF2F7; }
    .app-shell { box-shadow: 0 0 40px rgba(16, 24, 40, 0.08); }
}
