:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e8ecf1;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-light: rgba(99, 102, 241, 0.08);
    --primary-soft: #eef2ff;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --card-bg: #ffffff;
    --card-border: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --toast-bg: #1e293b;
    --toast-text: #f8fafc;
    --tab-bg: #ffffff;
    --tab-border: #f1f5f9;
    --nav-bg: rgba(255,255,255,0.85);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}


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

body { visibility: hidden; }
html.authed body { visibility: visible; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== Toast ====== */
.toast {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
    background: var(--toast-bg); color: var(--toast-text);
    padding: 12px 24px; border-radius: var(--radius); font-size: 14px;
    z-index: 1000; pointer-events: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: toastIn 2.4s ease forwards;
    font-weight: 500;
}
@keyframes toastIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    8% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* ====== Page views ====== */
.page { display: none; animation: pageIn 0.25s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ====== Page Banner ====== */
.page-banner {
    position: relative; margin: 10px 16px; border-radius: var(--radius-lg);
    overflow: hidden; height: 163px;
    background: var(--primary-gradient);
    box-shadow: 0 2px 12px rgba(99,102,241,0.2);
}
.page-banner .banner-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 1;
}
.page-banner .banner-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: none; z-index: 1;
}
.page-banner .banner-content {
    position: relative; z-index: 2; padding: 20px 18px;
    display: flex; flex-direction: column; justify-content: center;
    height: 100%;
}
.page-banner .banner-title {
    font-size: 20px; font-weight: 700; color: #fff;
    letter-spacing: -0.3px; text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.page-banner .banner-subtitle {
    font-size: 13px; color: rgba(255,255,255,0.85); margin-top: 4px;
    font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* ====== Header ====== */
.page-header {
    padding: 24px 20px 8px;
}
.page-header h1 {
    font-size: 26px; font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* ====== Cards ====== */
.card {
    background: var(--card-bg); border-radius: var(--radius-lg);
    padding: 20px; margin: 10px 16px;
    box-shadow: var(--card-shadow); border: 1px solid var(--card-border);
    transition: box-shadow 0.2s;
}

/* ====== Stats grid ====== */
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 10px; padding: 0 16px; margin-bottom: 8px;
}
.stat-card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 16px 12px; text-align: center;
    box-shadow: var(--card-shadow); border: 1px solid var(--card-border);
    transition: all 0.2s;
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--primary-gradient); opacity: 0;
    transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-value {
    font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card .stat-label {
    font-size: 12px; color: var(--text-secondary); margin-top: 4px;
    font-weight: 500;
}
.stat-card.full { grid-column: 1 / -1; }

/* ====== 2-column stats grid ====== */
.stats-grid-2 {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; padding: 0 16px; margin-bottom: 8px;
}

/* ====== Quick actions ====== */
.quick-actions {
    display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px; padding: 0 16px; margin-bottom: 16px;
}
.quick-action {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 18px 8px; background: var(--card-bg); border-radius: var(--radius);
    border: 1px solid var(--card-border); cursor: pointer;
    transition: all 0.2s; text-decoration: none; color: var(--text);
    box-shadow: var(--card-shadow);
}
.quick-action:hover {
    border-color: var(--primary); transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}
.quick-action .qa-icon {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
}
.quick-action .qa-icon svg { width: 22px; height: 22px; stroke: var(--primary); }
.quick-action .qa-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ====== Task grid ====== */
.cat-wrapper {
    display: grid; grid-template-columns: 1fr;
    gap: 4px;
}
#taskListView {
    padding: 0 16px;
}
.cat-section { margin-bottom: 6px; }
.cat-header {
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    padding: 0 0 6px;
}
.cat-section .task-grid {
    display: flex; flex-direction: column;
    gap: 10px;
}
.task-item {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; background: var(--card-bg); border: 2px solid var(--card-border);
    border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
    box-shadow: var(--card-shadow); position: relative;
}
.task-item:hover {
    border-color: var(--primary); transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover);
}
.task-item.selected {
    border-color: var(--primary); background: var(--primary-soft);
}
.task-checkbox {
    width: 22px; height: 22px; flex-shrink: 0;
    appearance: none; -webkit-appearance: none;
    border: 2px solid var(--border); border-radius: 6px;
    cursor: pointer; position: relative; transition: all 0.2s;
    background: var(--surface);
}
.task-checkbox:checked {
    background: var(--primary); border-color: var(--primary);
}
.task-checkbox:checked::after {
    content: ''; position: absolute; left: 50%; top: 45%;
    width: 6px; height: 11px; border: solid #fff;
    border-width: 0 2px 2px 0; transform: translate(-50%, -50%) rotate(45deg);
}
.task-item .task-icon {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--primary-soft); display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    font-size: 22px; overflow: hidden;
}
.task-item .task-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.task-item .task-icon svg { width: 22px; height: 22px; stroke: var(--primary); }
.task-item .task-info { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; }
.task-item .task-name { font-size: 18px; font-weight: 600; }
.task-item .task-price { font-size: 18px; color: var(--warning); font-weight: 600; white-space: nowrap; margin-left: 8px; }

