/* ============================================
   接单管理系统 - 完整后台样式
   支持 CSS 变量 + 暗黑模式 + 原生动效
   ============================================ */

/* ========== CSS 变量 ========== */
:root {
    /* 主色调 */
    --primary: #4a6cf7;
    --primary-hover: #3a5ce5;
    --primary-light: #e8edff;
    --primary-gradient: linear-gradient(135deg, #4a6cf7 0%, #6366f1 100%);

    /* 成功 */
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #d1fae5;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);

    /* 危险 */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f87171 100%);

    /* 警告 */
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: #fef3c7;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);

    /* 信息 */
    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);

    /* 紫色 */
    --purple: #8b5cf6;
    --purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);

    /* 背景色 */
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #1e1e2d;
    --bg-topbar: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f5f7fa;
    --bg-zebra: #fafbfc;

    /* 文字颜色 */
    --text-primary: #1e1e2d;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-sidebar: #a2a5b9;
    --text-sidebar-active: #ffffff;
    --text-link: #4a6cf7;

    /* 边框 */
    --border-color: #e5e7eb;
    --border-light: #f0f0f0;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* 侧边栏宽度 */
    --sidebar-width: 240px;

    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ========== 暗黑模式变量 ========== */
body.dark-mode {
    --bg-body: #0f1117;
    --bg-card: #1a1d2e;
    --bg-sidebar: #0d0f1a;
    --bg-topbar: #1a1d2e;
    --bg-input: #252840;
    --bg-hover: #252840;
    --bg-zebra: #1e2035;

    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-link: #6b8aff;

    --border-color: #2d3148;
    --border-light: #252840;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);

    --primary-light: #1e2444;
    --success-light: #1a2e1f;
    --danger-light: #2e1a1d;
    --warning-light: #2e2a1a;
    --info-light: #1a2a2e;
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    display: flex;
    min-height: 100vh;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ========== 登录页 ========== */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1e2d 0%, #2d2d44 50%, #1e1e2d 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px 30px;
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 26px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(74, 108, 247, 0.1) 0%, transparent 100%);
}

.sidebar-header h2 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-sidebar-active);
    text-decoration: none;
}

.nav-item:hover::before {
    opacity: 0.05;
}

.nav-item.active {
    background: rgba(74, 108, 247, 0.2);
    color: var(--text-sidebar-active);
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-item.active::before {
    opacity: 0.1;
}

.nav-icon {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-group {
    margin-bottom: 4px;
}

.nav-parent {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-sidebar);
    font-size: 13px;
    font-weight: 600;
    cursor: default;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.nav-parent .nav-icon {
    margin-right: 12px;
}

.nav-sub-item {
    display: block;
    padding: 10px 20px 10px 56px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-sub-item::before {
    content: '';
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-sidebar);
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.nav-sub-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-sidebar-active);
    text-decoration: none;
}

.nav-sub-item:hover::before {
    background: var(--primary);
    opacity: 1;
}

.nav-sub-item.active {
    background: rgba(74, 108, 247, 0.2);
    color: var(--text-sidebar-active);
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-sub-item.active::before {
    background: var(--primary);
    opacity: 1;
}

/* 侧边栏折叠 */
.sidebar.collapsed {
    transform: translateX(-100%);
}

/* ========== 主内容区 ========== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}

/* ========== 顶部导航栏 ========== */
.topbar {
    height: 64px;
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-name {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.dark-mode-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.dark-mode-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.05);
}

/* ========== 内容区域 ========== */
.content-area {
    padding: 24px;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    margin-bottom: 24px;
}

.page-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* ========== 统计卡片 ========== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1)::before { background: var(--primary-gradient); }
.stat-card:nth-child(2)::before { background: var(--purple-gradient); }
.stat-card:nth-child(3)::before { background: var(--success-gradient); }
.stat-card:nth-child(4)::before { background: var(--warning-gradient); }
.stat-card:nth-child(5)::before { background: var(--danger-gradient); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, var(--bg-hover) 0%, transparent 100%);
}

.card-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-hover);
}

/* ========== 表格 ========== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
}

.table thead {
    background: var(--bg-hover);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-size: 12px;
}

.table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
    max-width: 150px;
}

/* 文字截断 */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.text-ellipsis:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
}

/* 操作列不截断 */
.action-btns {
    white-space: nowrap;
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}

