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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
}

.hidden {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 50%, #d5dce8 100%);
    background-attachment: fixed;
    color: var(--gray-900);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 登录页面 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 密码输入框容器 */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 45px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: var(--gray-600);
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

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

.login-icon {
    font-size: 56px;
    margin-bottom: 16px;
    color: var(--primary);
}

.login-icon svg {
    width: 56px;
    height: 56px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--gray-900);
    margin-bottom: 8px;
}

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

.login-form .form-group {
    margin-bottom: 16px;
}

.login-error {
    text-align: center;
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
}

.login-hint {
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    margin-top: 12px;
}

.login-options {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ========== 主应用布局 ========== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 左侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    color: var(--gray-900);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    font-size: 28px;
    color: var(--primary);
}

.logo svg {
    width: 28px;
    height: 28px;
}

.app-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(0, 122, 255, 0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.nav-icon {
    font-size: 18px;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

/* 快速切换账号 */
.quick-switch-section {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.switch-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.switch-icon {
    font-size: 14px;
}

.switch-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.switch-item:hover {
    background: rgba(79, 70, 229, 0.3);
    border-color: var(--primary);
    color: white;
}

.switch-item.active {
    background: rgba(79, 70, 229, 0.5);
    border-color: var(--primary);
    color: white;
}

.switch-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.switch-name {
    flex: 1;
    font-weight: 500;
}

.switch-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: auto;
}

.switch-back-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.switch-back-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.current-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.user-avatar-small svg {
    width: 18px;
    height: 18px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name-display {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.user-role-display {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logout-btn:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.3);
    color: var(--danger);
    transform: translateY(-1px);
}

/* 右侧主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.page-header h1 {
    font-size: 26px;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.page-header p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ========== 内容卡片 ========== */
.content-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.content-card h2 {
    font-size: 16px;
    color: var(--gray-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.price-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 10px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.preview-salary {
    padding: 18px;
    background: linear-gradient(135deg, var(--success) 0%, #28a745 100%);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

#preview-amount {
    font-size: 36px;
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-danger {
    width: 100%;
    padding: 12px 24px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

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

/* ========== 记录列表 ========== */
.records-list {
    max-height: 400px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
}

.record-item:last-child {
    margin-bottom: 0;
}

.record-info {
    flex: 1;
}

.record-person {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 3px;
    font-size: 14px;
}

.record-details {
    font-size: 12px;
    color: var(--gray-500);
}

.record-salary {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

.empty {
    text-align: center;
    padding: 32px;
    color: var(--gray-400);
    font-size: 14px;
}

/* ========== 统计页面 ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
}

.filter-tabs {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 6px 16px;
    border: 2px solid var(--gray-200);
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-item input,
.filter-item select {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    min-width: 140px;
}

/* 导出按钮 */
.export-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stat-card.highlight {
    background: linear-gradient(135deg, var(--success) 0%, #28a745 100%);
    border: none;
}

.stat-card.highlight .stat-label,
.stat-card.highlight .stat-value {
    color: white;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-value small {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-400);
}

/* 表格 */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

th {
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid var(--gray-100);
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody td {
    font-size: 14px;
    color: var(--gray-700);
}

tbody td:last-child {
    font-weight: 600;
    color: var(--success);
}

.table-edit-btn {
    padding: 6px 12px;
    background: var(--primary);
    border: none;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.table-edit-btn:hover {
    background: var(--primary-dark);
}

/* 人员对比 */
#person-comparison {
    display: grid;
    gap: 10px;
}

.comparison-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: 10px;
}

.comparison-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.comparison-info {
    flex: 1;
}

.comparison-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
    font-size: 14px;
}

.comparison-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.comparison-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.comparison-stats {
    text-align: right;
}

.comparison-tasks {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.comparison-salary {
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

/* ========== 账号列表 ========== */
.account-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

/* ========== 任务类型列表 ========== */
.tasktype-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.tasktype-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

.tasktype-item:hover {
    background: white;
    border-color: var(--primary);
}

.tasktype-info {
    flex: 1;
}

.tasktype-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.tasktype-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

/* ========== 任务类型输入区 ========== */
.task-type-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.task-type-inputs .form-group {
    margin-bottom: 0;
}

.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

.account-item:hover {
    background: white;
    border-color: var(--primary);
}

.account-info {
    flex: 1;
}

.account-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.account-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.account-meta span {
    margin-right: 12px;
}

.account-role {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 11px;
}

.account-role.admin {
    background: var(--warning);
}

.edit-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.switch-btn {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.switch-btn:hover {
    background: var(--primary-dark);
}

/* ========== 高级图表样式 ========== */
.chart-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    position: relative;
}

.chart-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-icon {
    font-size: 42px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.chart-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-title p {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.chart-controls-advanced {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.control-select {
    padding: 10px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.control-select:hover {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.25);
}

.control-select:focus {
    outline: none;
    border-color: white;
    background: rgba(255,255,255,0.25);
}

.control-select option {
    background: #4338ca;
    color: white;
}

.toggle-buttons {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 4px;
}

.toggle-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.toggle-btn:hover {
    color: white;
}

.toggle-btn.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.chart-body {
    background: white;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.chart-container-advanced {
    position: relative;
    height: 380px;
    width: 100%;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-50);
    border-radius: 20px;
    transition: all 0.2s;
}

.legend-item:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.legend-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
}

/* ========== 弹窗 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(59, 130, 246, 0.2);
    border: 2px solid rgba(59, 130, 246, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 18px;
    color: var(--gray-900);
}

.close-btn {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    font-size: 20px;
    color: var(--gray-500);
    cursor: pointer;
}

.close-btn:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: 24px;
}

/* ========== 响应式 ========== */

/* ========== 操作日志样式 ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-admin {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge-user {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.log-action {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.log-action-add {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.log-action-edit {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.log-action-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.log-action-export {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.log-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.log-detail-item {
    font-size: 13px;
    color: var(--gray-600);
}

.log-detail-item::before {
    margin-right: 4px;
}

#logs-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

#logs-table th:nth-child(1),
#logs-table td:nth-child(1) {
    white-space: nowrap;
    min-width: 120px;
}

#logs-table th:nth-child(4),
#logs-table td:nth-child(4) {
    min-width: 100px;
}

#logs-table th:nth-child(5),
#logs-table td:nth-child(5) {
    min-width: 300px;
}

/* ========== 任务确认弹窗 ========== */
.confirm-summary {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.confirm-item:last-child {
    border-bottom: none;
}

.confirm-item.highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
    margin: 12px -20px -20px -20px;
    padding: 16px 20px;
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.confirm-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.confirm-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.confirm-item.highlight .confirm-value {
    font-size: 20px;
    color: var(--success);
}

.confirm-tasks {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.confirm-tasks .confirm-label {
    margin-bottom: 12px;
}

#confirm-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.confirm-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.confirm-task-name {
    font-size: 14px;
    color: var(--gray-700);
}

.confirm-task-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.confirm-hint {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-cancel {
    width: 100%;
    padding: 14px 24px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 10px 16px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .app-wrapper {
        flex-direction: column;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