/* ====== Batch submit bar ====== */
.batch-submit-bar {
    display: flex; gap: 10px; padding: 14px 0;
    align-items: center;
}
.batch-submit-bar .form-input {
    flex: 1; padding: 11px 14px; font-size: 14px; min-width: 0;
}
.batch-submit-bar .btn { padding: 11px 20px; font-size: 14px; border-radius: var(--radius); white-space: nowrap; flex-shrink: 0; }

/* ====== Multi-order list ====== */
.multi-order-item {
    padding: 14px 16px; background: var(--bg); border: 1px solid var(--card-border);
    border-radius: var(--radius); margin-bottom: 10px;
}
.multi-order-item .mo-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.multi-order-item .mo-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--primary-soft); display: flex;
    align-items: center; justify-content: center; font-size: 18px;
    overflow: hidden; flex-shrink: 0;
}
.multi-order-item .mo-icon img {
    width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm);
}
.multi-order-item .mo-name { font-size: 18px; font-weight: 600; flex: 1; }
.multi-order-item .mo-status {
    font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500;
    white-space: nowrap;
}
.mo-status.pending { color: #d97706; background: #fef3c7; }
.mo-status.approved { color: var(--primary); background: var(--primary-soft); }
.mo-status.code_submitted { color: #7c3aed; background: #ede9fe; }
.mo-status.completed { color: #059669; background: #d1fae5; }
.mo-status.rejected { color: #dc2626; background: #fee2e2; }
.multi-order-item .mo-code-row {
    display: flex; gap: 8px; align-items: center;
}
.multi-order-item .mo-code-input {
    flex: 1; padding: 9px 12px; text-align: center;
    background: var(--input-bg); border: 2px solid var(--input-border);
    border-radius: var(--radius-sm); font-size: 16px; font-family: monospace;
    letter-spacing: 2px; outline: none; color: var(--text);
    transition: all 0.2s;
}
.multi-order-item .mo-code-input:focus { border-color: var(--primary); }
.multi-order-item .mo-code-submit {
    padding: 9px 16px; border: none; border-radius: var(--radius-sm);
    background: var(--primary-gradient); color: #fff; cursor: pointer;
    font-size: 13px; white-space: nowrap; font-weight: 600;
    transition: all 0.2s;
}
.multi-order-item .mo-code-submit:hover { opacity: 0.9; }
.multi-order-item .mo-code-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.multi-order-item .mo-countdown {
    font-size: 22px; font-weight: 700; text-align: center; min-width: 48px;
    color: var(--primary); font-variant-numeric: tabular-nums;
}
.multi-order-item .mo-countdown.expired { color: var(--danger); }
.multi-order-item .mo-countdown.waiting { color: var(--text-muted); }

/* ====== Order list ====== */
.order-list { padding: 0 16px; }
.order-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius); margin-bottom: 8px;
    box-shadow: var(--card-shadow); transition: all 0.15s;
}
.order-item:active { background: var(--bg); }
.order-item .oi-left { display: flex; align-items: center; gap: 12px; }
.order-item .oi-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--primary-soft); display: flex;
    align-items: center; justify-content: center; font-size: 18px;
    overflow: hidden; flex-shrink: 0;
}
.order-item .oi-icon img { width: 100%; height: 100%; object-fit: cover; }
.order-item .oi-title { font-size: 14px; font-weight: 500; }
.order-item .oi-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.oi-status {
    font-size: 12px; padding: 4px 10px; border-radius: 20px;
    font-weight: 500; white-space: nowrap;
}
.oi-status.pending { color: #d97706; background: #fef3c7; }
.oi-status.approved { color: var(--primary); background: var(--primary-soft); }
.oi-status.code_submitted { color: #7c3aed; background: #ede9fe; }
.oi-status.completed { color: #059669; background: #d1fae5; }
.oi-status.rejected { color: #dc2626; background: #fee2e2; }
.oi-status.cancelled { color: var(--text-secondary); background: #f1f5f9; }

/* ====== Team section ====== */
.invite-code-box {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--primary-soft); border-radius: var(--radius);
    border: 2px dashed var(--primary); margin-bottom: 4px;
}
.invite-code-box .code-text {
    font-size: 22px; font-weight: 700; letter-spacing: 3px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; flex: 1;
    color: var(--primary);
}
.invite-code-box .copy-btn {
    padding: 8px 20px; border: none; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff; font-size: 13px;
    cursor: pointer; white-space: nowrap; font-weight: 600;
    transition: all 0.2s;
}
.invite-code-box .copy-btn:hover { opacity: 0.9; transform: scale(1.02); }

.invite-link-box {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; background: #f1f5f9; border-radius: var(--radius);
    border: 1px solid var(--border);
}
.invite-link-box .link-text {
    font-size: 11px; flex: 1; color: var(--text-secondary);
    word-break: break-all; line-height: 1.4;
}
.invite-link-box .copy-btn {
    padding: 6px 14px; border: none; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff; font-size: 12px;
    cursor: pointer; white-space: nowrap; font-weight: 600;
    transition: all 0.2s; flex-shrink: 0;
}
.invite-link-box .copy-btn:hover { opacity: 0.9; }

/* ====== Commission rates ====== */
.rates-title { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.rates-row { display: flex; gap: 10px; }
.rate-item {
    flex: 1; text-align: center; padding: 10px 8px;
    background: linear-gradient(135deg, rgba(255,107,107,0.08), rgba(255,107,107,0.02));
    border: 1px solid rgba(255,107,107,0.15); border-radius: var(--radius);
}
.rate-level { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.rate-val { display: block; font-size: 18px; font-weight: 700; color: var(--danger); }

/* ====== Member list ====== */
.member-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px; background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius); margin-bottom: 8px;
    box-shadow: var(--card-shadow);
}
.member-item .mi-left { display: flex; align-items: center; gap: 10px; }
.member-item .mi-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.member-item .mi-name { font-size: 14px; font-weight: 500; }
.member-item .mi-phone { font-size: 12px; color: var(--text-muted); }
.member-item .mi-date { font-size: 12px; color: var(--text-secondary); }

/* ====== Section title ====== */
.section-title {
    font-size: 15px; font-weight: 600; padding: 16px 16px 10px;
    display: flex; align-items: center; justify-content: space-between;
    letter-spacing: -0.3px;
}
.section-title .more { font-size: 13px; color: var(--primary); cursor: pointer; font-weight: 500; }
.section-title .more:hover { text-decoration: underline; }

/* ====== Tabs ====== */
.tabs {
    display: flex; gap: 4px; padding: 4px; margin: 0 16px 12px;
    background: var(--bg); border-radius: var(--radius);
}
.tab {
    flex: 1; padding: 9px 18px; font-size: 13px; cursor: pointer; text-align: center;
    color: var(--text-secondary); border-radius: 10px; transition: all 0.2s;
    font-weight: 500; border: none; background: transparent;
}
.tab.active {
    background: var(--surface); color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); font-weight: 600;
}

/* ====== Buttons ====== */
.btn {
    padding: 12px 28px; border-radius: var(--radius); border: none;
    font-size: 15px; cursor: pointer; transition: all 0.2s;
    font-family: inherit; font-weight: 600;
}
.btn-primary {
    background: var(--primary-gradient); color: #fff; width: 100%;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline {
    background: transparent; border: 2px solid var(--border);
    color: var(--text-secondary); padding: 8px 20px;
}

/* ====== Input ====== */
.form-input {
    width: 100%; padding: 12px 16px;
    background: var(--input-bg); border: 2px solid var(--input-border);
    border-radius: var(--radius); color: var(--text); font-size: 15px;
    outline: none; transition: all 0.2s; font-family: inherit;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 13px;
    color: var(--text-secondary); margin-bottom: 6px; font-weight: 500;
}

/* ====== Modal ====== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 200;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s; backdrop-filter: blur(4px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: var(--card-bg); border-radius: var(--radius-xl); padding: 24px;
    width: 90%; max-width: 400px; box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-box h3 { font-size: 18px; margin-bottom: 16px; text-align: center; font-weight: 700; }
.modal-box .btn { margin-top: 12px; }

/* ====== Bottom nav ====== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    margin: 0 16px 12px;
    background: var(--nav-bg); backdrop-filter: blur(16px);
    display: flex; z-index: 100; padding: 6px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 0 0 1px var(--card-border);
}
.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 8px 0 6px; cursor: pointer; transition: all 0.2s;
    color: var(--text-muted); text-decoration: none; border-radius: var(--radius);
    font-weight: 500;
}
.nav-item .nav-icon svg { width: 22px; height: 22px; }
.nav-item .nav-label { font-size: 10px; margin-top: 3px; }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon svg { stroke: var(--primary); }

/* ====== Pay Method Tabs ====== */
.pay-method-tabs {
    display: flex; gap: 6px;
}
.pay-method-tab {
    flex: 1; padding: 10px 0; text-align: center; font-size: 13px;
    background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all 0.2s; font-weight: 500; color: var(--text-secondary);
}
.pay-method-tab.active {
    background: var(--primary-soft); border-color: var(--primary); color: var(--primary);
    font-weight: 600;
}

/* ====== Withdraw ====== */
.withdraw-amount {
    text-align: center; font-size: 36px; font-weight: 800;
    padding: 16px 0 8px;
    background: var(--primary-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

/* ====== Support ticket ====== */
.ticket-item {
    padding: 16px; background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius); margin-bottom: 8px;
    box-shadow: var(--card-shadow);
}
.ticket-item .ticket-subject { font-size: 15px; font-weight: 600; }
.ticket-item .ticket-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.ticket-item .ticket-status { font-size: 12px; margin-top: 6px; font-weight: 500; }
.ticket-item .ticket-reply {
    margin-top: 10px; padding: 12px; background: var(--bg);
    border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6;
    border-left: 3px solid var(--primary);
}

/* ====== Empty state ====== */
.empty {
    text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty .empty-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.6; }
.empty p { font-size: 14px; margin-top: 4px; }

/* ====== Profile menu ====== */
.profile-menu {
    padding: 0 16px; border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
}
.menu-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; background: var(--card-bg); cursor: pointer;
    transition: all 0.15s; border-bottom: 1px solid var(--card-border);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg); }
.menu-item:active { background: var(--primary-soft); }
.menu-item .mi-left { display: flex; align-items: center; gap: 14px; }
.menu-item .mi-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.menu-item .mi-text { font-size: 14px; font-weight: 500; }
.menu-item .mi-arrow { color: var(--text-muted); font-size: 18px; }

/* ====== Filter tabs ====== */
.filter-tabs {
    display: flex; gap: 6px; padding: 0 16px; margin-bottom: 12px;
    overflow-x: auto; scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
    padding: 7px 16px; border-radius: 20px; font-size: 12px;
    background: var(--bg); border: 1px solid var(--border);
    cursor: pointer; white-space: nowrap; transition: all 0.2s;
    font-weight: 500;
}
.filter-tab.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}

/* ====== Code submission card ====== */
.code-card {
    padding: 18px; background: var(--bg); border: 2px solid var(--border);
    border-radius: var(--radius); margin-bottom: 10px;
}
.code-card .cc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.code-card .cc-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--primary-soft); display: flex;
    align-items: center; justify-content: center; font-size: 20px;
    overflow: hidden;
}
.code-card .cc-icon img {
    width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm);
}
.code-card .cc-name { font-size: 15px; font-weight: 600; }
.code-card .cc-status { font-size: 11px; margin-top: 2px; font-weight: 500; }
.code-card .cc-status.waiting { color: var(--text-muted); }
.code-card .cc-status.done { color: var(--success); }
.code-card .cc-status.rejected { color: var(--danger); }
.code-card .cc-row { display: flex; gap: 8px; }
.code-card .cc-input {
    flex: 1; padding: 10px 14px; text-align: center;
    background: var(--input-bg); border: 2px solid var(--input-border);
    border-radius: var(--radius-sm); font-size: 18px; font-family: monospace;
    letter-spacing: 3px; outline: none; color: var(--text);
    transition: all 0.2s;
}
.code-card .cc-input:focus { border-color: var(--primary); }
.code-card .cc-submit {
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    background: var(--primary-gradient); color: #fff; cursor: pointer;
    font-size: 14px; white-space: nowrap; font-weight: 600;
    transition: all 0.2s;
}
.code-card .cc-submit:hover { opacity: 0.9; }

