/* 半夏代练后台 — delta 新前端样式 (from /volume1/update/index.html) */
:root {
        /* === Ink (sidebar / dark surfaces) === */
        --ink-900: #0a0a0f;
        --ink-850: #0f0f16;
        --ink-800: #14141c;
        --ink-700: #1e1e28;
        --ink-600: #2a2a38;
        --ink-500: #475569;
        --ink-400: #64748b;
        --ink-300: #94a3b8;
        --ink-200: #cbd5e1;
        --ink-100: #e2e8f0;

        /* === Surface (light content) === */
        --bg: #f8f8f6;
        --bg-alt: #f0efed;
        --surface: #ffffff;
        --surface-alt: #fbfaf8;
        --surface-hover: #f5f3ef;
        --border: #e7e5e0;
        --border-strong: #d6d3cc;
        --border-soft: #f2f0ec;

        /* === Text === */
        --text: #0f172a;
        --text-secondary: #475569;
        --text-muted: #94a3b8;

        /* === Accent (amber gold) === */
        --accent: #f59e0b;
        --accent-dark: #d97706;
        --accent-light: #fbbf24;
        --accent-soft: rgba(245,158,11,0.10);
        --accent-softer: rgba(245,158,11,0.05);
        --accent-glow: rgba(245,158,11,0.30);

        /* === Status === */
        --success: #10b981;
        --success-dark: #059669;
        --success-light: #34d399;
        --success-soft: rgba(16,185,129,0.08);
        --warning: #f59e0b;
        --warning-soft: rgba(245,158,11,0.12);
        --warning-text: #b45309;
        --danger: #ef4444;
        --danger-soft: rgba(239,68,68,0.08);
        --danger-text: #dc2626;
        --info: #3b82f6;
        --info-soft: rgba(59,130,246,0.08);
        --info-text: #2563eb;
        --purple: #8b5cf6;
        --purple-soft: rgba(139,92,246,0.08);
        --purple-text: #7c3aed;
        --wechat: #07c160;
        --wechat-soft: rgba(7,193,96,0.08);

        /* === Shadows === */
        --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
        --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.07), 0 2px 6px -2px rgba(0,0,0,0.04);
        --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.09), 0 4px 8px -2px rgba(0,0,0,0.05);
        --shadow-xl: 0 24px 48px -8px rgba(0,0,0,0.12);

        /* === Radius === */
        --r-xs: 4px;
        --r-sm: 6px;
        --r-md: 10px;
        --r-lg: 14px;
        --r-xl: 20px;
        --r-full: 9999px;

        /* === Layout === */
        --sidebar-w: 256px;
        --navbar-h: 64px;

        /* === Transitions === */
        --t-fast: 0.15s ease;
        --t: 0.25s cubic-bezier(0.4,0,0.2,1);
    }

    * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

    body {
        background: var(--bg);
        font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        color: var(--text);
        min-height: 100vh;
        line-height: 1.6;
        font-size: 15px;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* === LOGIN === */
    .login-wrapper {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--ink-900);
        padding: 20px;
        position: relative;
        overflow: hidden;
    }
    .login-wrapper::before {
        content: '';
        position: absolute;
        inset: 0;
        background:
            radial-gradient(ellipse at 20% 20%, rgba(245,158,11,0.20) 0%, transparent 50%),
            radial-gradient(ellipse at 80% 80%, rgba(217,119,6,0.14) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 50%, rgba(251,191,36,0.05) 0%, transparent 70%);
        pointer-events: none;
    }
    .login-wrapper::after {
        content: '';
        position: absolute;
        inset: 0;
        background-image:
            linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
        background-size: 44px 44px;
        mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
        -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
        pointer-events: none;
    }
    @keyframes float {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-12px); }
    }

    .login-card {
        background: var(--surface);
        border-radius: var(--r-xl);
        box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.05);
        width: 100%;
        max-width: 440px;
        overflow: hidden;
        position: relative;
        z-index: 1;
        animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1);
    }
    @keyframes slideUp {
        from { opacity: 0; transform: translateY(40px) scale(0.97); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .login-header {
        background: var(--ink-900);
        color: white;
        padding: 44px 32px 36px;
        text-align: center;
        position: relative;
        overflow: hidden;
    }
    .login-header::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse at 50% 0%, rgba(245,158,11,0.22) 0%, transparent 60%);
    }
    .login-header::after {
        content: '';
        position: absolute;
        bottom: -1px; left: 0; right: 0;
        height: 32px;
        background: var(--surface);
        border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    }
    .login-logo { margin-bottom: 16px; display: block; position: relative; z-index: 1; }
    .login-logo img { width: 72px; height: auto; margin: 0 auto; display: block; border-radius: var(--r-md); }
    .login-logo .brand-emoji {
        font-size: 2.8rem;
        display: inline-block;
        filter: drop-shadow(0 4px 12px rgba(245,158,11,0.45));
    }
    .login-header h2 {
        font-family: 'Sora', sans-serif;
        font-size: 1.8rem;
        font-weight: 800;
        margin-bottom: 6px;
        letter-spacing: -0.5px;
        position: relative;
        z-index: 1;
    }
    .login-header p { opacity: 0.65; font-size: 0.875rem; position: relative; z-index: 1; font-weight: 500; }

    .login-body { padding: 36px 32px 32px; }
    .form-group { margin-bottom: 20px; }
    .form-group label {
        display: block;
        font-weight: 600;
        font-size: 0.8125rem;
        color: var(--text);
        margin-bottom: 8px;
        letter-spacing: 0.02em;
    }

    .input-wrapper { position: relative; }
    .input-wrapper .icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.05rem;
        color: var(--text-muted);
        pointer-events: none;
        z-index: 1;
    }

    input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="url"], select, textarea {
        width: 100%;
        padding: 13px 16px;
        border: 2px solid var(--border);
        border-radius: var(--r-md);
        font-size: 0.9375rem;
        font-family: inherit;
        background: var(--surface-alt);
        color: var(--text);
        transition: var(--t-fast);
        outline: none;
    }
    .input-wrapper input { padding-left: 46px; }
    input:focus, select:focus, textarea:focus {
        border-color: var(--accent);
        background: var(--surface);
        box-shadow: 0 0 0 4px var(--accent-soft);
    }
    input::placeholder { color: var(--text-muted); }
    textarea { resize: vertical; min-height: 80px; }

    /* === BUTTONS === */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 13px 22px;
        border: none;
        border-radius: var(--r-md);
        font-weight: 600;
        font-size: 0.9375rem;
        font-family: inherit;
        cursor: pointer;
        transition: var(--t-fast);
        text-decoration: none;
        white-space: nowrap;
        line-height: 1.4;
    }
    .btn-primary {
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
        color: white;
        box-shadow: 0 2px 8px var(--accent-glow);
    }
    .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
    .btn-primary:active { transform: translateY(0); }

    .btn-success { background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%); color: white; }
    .btn-warning { background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%); color: white; }
    .btn-danger { background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%); color: white; }
    .btn-info { background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%); color: white; }
    .btn-secondary {
        background: var(--surface-hover);
        color: var(--text-secondary);
        border: 1px solid var(--border);
    }
    .btn-secondary:hover { background: var(--border); color: var(--text); }

    .btn-sm { padding: 9px 16px; font-size: 0.8125rem; border-radius: var(--r-sm); }
    .btn-full { width: 100%; }

    .login-hint { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 0.8125rem; }

    /* === MAIN INTERFACE === */
    .main-interface { display: none; min-height: 100vh; margin-left: var(--sidebar-w); transition: margin-left var(--t); }

    /* === SIDEBAR / NAVBAR === */
    .navbar {
        background: var(--ink-900);
        border-right: 1px solid rgba(255,255,255,0.06);
        padding: 0;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--sidebar-w);
        z-index: 200;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .navbar::-webkit-scrollbar { width: 4px; }
    .navbar::-webkit-scrollbar-track { background: transparent; }
    .navbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

    .navbar-inner {
        display: flex;
        flex-direction: column;
        min-height: 100%;
        padding: 0;
    }

    .nav-brand {
        font-family: 'Sora', sans-serif;
        font-weight: 800;
        font-size: 1.125rem;
        color: white;
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        white-space: nowrap;
        padding: 22px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .nav-brand img { height: 30px; width: auto; object-fit: contain; }
    .nav-brand .brand-emoji-nav {
        font-size: 1.5rem;
        line-height: 1;
    }
    .nav-brand span {
        background: none;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
        background-clip: unset;
        color: white;
    }

    .menu-toggle {
        display: none;
        background: none;
        border: none;
        font-size: 1.4rem;
        cursor: pointer;
        color: var(--text);
        padding: 8px;
        border-radius: var(--r-sm);
        transition: var(--t-fast);
    }
    .menu-toggle:hover { background: var(--surface-hover); }

    .nav-menu {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 16px 12px;
        flex: 1;
    }
    .nav-item {
        background: none;
        border: none;
        padding: 11px 14px;
        border-radius: var(--r-md);
        font-weight: 600;
        font-size: 0.875rem;
        cursor: pointer;
        color: var(--ink-300);
        transition: var(--t-fast);
        font-family: inherit;
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        width: 100%;
        position: relative;
        letter-spacing: 0.01em;
    }
    .nav-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        opacity: 0.7;
    }
    .nav-item:hover {
        background: rgba(255,255,255,0.04);
        color: #e2e8f0;
    }
    .nav-item:hover svg { opacity: 1; }
    .nav-item.active {
        background: var(--accent-soft);
        color: var(--accent-light);
    }
    .nav-item.active svg { opacity: 1; }
    .nav-item.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 20px;
        background: var(--accent);
        border-radius: 0 3px 3px 0;
    }
    .nav-item-danger {
        color: #f87171 !important;
        border-top: 1px solid rgba(255,255,255,0.06);
        margin-top: 8px;
        padding-top: 16px;
    }
    .nav-item-danger:hover { background: rgba(239,68,68,0.08) !important; color: #fca5a5 !important; }

    .nav-user {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        border-top: 1px solid rgba(255,255,255,0.06);
    }
    .username-badge {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        background: rgba(255,255,255,0.04);
        border-radius: var(--r-md);
        font-weight: 600;
        font-size: 0.8125rem;
        color: #e2e8f0;
        flex: 1;
    }
    .username-badge .avatar {
        width: 30px;
        height: 30px;
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 0.75rem;
        font-weight: 700;
        flex-shrink: 0;
    }
    .username-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .inline-logout-btn {
        background: none;
        border: none;
        margin-left: 4px;
        cursor: pointer;
        font-size: 0.75rem;
        color: var(--ink-400);
        padding: 4px 8px;
        border-radius: var(--r-xs);
        transition: var(--t-fast);
        font-family: inherit;
        flex-shrink: 0;
    }
    .inline-logout-btn:hover { background: rgba(239,68,68,0.1); color: #f87171; }

    .mobile-logout-btn { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-secondary); padding: 8px; border-radius: var(--r-sm); transition: var(--t-fast); }
    .mobile-logout-btn:hover { background: var(--surface-hover); color: var(--danger); }
    .mobile-user-bar {
        display: none;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        gap: 12px;
        height: var(--navbar-h);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .mobile-user-info { display: flex; align-items: center; gap: 10px; flex: 1; }
    .mobile-avatar {
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 0.875rem;
        font-weight: 700;
        flex-shrink: 0;
    }
    .mobile-username { font-weight: 600; font-size: 0.9375rem; color: var(--text) !important; }
    .mobile-logout {
        background: var(--danger-soft);
        border: 1px solid rgba(239,68,68,0.2);
        color: var(--danger);
        padding: 8px 16px;
        border-radius: var(--r-full);
        font-weight: 600;
        font-size: 0.8125rem;
        cursor: pointer;
        transition: var(--t-fast);
        font-family: inherit;
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }
    .mobile-logout:hover { background: rgba(239,68,68,0.12); }

    /* === CONTENT === */
    .content {
        max-width: 1320px;
        margin: 0 auto;
        padding: 32px;
    }
    .page { display: none; animation: fadeIn 0.35s ease; }
    .page.active { display: block; }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .page-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 24px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .page-title {
        font-family: 'Sora', sans-serif;
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text);
        display: flex;
        align-items: center;
        gap: 10px;
        letter-spacing: -0.02em;
    }

    /* === STAT CARDS === */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
        margin-bottom: 28px;
    }
    .stat-card {
        background: var(--surface);
        border-radius: var(--r-lg);
        padding: 24px;
        box-shadow: var(--shadow-xs);
        border: 1px solid var(--border);
        transition: var(--t);
        position: relative;
        overflow: hidden;
    }
    .stat-card::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
        opacity: 0;
        transition: var(--t);
    }
    .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
    .stat-card:hover::before { opacity: 1; }
    .stat-card.pending::before { background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%); opacity: 1; }
    .stat-card.assigned::before { background: linear-gradient(90deg, var(--info) 0%, #60a5fa 100%); opacity: 1; }
    .stat-card.completed::before { background: linear-gradient(90deg, var(--success) 0%, var(--success-light) 100%); opacity: 1; }

    .stat-icon {
        width: 44px;
        height: 44px;
        border-radius: var(--r-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        margin-bottom: 16px;
        background: var(--surface-hover);
    }
    .stat-card.pending .stat-icon { background: var(--warning-soft); }
    .stat-card.assigned .stat-icon { background: var(--info-soft); }
    .stat-card.completed .stat-icon { background: var(--success-soft); }

    .stat-value {
        font-family: 'Sora', sans-serif;
        font-size: 2rem;
        font-weight: 800;
        color: var(--text);
        line-height: 1;
        margin-bottom: 6px;
        letter-spacing: -0.03em;
    }
    .stat-label {
        color: var(--text-secondary);
        font-size: 0.8125rem;
        font-weight: 500;
    }

    /* === CARDS === */
    .card {
        background: var(--surface);
        border-radius: var(--r-lg);
        box-shadow: var(--shadow-xs);
        border: 1px solid var(--border);
        overflow: hidden;
    }
    .card-header {
        padding: 18px 24px;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
    }
    .card-title {
        font-family: 'Sora', sans-serif;
        font-size: 1.0625rem;
        font-weight: 600;
        color: var(--text);
        display: flex;
        align-items: center;
        gap: 8px;
        letter-spacing: -0.01em;
    }
    .card-body { padding: 24px; }

    /* === TABLES === */
    .table-wrapper { overflow-x: auto; margin: 0 -4px; }
    table { width: 100%; border-collapse: collapse; }
    th {
        background: var(--surface-alt);
        padding: 12px 16px;
        text-align: left;
        font-weight: 600;
        font-size: 0.6875rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted);
        white-space: nowrap;
        border-bottom: 1px solid var(--border);
    }
    td {
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-soft);
        font-size: 0.875rem;
        vertical-align: middle;
    }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background: var(--surface-alt); }
    .orders-table td:first-child,
    .users-table td:first-child {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.8125rem;
        font-weight: 500;
        color: var(--text-secondary);
    }

    /* === BADGES === */
    .badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 5px 11px;
        border-radius: var(--r-full);
        font-size: 0.75rem;
        font-weight: 600;
    }
    .badge-pending { background: var(--warning-soft); color: var(--warning-text); }
    .badge-assigned { background: var(--info-soft); color: var(--info-text); }
    .badge-completed { background: var(--success-soft); color: var(--success-dark); }
    .badge-settled { background: var(--purple-soft); color: var(--purple-text); }

    /* === FILTER BAR === */
    .filter-bar { display: flex; gap: 10px; flex-wrap: wrap; }
    .filter-bar input, .filter-bar select {
        flex: 1;
        min-width: 140px;
        padding: 10px 14px;
        font-size: 0.875rem;
    }
    .filter-bar .action-group { flex: 0 0 auto; }

    /* === ORDER LIST === */
    .order-list { display: flex; flex-direction: column; gap: 16px; }
    .order-card {
        background: var(--surface);
        border-radius: var(--r-lg);
        border: 1px solid var(--border);
        padding: 24px;
        transition: var(--t);
    }
    .order-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent-light); }
    .order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 16px; }
    .order-number {
        background: var(--surface-hover);
        padding: 4px 10px;
        border-radius: var(--r-xs);
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--text-secondary);
    }
    .order-reward {
        font-family: 'Sora', sans-serif;
        font-size: 1.375rem;
        font-weight: 800;
        color: var(--accent);
        white-space: nowrap;
    }
    .order-title { font-weight: 700; font-size: 1.0625rem; margin-bottom: 8px; color: var(--text); }
    .order-desc { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 16px; line-height: 1.6; }
    .order-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
    .meta-tag {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 4px 10px;
        background: var(--surface-hover);
        border-radius: var(--r-xs);
        font-size: 0.75rem;
        color: var(--text-secondary);
        font-weight: 500;
    }
    .order-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 16px;
        border-top: 1px solid var(--border-soft);
    }
    .order-actions .btn { flex: 1; min-width: 100px; }

    /* === FORMS === */
    .form-card {
        background: var(--surface);
        border-radius: var(--r-lg);
        border: 1px solid var(--border);
        padding: 28px;
        margin-bottom: 24px;
    }
    .form-card h3 {
        font-family: 'Sora', sans-serif;
        font-size: 1.0625rem;
        font-weight: 600;
        margin-bottom: 22px;
        display: flex;
        align-items: center;
        gap: 8px;
        letter-spacing: -0.01em;
    }
    .form-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        margin-bottom: 16px;
    }

    /* === RANK LIST === */
    .rank-list { display: flex; flex-direction: column; gap: 8px; }
    .rank-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: var(--surface-alt);
        border-radius: var(--r-md);
        transition: var(--t-fast);
        border: 1px solid var(--border-soft);
    }
    .rank-item:hover { background: var(--surface-hover); border-color: var(--border); }
    .rank-item .rank-pos {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Sora', sans-serif;
        font-weight: 700;
        font-size: 0.875rem;
        margin-right: 14px;
        background: var(--surface-hover);
        color: var(--text-muted);
        flex-shrink: 0;
    }
    .rank-item:first-child .rank-pos { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: white; }
    .rank-item:nth-child(2) .rank-pos { background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%); color: white; }
    .rank-item:nth-child(3) .rank-pos { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); color: white; }
    .rank-username { flex: 1; font-weight: 600; font-size: 0.9375rem; }
    .rank-count {
        background: var(--accent-soft);
        color: var(--accent-dark);
        padding: 4px 12px;
        border-radius: var(--r-full);
        font-size: 0.8125rem;
        font-weight: 600;
    }

    /* === DEPARTMENT GRID === */
    .dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
    .dept-card {
        background: var(--surface);
        border-radius: var(--r-lg);
        border: 1px solid var(--border);
        overflow: hidden;
        transition: var(--t);
    }
    .dept-card:hover { box-shadow: var(--shadow-md); }
    .dept-card-header {
        background: var(--ink-900);
        color: white;
        padding: 22px;
        position: relative;
        overflow: hidden;
    }
    .dept-card-header::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse at 80% 0%, rgba(245,158,11,0.17) 0%, transparent 60%);
    }
    .dept-card-header h3 {
        font-family: 'Sora', sans-serif;
        font-size: 1.0625rem;
        font-weight: 600;
        position: relative;
        z-index: 1;
    }
    .dept-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); }
    .dept-stat-item { background: var(--surface); padding: 18px; text-align: center; }
    .dept-stat-value { font-family: 'Sora', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--text); }
    .dept-stat-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }
    .dept-card-footer { padding: 14px 18px; background: var(--surface); border-top: 1px solid var(--border); }
    .dept-card-footer .btn { width: 100%; }

    /* === PROFILE === */
    .profile-card { max-width: 560px; margin: 0 auto; }
    #pageProfile .page-header { justify-content: center; }
    .profile-info {
        display: flex;
        align-items: center;
        gap: 18px;
        padding: 22px;
        background: var(--surface-alt);
        border-radius: var(--r-md);
        margin-bottom: 28px;
        border: 1px solid var(--border-soft);
    }
    .profile-avatar {
        width: 64px;
        height: 64px;
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
        font-weight: 700;
        flex-shrink: 0;
    }
    .profile-details h3 { font-family: 'Sora', sans-serif; font-size: 1.125rem; font-weight: 600; margin-bottom: 4px; }
    .profile-details p { color: var(--text-secondary); font-size: 0.875rem; }

    /* === ALERTS === */
    .alert {
        padding: 14px 18px;
        border-radius: var(--r-md);
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 0.875rem;
        font-weight: 500;
    }
    .alert-warning { background: var(--warning-soft); border: 1px solid rgba(245,158,11,0.25); color: var(--warning-text); }
    .alert-success { background: var(--success-soft); border: 1px solid rgba(16,185,129,0.25); color: var(--success-dark); }

    /* === BIND CARD === */
    .bind-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
        padding: 22px;
    }
    .bind-card h4 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 4px; color: var(--text); }
    .bind-card .meta { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }
    .bind-status { display: flex; align-items: center; gap: 16px; }
    .bind-status .icon {
        width: 48px;
        height: 48px;
        border-radius: var(--r-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        flex-shrink: 0;
    }
    .bind-status .icon-bound { background: var(--wechat-soft); color: var(--wechat); }
    .bind-status .icon-unbound { background: var(--warning-soft); color: #d97706; }
    .bind-status .info { flex: 1; }
    .bind-status .info .label { font-weight: 600; font-size: 0.9375rem; color: var(--text); }
    .bind-status .info .desc { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; }
    .bind-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 24px;
        border: none;
        border-radius: var(--r-md);
        font-weight: 600;
        font-size: 0.875rem;
        cursor: pointer;
        transition: var(--t-fast);
        font-family: inherit;
    }
    .bind-btn-primary { background: var(--wechat); color: #fff; }
    .bind-btn-primary:hover { background: #06ad56; transform: translateY(-1px); }
    .bind-tag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: var(--r-full);
        font-size: 0.75rem;
        font-weight: 600;
    }
    .bind-tag-success { background: var(--wechat-soft); color: #047857; }
    .bind-tag-pending { background: var(--warning-soft); color: var(--warning-text); }

    /* === EMPTY STATE === */
    .empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
    .empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
    .empty-state p { font-size: 0.9375rem; }

    /* === ACTION GROUP === */
    .action-group { display: flex; flex-wrap: wrap; gap: 8px; }

    /* === TABS === */
    .tab-group {
        display: flex;
        gap: 4px;
        background: var(--surface-hover);
        padding: 4px;
        border-radius: var(--r-md);
        width: fit-content;
    }
    .tab-btn {
        padding: 9px 18px;
        border: none;
        background: none;
        border-radius: var(--r-sm);
        font-weight: 600;
        font-size: 0.875rem;
        cursor: pointer;
        color: var(--text-secondary);
        transition: var(--t-fast);
        font-family: inherit;
    }
    .tab-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

    /* === LOADING === */
    .loading { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--text-muted); font-size: 0.875rem; }
    .loading::after {
        content: '';
        width: 20px;
        height: 20px;
        border: 2px solid var(--border);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin-left: 12px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* === SELECT === */
    select {
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 38px;
        cursor: pointer;
    }

    /* === CHECKBOX === */
    .checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
    .checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

    /* === SCROLLBAR === */
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

    /* === FOOTER === */
    .system-footer {
        text-align: center;
        padding: 24px;
        background: var(--surface);
        border-top: 1px solid var(--border);
        margin-top: 40px;
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }
    .system-footer a {
        color: var(--accent);
        text-decoration: none;
        transition: var(--t-fast);
        font-weight: 500;
    }
    .system-footer a:hover { color: var(--accent-dark); text-decoration: underline; }

    /* === MODAL === */
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0; top: 0;
        width: 100%; height: 100%;
        overflow: auto;
        background-color: rgba(10,14,26,0.6);
        backdrop-filter: blur(4px);
    }
    .modal-content {
        background-color: var(--surface);
        margin: 5% auto;
        padding: 0;
        border-radius: var(--r-lg);
        box-shadow: var(--shadow-xl);
        max-width: 600px;
        animation: modalSlideIn 0.3s cubic-bezier(0.16,1,0.3,1);
    }
    @keyframes modalSlideIn {
        from { transform: translateY(-30px) scale(0.97); opacity: 0; }
        to { transform: translateY(0) scale(1); opacity: 1; }
    }
    .modal-header {
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .modal-header h3 { margin: 0; font-family: 'Sora', sans-serif; font-size: 1.125rem; font-weight: 600; }
    .modal-close {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-muted);
        cursor: pointer;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: var(--t-fast);
    }
    .modal-close:hover { background: var(--surface-hover); color: var(--text); }
    .modal-body { padding: 24px; }

    /* === QR MODAL === */
    .modal-overlay { display: none; }

    /* === SIDEBAR OVERLAY (mobile) === */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10,14,26,0.5);
        backdrop-filter: blur(2px);
        z-index: 199;
        opacity: 0;
        transition: opacity var(--t);
    }
    .sidebar-overlay.show { display: block; opacity: 1; }

    /* === RESPONSIVE === */
    @media (max-width: 1024px) {
        .content { padding: 24px; }
        .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    }

    @media (max-width: 768px) {
        .main-interface { margin-left: 0; }
        .navbar {
            position: fixed;
            top: 0; left: 0; bottom: 0;
            width: var(--sidebar-w);
            transform: translateX(-100%);
            transition: transform var(--t);
            z-index: 200;
        }
        .navbar.open { transform: translateX(0); }
        .navbar-inner { flex-direction: column; }
        .nav-brand { padding: 18px 20px; }
        .nav-menu { padding: 12px; }
        .nav-user { padding: 12px; }
        .menu-toggle { display: flex; align-items: center; justify-content: center; }
        .mobile-user-bar { display: flex; }
        .nav-user { display: none; }
        .content { padding: 20px; }
        .page-header { flex-direction: column; align-items: flex-start; }
        .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
        .stat-card { padding: 18px; }
        .stat-value { font-size: 1.5rem; }
        .stat-icon { width: 38px; height: 38px; font-size: 1.15rem; margin-bottom: 12px; }
        .filter-bar { flex-direction: column; }
        .filter-bar input, .filter-bar select { width: 100%; }
        .form-row { grid-template-columns: 1fr; }
        .dept-grid { grid-template-columns: 1fr; }
        .card-header { padding: 16px; }
        .card-body { padding: 16px; }
        .form-card { padding: 20px; }
        th, td { padding: 10px 12px; font-size: 0.8125rem; }
        .order-actions { flex-direction: column; }
        .order-actions .btn { width: 100%; }
        .tab-group { width: 100%; }
        .tab-btn { flex: 1; }

        /* === Mobile: table → card layout for orders-table & users-table === */
        .table-wrapper { overflow-x: visible; margin: 0; }
        .orders-table thead, .users-table thead { display: none; }
        .orders-table tbody, .users-table tbody { display: flex; flex-direction: column; gap: 12px; }
        .orders-table tr, .users-table tr {
            display: flex;
            flex-direction: column;
            border: 1px solid var(--border);
            border-radius: var(--r-md);
            padding: 14px 16px;
            background: var(--surface-alt);
        }
        .orders-table td, .users-table td {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            padding: 8px 0;
            border-bottom: 1px solid var(--border-soft);
            font-size: 0.875rem;
        }
        .orders-table tr td:last-child, .users-table tr td:last-child {
            border-bottom: none;
            padding-top: 12px;
        }
        .orders-table td::before, .users-table td::before {
            content: attr(data-label);
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            flex-shrink: 0;
        }
        .orders-table td[colspan] { display: block; text-align: center; color: var(--text-muted); }
        .orders-table td[colspan]::before { display: none; }

        /* Full-width action button in mobile card */
        .orders-table td .btn, .users-table td .btn {
            width: 100%;
            padding: 11px 16px;
            font-size: 0.875rem;
        }

        /* My orders table (5 cols) — simpler card */
        .orders-table td[data-label="报酬"] {
            font-size: 1rem;
            font-weight: 700;
        }
        .orders-table td[data-label="标题"] {
            font-weight: 600;
            font-size: 0.9375rem;
            color: var(--text);
        }
    }

    @media (max-width: 480px) {
        .stats-grid { grid-template-columns: 1fr; }
        .login-card { border-radius: var(--r-lg); }
        .login-header { padding: 36px 24px; }
        .login-body { padding: 28px 24px 24px; }
        .content { padding: 16px; }
    }