.action-btns .btn-sm {
    padding: 4px 6px;
    font-size: 12px;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:nth-child(even) {
    background: var(--bg-zebra);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.overdue-row {
    background: var(--danger-light) !important;
}

.overdue-row:hover {
    background: var(--danger-light) !important;
}

.blacklist-row {
    background: var(--danger-light) !important;
    opacity: 0.8;
}

.wrap-cell {
    white-space: normal !important;
    min-width: 120px;
    max-width: 200px;
    word-break: break-word;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--bg-hover);
    cursor: not-allowed;
    opacity: 0.8;
}

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

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 180px;
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.4);
    color: #ffffff;
}

.btn-success {
    background: var(--success-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    color: #ffffff;
}

.btn-danger {
    background: var(--danger-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    color: #ffffff;
}

.btn-warning {
    background: var(--warning-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    color: #ffffff;
}

.btn-default {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ========== 状态标签 ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    white-space: nowrap;
}

.status-blue {
    background: var(--info-light);
    color: var(--info);
}

.status-green {
    background: var(--success-light);
    color: var(--success);
}

.status-orange {
    background: var(--warning-light);
    color: #b45309;
}

.status-red {
    background: var(--danger-light);
    color: var(--danger);
}

.status-gray {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ========== 优先级标签 ========== */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.priority-normal {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.priority-urgent {
    background: var(--warning-light);
    color: #b45309;
}

.priority-critical {
    background: var(--danger-light);
    color: var(--danger);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== 进度条 ========== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.progress-fill.green {
    background: var(--success-gradient);
}

.progress-fill.orange {
    background: var(--warning-gradient);
}

.progress-fill.blue {
    background: var(--primary-gradient);
}

.progress-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========== 评分星星 ========== */
.star {
    font-size: 14px;
    margin-right: 1px;
}

.star.filled {
    color: #fbbf24;
}

.star.empty {
    color: var(--border-color);
}

.no-rating {
    color: var(--text-muted);
    font-size: 12px;
}

/* ========== 排名徽章 ========== */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffec8b 100%);
    color: #8b6914;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #666;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #daa06d 100%);
    color: #5c3d1e;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

/* ========== 提示消息 ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert::before {
    font-size: 18px;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-success::before {
    content: "✓";
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-danger::before {
    content: "✕";
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-warning::before {
    content: "!";
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border-left: 4px solid var(--info);
}

.alert-info::before {
    content: "i";
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.page-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.3);
}

.page-dots {
    color: var(--text-muted);
    padding: 0 8px;
}

/* ========== 筛选栏 ========== */
.filter-form {
    margin-bottom: 0;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-row .form-control {
    width: auto;
    min-width: 140px;
}

/* ========== 操作按钮组 ========== */
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* ========== 空状态 ========== */
.empty-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== 日志类型标签 ========== */
.log-type-login {
    background: var(--info-light);
    color: var(--info);
}

.log-type-operation {
    background: var(--success-light);
    color: var(--success);
}

.log-type-delete {
    background: var(--danger-light);
    color: var(--danger);
}

/* ========== 状态概览 ========== */
.status-overview {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.status-item:hover {
    background: var(--border-light);
}

.status-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== 行布局 ========== */
.row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.col-6 {
    flex: 0 0 calc(50% - 10px);
    min-width: 300px;
}

/* ========== 文本颜色 ========== */
.text-danger {
    color: var(--danger) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .col-6 {
        flex: 0 0 100%;
    }
    
    .stat-cards {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .stat-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row .form-control {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .page-header h3 {
        font-size: 20px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 10px 12px;
    }
}

/* ========== 表单区域 ========== */
.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 16px;
}

.readonly-field {
    background: var(--bg-hover) !important;
    cursor: not-allowed;
}

/* ========== 金额卡片 ========== */
.amount-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.amount-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

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

.amount-card.success {
    border-color: var(--success);
    background: var(--success-light);
}

.amount-card.danger {
    border-color: var(--danger);
    background: var(--danger-light);
}

.amount-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.amount-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========== 开关组件 ========== */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition-fast);
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
    background: var(--primary-gradient);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== 固定悬浮保存按钮 ========== */
.fixed-save-bar {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fixed-save-bar .btn {
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.5);
    padding: 12px 24px;
    font-size: 15px;
    animation: pulseSave 2s infinite;
}

@keyframes pulseSave {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
