/* 打手端 - 移动端深色主题 v2 */
:root {
    --bg: #07080d;
    --bg-elevated: #0e1018;
    --surface: #141722;
    --surface-2: #1a1f2e;
    --surface-hover: #222838;
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --text: #f0f2f8;
    --text-secondary: #a8afc4;
    --text-muted: #6b7288;
    --primary: #2468e8;
    --primary-light: #33a1ff;
    --primary-glow: rgba(36, 104, 232, 0.35);
    --primary-bg: rgba(36, 104, 232, 0.12);
    --brand-dark: #001a72;
    --danger: #ff5c6a;
    --danger-bg: rgba(255, 92, 106, 0.12);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.12);
    --radius: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body.has-nav {
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -120px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(36, 104, 232, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: 120px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.app-shell {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
}

a { color: var(--primary-light); text-decoration: none; }

/* ========== 顶部栏 ========== */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: calc(12px + var(--safe-top)) 20px 12px;
    background: rgba(7, 8, 13, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.top-bar-info h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.top-bar-info .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.chip-icon {
    width: 14px;
    height: 14px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logout-btn:active {
    background: var(--surface-hover);
    transform: scale(0.96);
}

/* ========== 余额 Hero ========== */
.balance-hero {
    margin: 16px 20px;
    padding: 24px 20px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, #0a1640 0%, #141722 50%, #0d1a3a 100%);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.balance-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(77, 141, 255, 0.2) 0%, transparent 70%);
}

.balance-hero-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.balance-hero-main {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--danger);
    line-height: 1.1;
    margin-bottom: 20px;
}

.balance-hero-main .currency {
    font-size: 22px;
    font-weight: 600;
    margin-right: 2px;
    opacity: 0.85;
}

.balance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.balance-stat {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    border: 1px solid var(--border);
}

.balance-stat label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.balance-stat .val {
    font-size: 17px;
    font-weight: 700;
}

.balance-stat .val.money { color: var(--danger); }
.balance-stat .val.income { color: var(--success); }

.balance-stats-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.balance-stats-3 .balance-stat {
    padding: 10px 8px;
    text-align: center;
}

.balance-stats-3 .balance-stat .val {
    font-size: 14px;
}

@media (max-width: 360px) {
    .balance-hero-main { font-size: 30px; }
    .balance-stats-3 { grid-template-columns: 1fr; }
    .balance-stats-3 .balance-stat { text-align: left; }
}

/* ========== 内容区 ========== */
.page-content {
    padding: 0 20px 20px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    padding-left: 2px;
}

/* ========== 订单卡片 ========== */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-card:active {
    transform: scale(0.985);
}

.order-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
}

.order-card.status-pending::before { background: var(--warning); }
.order-card.status-approved::before { background: var(--success); }
.order-card.status-rejected::before { background: var(--danger); }
.order-card.status-settled::before { background: var(--primary); }

.order-card-no {
    font-size: 11px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    color: var(--primary-light);
    background: var(--primary-bg);
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.order-no-group {
    background: var(--bg-elevated);
    margin: 0 -16px;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border) !important;
}

.order-no-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-no-value {
    font-size: 15px;
    font-weight: 700;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    color: var(--primary-light);
    letter-spacing: 0.04em;
    flex: 1;
    word-break: break-all;
}

.order-no-refresh {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.order-no-refresh:active {
    transform: rotate(180deg);
    background: var(--primary-bg);
    color: var(--primary-light);
}

.wechat-order-input {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 15px !important;
    letter-spacing: 0.02em;
}

.order-no-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.file-input {
    padding: 8px 0 !important;
    font-size: 16px !important; /* iOS 避免缩放导致点不准 */
    min-height: 44px !important;
    width: 100% !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    color: var(--text) !important;
}

.screenshot-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.screenshot-preview-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}

.screenshot-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.form-group.nested {
    padding: 0;
    border: none;
    margin-bottom: 0;
}

.search-select-group {
    position: relative;
    z-index: 5;
}

.search-select-hint {
    margin: -2px 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.search-select-hint strong {
    color: var(--primary-light);
    font-weight: 700;
}

/* 搜索 + 列表合成一块，避免像「空白输入框」 */
.search-select-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.search-select-list-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-light);
    background: rgba(36, 104, 232, 0.1);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.search-select-list-label::after {
    content: '可滚动 · 点一项';
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted);
}

.extra-fee-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.extra-fee-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.extra-fee-option input {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.extra-fee-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.search-select-input {
    position: relative;
    z-index: 5;
    margin: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 14px 14px 14px 42px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    min-height: 52px !important;
    line-height: 1.3 !important;
    color: #f5f7ff !important;
    caret-color: var(--primary-light);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto !important;
    -webkit-user-select: text;
    user-select: text;
    touch-action: manipulation;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2333a1ff' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 14px center !important;
    background-size: 18px 18px !important;
}

.search-select-input::placeholder {
    color: #8b93a8 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

.search-select-input:focus {
    outline: none;
    background-color: rgba(36, 104, 232, 0.08) !important;
}

/* 原生多行列表：强制高对比，避免手机上白字看不见 */
.search-select-native {
    display: block;
    width: 100%;
    min-height: 168px;
    max-height: 220px;
    overflow-y: auto;
    margin: 0 !important;
    padding: 6px !important;
    border: none !important;
    border-radius: 0 !important;
    background: #0a0c14 !important;
    background-image: none !important;
    color: #f5f7ff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    color-scheme: dark;
    position: relative;
    z-index: 4;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-appearance: listbox !important;
    appearance: listbox !important;
}

.search-select-native option {
    padding: 12px 12px !important;
    margin: 2px 0 !important;
    border-radius: 8px;
    color: #f5f7ff !important;
    background-color: #141722 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.search-select-native option:checked,
.search-select-native option:focus,
.search-select-native option:hover {
    color: #ffffff !important;
    background-color: #2468e8 !important;
}

.search-select-native option:disabled {
    color: #6b7288 !important;
}

.search-select-group:has(.search-select-native:focus),
.search-select-group:has(.search-select-input:focus) {
    z-index: 8;
}

.search-select-group:has(.search-select-native option:checked:not([value=""])) .search-select-box {
    border-color: rgba(52, 211, 153, 0.45);
}

.search-select-group:has(.search-select-native option:checked:not([value=""])) .search-select-list-label::after {
    content: '已选中';
    color: var(--success);
}

.co-staff-group {
    display: none !important;
    position: relative;
    z-index: 30;
}

.co-staff-group.is-open,
/* 手机 AJAX 换页后脚本可能未绑定：多人单选中时靠 CSS 直接显示加人框 */
body:has(#crewModeDuo:checked) .co-staff-group {
    display: block !important;
}

.co-staff-picker {
    position: relative;
    z-index: 31;
}

.co-staff-search-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: stretch;
    position: relative;
    z-index: 32;
}

/* 全局 .form-control 是透明无边框的；这里必须做成真正能看见、能点的输入框 */
.co-staff-search-row .form-control,
.co-staff-search-input {
    flex: 1 1 auto;
    width: auto !important;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 !important;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px 14px !important;
    font-size: 16px !important;
    min-height: 48px !important;
    line-height: 1.3;
    color: var(--text) !important;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto !important;
    -webkit-user-select: text;
    user-select: text;
    touch-action: manipulation;
}

.co-staff-search-row .form-control:focus,
.co-staff-search-input:focus {
    border-color: var(--primary) !important;
    outline: none;
}

.co-staff-search-row .btn {
    flex: 0 0 auto;
    width: auto !important;
    white-space: nowrap;
    min-height: 48px;
    padding: 0 16px;
    pointer-events: auto !important;
    touch-action: manipulation;
}

.crew-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.crew-mode-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.crew-mode-option input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.crew-mode-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.crew-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.crew-mode-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.crew-mode-option input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.crew-mode-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.co-staff-results {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    max-height: 200px;
    overflow-y: auto;
}

.co-staff-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.co-staff-item:last-child {
    border-bottom: 0;
}

.co-staff-item:active {
    background: var(--primary-bg);
}

.co-staff-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 13px;
}

.ajax-nav-busy {
    opacity: 0.72;
    pointer-events: none;
}

.co-staff-selected {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    border: 1px solid rgba(36, 104, 232, 0.28);
    color: var(--primary-light);
    font-size: 13px;
    font-weight: 600;
}

.co-staff-clear {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.order-role-tag {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--warning-bg);
    color: var(--warning);
}

.order-role-tag.is-primary {
    background: var(--primary-bg);
    color: var(--primary-light);
}

.order-share-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.order-screenshot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.order-screenshot-link {
    font-size: 12px;
    color: var(--primary-light);
    padding: 6px 12px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
}

.order-screenshot-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.order-screenshot-thumb {
    display: block;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: 72px;
    height: 72px;
    background: var(--bg-elevated);
    cursor: pointer;
}

.order-screenshot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.img-lightbox[hidden] {
    display: none !important;
}

.img-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.img-lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.order-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
}

.order-card-amount {
    font-size: 22px;
    font-weight: 800;
    color: var(--danger);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.order-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.meta-item {
    font-size: 12px;
}

.meta-item .meta-label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 2px;
}

.meta-item .meta-value {
    color: var(--text-secondary);
}

.order-note {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.order-reject {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--danger-bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--danger);
    line-height: 1.4;
}

/* ========== 状态徽章 ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }
.status-settled { background: var(--primary-bg); color: var(--primary-light); }
.status-paid { background: var(--success-bg); color: var(--success); }

/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(14, 16, 24, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.bottom-nav .nav-icon {
    width: 22px;
    height: 22px;
}

.required-mark {
    color: var(--danger);
    font-weight: 600;
}

.datetime-input {
    color-scheme: dark;
    min-height: 48px;
    padding: 10px 0 !important;
    font-size: 16px !important; /* iOS 小于 16px 会强制放大页面 */
    width: 100%;
    max-width: 100%;
}