/* 仪表盘统计分组标题 */
.stats-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0 14px;
    letter-spacing: -0.01em;
}

/* 订单趋势折线图 */
.trend-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 999px;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s;
}
.trend-btn:hover { background: var(--surface-hover); }
.trend-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.trend-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

/* 折线图悬停提示 */
.trend-svg-wrap { position: relative; }
.trend-tip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    background: rgba(24, 24, 30, 0.92);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.7;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}
.trend-tip-date { font-weight: 700; margin-bottom: 4px; opacity: 0.85; }
/* 折线图筛选抽屉 */
.trend-filter { position: relative; }
.trend-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #0a1628 0%, #003b82 100%);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(10,22,40,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.trend-filter-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(10,22,40,0.3); }
.trend-filter-btn:active { transform: scale(0.97); }
.trend-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.trend-filter-chev { display: inline-flex; transition: transform 0.25s; opacity: 0.85; }
.trend-filter-btn.open .trend-filter-chev { transform: rotate(180deg); }
.trend-filter-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 250px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 18px;
    box-shadow: 0 14px 44px rgba(10,22,40,0.14);
    padding: 16px;
    z-index: 30;
    display: none;
}
.trend-filter-panel.open { display: block; animation: drawerIn 0.22s cubic-bezier(0.32,0.72,0,1); }
.trend-filter-group { margin-bottom: 14px; }
.trend-filter-group:last-child { margin-bottom: 0; }
.trend-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}
.seg-row { display: flex; gap: 8px; }
.trend-opt {
    flex: 1;
    padding: 9px 0;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all 0.2s;
}
.trend-opt:hover { background: var(--surface-hover); }
.trend-opt.active {
    background: linear-gradient(135deg, #0a1628 0%, #003b82 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(10,22,40,0.2);
}

/* === 押金设置弹窗 === */
.deposit-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.deposit-modal {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: depositPop 0.18s ease;
}
@keyframes depositPop {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.deposit-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 0;
}
.deposit-modal-head h3 { margin: 0; font-size: 1.05rem; color: var(--text); }
.deposit-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
}
.deposit-close:hover { color: var(--text); }
.deposit-modal-body { padding: 16px 20px 8px; }
.deposit-target { margin: 0 0 16px; color: var(--text-secondary); font-size: 0.9rem; }
.deposit-target strong { color: var(--text); }
.deposit-options { display: flex; gap: 10px; flex-wrap: wrap; }
.deposit-opt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface-alt);
    user-select: none;
}
.deposit-opt input { accent-color: var(--accent); margin: 0; }
.deposit-opt-active {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-soft);
}
.deposit-note { margin: 12px 0 0; font-size: 0.75rem; color: var(--warning-text); }
.deposit-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 8px 20px 20px;
}