/* ====== Spinner ====== */
.spinner {
    width: 40px; height: 40px; border: 4px solid var(--border);
    border-top: 4px solid var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== Status panel ====== */
.status-panel { text-align: center; padding: 36px 20px; }
.status-panel .status-icon { font-size: 56px; margin-bottom: 12px; }
.status-panel .status-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.status-panel .status-desc { font-size: 14px; color: var(--text-secondary); }

/* ====== Commission item ====== */
.commission-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px; background: var(--bg); border-radius: var(--radius);
    margin-bottom: 6px; border: 1px solid var(--card-border);
}
.commission-item .c-left { display: flex; flex-direction: column; gap: 2px; }
.commission-item .c-desc { font-size: 13px; font-weight: 500; }
.commission-item .c-level { font-size: 11px; color: var(--text-muted); }
.commission-item .c-amount { font-size: 16px; font-weight: 700; color: var(--success); }

/* ====== User profile header ====== */
.user-avatar-circle {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--primary-gradient); margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #fff; font-weight: 700;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

/* ====== Article / Tutorial ====== */
.article-card {
    padding: 14px 16px; background: var(--card-bg);
    border: 1px solid var(--card-border); border-radius: var(--radius);
    margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
    box-shadow: var(--card-shadow);
}
.article-card:hover {
    border-color: var(--primary); transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover);
}
.article-card-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.article-card-summary { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.5; }
.article-card-time { font-size: 11px; color: var(--text-muted); }
.article-body { font-size: 14px; line-height: 1.8; color: var(--text-primary); word-break: break-word; }
.article-body img { max-width: 100%; border-radius: 8px; }
.article-body p { margin-bottom: 10px; }
.article-body h1, .article-body h2, .article-body h3 { margin: 16px 0 8px; }
.article-body ul, .article-body ol { padding-left: 20px; margin-bottom: 10px; }
.article-body blockquote {
    border-left: 3px solid var(--primary); padding: 8px 14px;
    margin: 10px 0; background: var(--primary-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

/* ====== 响应式适配 ====== */

/* 平板及以下 */
@media (max-width: 768px) {
    #taskListView { padding: 0 12px; }
    .cat-wrapper {
        grid-template-columns: 1fr;
    }
    .cat-header { padding: 0 0 6px; }
    .stats-grid, .stats-grid-2 { padding: 0 12px; gap: 8px; }
    .order-list, #teamMemberList, #teamCommissionList, #ticketList { padding: 0 12px !important; }
    .batch-submit-bar { padding: 12px 0; }
    .page-header { padding: 14px 16px 8px; }
    .section-title { padding: 16px 12px 8px; }
}

/* 手机 */
@media (max-width: 480px) {
    #taskListView { padding: 0 8px; }
    .cat-wrapper {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .cat-section { margin-bottom: 4px; }
    .cat-section .task-grid { gap: 6px; }
    .cat-header { padding: 0 0 4px; font-size: 12px; }
    .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
    .stats-grid, .stats-grid-2 {
        gap: 6px; padding: 0 8px;
    }
    .task-item { padding: 12px; gap: 8px; }
    .task-item .task-icon { width: 36px; height: 36px; font-size: 18px; }
    .task-item .task-name { font-size: 16px; }
    .task-item .task-price { font-size: 16px; }
    .task-checkbox { width: 18px; height: 18px; }
    .order-list, #teamMemberList, #teamCommissionList, #ticketList { padding: 0 8px !important; }
    .batch-submit-bar { padding: 10px 0; }
    .page-header { padding: 10px 12px 6px; }
    .page-header h1 { font-size: 18px; }
    .section-title { padding: 12px 8px 6px; font-size: 14px; }
    .bottom-nav { padding: 6px 4px; }
    .nav-item { padding: 6px 0 4px; }
    .nav-item .nav-label { font-size: 9px; }
    .card { padding: 14px; margin: 0 8px 12px; }
    .tabs { padding: 8px 8px 0; gap: 4px; }
    .tab { padding: 8px 14px; font-size: 13px; }
    .profile-menu { padding: 0 8px; }
}

/* 中等屏幕 */
@media (min-width: 768px) {
    .cat-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px 12px;
    }
}

/* 大屏优化 */
@media (min-width: 1024px) {
    .cat-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}