.page-content .login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.page-content .login-card .form-group {
    padding: 0;
    border: none;
    margin-bottom: 16px;
}

.page-content .login-card .form-group label {
    font-size: 13px;
    margin-bottom: 8px;
}

.page-content .login-card .form-control {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
}

.bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: var(--nav-height);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.bottom-nav .nav-link.active {
    color: var(--primary-light);
}

.bottom-nav .nav-link.active::after {
    content: '';
    position: absolute;
    top: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}

.nav-icon {
    width: 24px;
    height: 24px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav .nav-link.active .nav-icon {
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* ========== 表单 ========== */
.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px 16px;
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 12px 0 4px;
    letter-spacing: 0.04em;
}

.form-group {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.form-group:last-child {
    border-bottom: none;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7288' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 24px;
    cursor: pointer;
}

textarea.form-control {
    min-height: 72px;
    resize: none;
    line-height: 1.5;
    padding: 4px 0;
}

input[type="datetime-local"].form-control,
input[type="number"].form-control,
input[type="text"].form-control,
input[type="password"].form-control {
    padding: 4px 0;
}

input[type="datetime-local"].form-control {
    color-scheme: dark;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 16px;
}

@media (min-width: 520px) {
    .form-row-2 { grid-template-columns: 1fr 1fr; }
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #3b6fd9 100%);
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:active {
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-outline {
    background: var(--surface);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-block-fixed {
    position: sticky;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
    z-index: 10;
    margin-top: 8px;
}

/* ========== 金额预览 ========== */
.amount-preview {
    background: linear-gradient(135deg, rgba(77, 141, 255, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(77, 141, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.amount-preview .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.amount-preview .amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--danger);
    letter-spacing: -0.02em;
}

/* ========== 提示 ========== */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 92, 106, 0.25);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.empty-icon svg,
.empty-icon-svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

.empty-state .btn {
    width: auto;
    padding: 10px 24px;
    font-size: 14px;
    display: inline-flex;
}

/* ========== 提现列表 ========== */
.withdraw-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.withdraw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    transition: background 0.15s;
}

.withdraw-item:last-child { border-bottom: none; }
.withdraw-item:active { background: var(--surface-hover); }

.withdraw-item-left {
    flex: 1;
    min-width: 0;
}

.withdraw-item .amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--danger);
    letter-spacing: -0.02em;
}

.withdraw-item .time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.withdraw-item .reject-reason {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    line-height: 1.3;
}

/* ========== FAB ========== */
.fab-btn {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    right: max(20px, calc(50% - 220px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #3b6fd9);
    color: #fff;
    border: none;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    box-shadow: 0 6px 24px var(--primary-glow);
    cursor: pointer;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.fab-btn:active {
    transform: scale(0.92);
    box-shadow: 0 3px 12px var(--primary-glow);
}

/* ========== 弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-sheet {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 8px 24px calc(24px + var(--safe-bottom));
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    border-top: 1px solid var(--border-light);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.modal-sheet h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-balance-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-balance-hint strong {
    color: var(--danger);
    font-weight: 700;
}

.modal-sheet .form-group {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.modal-sheet .form-group label {
    margin-bottom: 6px;
}

.modal-sheet .form-control {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========== 登录页 ========== */
body.login-body {
    padding-bottom: 0;
}

body.login-body::before,
body.login-body::after {
    opacity: 0.6;
}

.login-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    padding-top: calc(32px + var(--safe-top));
    padding-bottom: calc(32px + var(--safe-bottom));
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.brand-logo {
    width: min(280px, 85vw);
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 8px 24px rgba(36, 104, 232, 0.25));
}

.login-tagline {
    color: var(--text-muted);
    margin-top: 12px;
    font-size: 14px;
    letter-spacing: 0.12em;
}

.login-role-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.5;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-light);
    font-weight: 600;
    margin-left: 4px;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px var(--primary-glow);
}

.login-brand-icon svg {
    width: 36px;
    height: 36px;
    stroke: #fff;
}

.login-brand h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand p {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 14px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.login-card .form-group {
    padding: 0;
    border: none;
    margin-bottom: 16px;
}

.login-card .form-group label {
    font-size: 13px;
    margin-bottom: 8px;
}

.login-card .form-control {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.login-remember input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.error-code {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}

/* ========== 快捷操作 ========== */
.quick-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary-bg);
    border: 1px solid rgba(77, 141, 255, 0.2);
    border-radius: 20px;
    color: var(--primary-light);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.quick-action:active {
    transform: scale(0.96);
    background: rgba(77, 141, 255, 0.2);
}

.quick-action svg {
    width: 16px;
    height: 16px;
}

/* ========== 响应式：手机 + 平板/电脑 ========== */
@media (max-width: 480px) {
    .co-staff-search-row {
        flex-wrap: wrap;
    }

    .co-staff-search-row .btn {
        width: 100% !important;
    }

    .screenshot-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-select-native {
        min-height: 120px;
        max-height: 160px;
        font-size: 16px !important;
    }

    .amount-preview .amount {
        font-size: 28px;
    }

    /* 手机上避免横向撑破 */
    input[type="datetime-local"].form-control {
        min-width: 0;
    }
}

@media (max-width: 320px) {
    .top-bar { padding-left: 16px; padding-right: 16px; }
    .page-content { padding-left: 16px; padding-right: 16px; }
    .balance-hero { margin-left: 16px; margin-right: 16px; }
}

/* 平板：加宽主栏，底部导航同步 */
@media (min-width: 600px) {
    .app-shell {
        max-width: 720px;
    }

    .bottom-nav {
        max-width: 720px;
    }

    body::before { right: calc(50% - 280px); }
    body::after { left: calc(50% - 360px); }

    .page-content {
        padding: 0 24px 24px;
    }

    .top-bar {
        padding-left: 24px;
        padding-right: 24px;
    }

    .balance-hero {
        margin-left: 24px;
        margin-right: 24px;
    }
}

/* 电脑：报单页双栏更舒服，整站再放宽 */
@media (min-width: 900px) {
    .app-shell {
        max-width: 960px;
    }

    .bottom-nav {
        max-width: 960px;
        border-radius: 16px 16px 0 0;
        left: 50%;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
    }

    .top-bar-info h1 {
        font-size: 26px;
    }

    .form-section {
        padding: 8px 22px 12px;
    }

    .page-report .report-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
        gap: 20px;
        align-items: start;
    }

    .page-report .report-main {
        min-width: 0;
    }

    .page-report .report-side {
        position: sticky;
        top: calc(72px + var(--safe-top));
    }

    .page-report .report-side .amount-preview {
        margin-bottom: 12px;
    }

    .page-report .report-side .btn-block-fixed {
        position: static;
        margin-top: 0;
    }

    .page-report .form-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 18px;
    }

    .page-report .form-grid-2 > .form-group {
        min-width: 0;
    }

    .page-report .search-select-native {
        min-height: 160px;
        max-height: 220px;
    }

    .btn:hover {
        filter: brightness(1.05);
    }

    .btn:active {
        transform: none;
    }

    .order-card:hover {
        border-color: var(--border-light);
        box-shadow: var(--shadow-sm);
    }

    .order-card:active {
        transform: none;
    }
}

@media (min-width: 1200px) {
    .app-shell {
        max-width: 1080px;
    }

    .bottom-nav {
        max-width: 1080px;
    }
}

/* 减少动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.balance-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.range-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.range-chip {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}

.range-chip.active {
    background: var(--primary, #2468e8);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.range-custom-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.range-custom-form input[type="date"] {
    flex: 1;
    min-width: 120px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.period-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.period-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.period-stat label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.period-stat .val {
    font-size: 18px;
    font-weight: 700;
}

.biz-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 12px;
    margin-bottom: 18px;
}

.biz-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    font-size: 13px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.biz-row:last-child { border-bottom: none; }
.biz-row .income { color: var(--success, #3fb950); font-weight: 600; }

.order-resubmit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.order-resubmit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.order-resubmit label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-resubmit input {
    background: var(--bg, #0f1117);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
}
