/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-red: #ff4444;
    --primary-black: #1a1a1a;
    --primary-white: #ffffff;
    
    /* 辅助色 */
    --color-green: #4ade80;
    --color-blue: #3b82f6;
    --color-yellow: #fbbf24;
    --color-orange: #fb923c;
    
    /* 灰度 */
    --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;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    background-color: #ffffff;
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* mainApp容器 */
#mainApp {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 260px;
    background: var(--primary-white);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.user-profile {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    background: #ffffff;
    border-radius: var(--radius-md);
    margin: var(--spacing-xl) 0 var(--spacing-lg) 0;
}

.avatar {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-full);
    margin: 0 auto var(--spacing-md);
    position: relative;
    padding: 4px;
    background: linear-gradient(135deg, #ff4444 0%, #ff6b6b 50%, #ff8787 100%);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.avatar::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: var(--radius-full);
    background: var(--primary-white);
    z-index: 0;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 68, 68, 0.4), 0 3px 6px rgba(0, 0, 0, 0.15);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
}

.user-profile h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.user-profile p {
    font-size: 13px;
    color: var(--gray-500);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 13px;
    color: var(--gray-600);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-green);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

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

/* 导航菜单 */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-red);
    border-radius: 0 2px 2px 0;
    transition: height 0.2s ease;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
    transform: translateX(4px);
}

.nav-item:hover::before {
    height: 60%;
}

.nav-item.active {
    background: var(--primary-red);
    color: var(--primary-white);
}

.nav-item.active::before {
    height: 100%;
    background: var(--primary-white);
}

.nav-item svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-item:hover svg {
    transform: scale(1.1);
}

/* ===== 主内容区 ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: var(--spacing-lg);
    width: calc(100% - 260px);
    max-width: 100%;
    overflow-x: hidden;
}

/* 顶部栏 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.welcome h1 {
    font-size: 28px;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.welcome .highlight {
    color: var(--primary-red);
}

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

.top-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box {
    position: absolute;
    right: 48px;
    width: 300px;
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 8px 40px 8px 16px;
    box-shadow: var(--shadow-md);
    animation: slideInFromRight 0.3s ease-out;
    z-index: 100;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--gray-700);
    background: transparent;
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.search-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.search-close:hover {
    background: var(--gray-100);
}

.search-close svg {
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.search-close:hover svg {
    color: var(--gray-700);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--gray-50);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.btn-icon svg {
    color: var(--gray-600);
    transition: color 0.2s ease;
}

.btn-icon:hover svg {
    color: var(--primary-red);
}

.btn-primary {
    padding: 10px 24px;
    background: var(--primary-red);
    color: var(--primary-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #e63939;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-red);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: #e63939;
}

/* ===== 统计卡片网格 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.stat-card {
    background: var(--primary-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red) 0%, var(--color-orange) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

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

.stat-card.red {
    background: linear-gradient(135deg, #ff4444 0%, #ff6666 100%);
    color: var(--primary-white);
}

.stat-card.black {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--primary-white);
}

.stat-card.chart-card {
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1;
}

.stat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.stat-change {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
}

.stat-change.positive {
    background: rgba(74, 222, 128, 0.2);
    color: var(--color-green);
}

.stat-period {
    opacity: 0.7;
}

.badge {
    padding: 4px 10px;
    background: var(--primary-red);
    color: var(--primary-white);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.black .badge {
    background: var(--primary-red);
}

/* ===== 内容网格 ===== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-lg);
    width: 100%;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* 卡片样式 */
.card {
    background: var(--primary-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
    width: 100%;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-200);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.card-header h2 {
    font-size: 18px;
    color: var(--gray-800);
    font-weight: 600;
}

/* ===== 项目列表 ===== */
.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.project-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.project-info {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.project-icon {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.project-icon.red { background: var(--primary-red); }
.project-icon.green { background: var(--color-green); }
.project-icon.blue { background: var(--color-blue); }
.project-icon.yellow { background: var(--color-yellow); }

.project-item h4 {
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.project-item p {
    font-size: 12px;
    color: var(--gray-500);
}

.project-status {
    padding: 6px 12px;
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
}

/* 任务状态样式 */
.project-status.completed {
    background: rgba(74, 222, 128, 0.1);
    color: var(--color-green);
    border-color: var(--color-green);
}

.project-status.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-blue);
    border-color: var(--color-blue);
}

.project-status.pending {
    background: rgba(251, 191, 36, 0.1);
    color: var(--color-yellow);
    border-color: var(--color-yellow);
}

/* ===== 日历 ===== */
.calendar-card {
    padding: var(--spacing-lg);
}

.calendar-nav {
    display: flex;
    gap: var(--spacing-sm);
}

.calendar-nav button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-200);
    background: var(--primary-white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav button:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.calendar {
    margin-top: var(--spacing-md);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-xs);
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.day:hover {
    background: var(--gray-100);
}

.day.other-month {
    color: var(--gray-300);
}

.day.today {
    background: var(--primary-red);
    color: var(--primary-white);
    font-weight: 700;
}

.day.event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--color-green);
    border-radius: var(--radius-full);
}

/* ===== 进度图表 ===== */
.progress-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.progress-chart canvas {
    max-width: 200px;
    max-height: 200px;
}

.progress-legend {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    color: var(--gray-600);
}

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.legend-item .dot.red {
    background: var(--primary-red);
}

.legend-item .dot.gray {
    background: var(--gray-300);
}

/* ===== 活动列表 ===== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.activity-item {
    display: flex;
    gap: var(--spacing-md);
    padding-left: var(--spacing-md);
    border-left: 2px solid var(--gray-200);
    position: relative;
}

.activity-dot {
    position: absolute;
    left: -6px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-white);
}

.activity-dot.green { background: var(--color-green); }
.activity-dot.blue { background: var(--color-blue); }
.activity-dot.yellow { background: var(--color-yellow); }
.activity-dot.red { background: var(--primary-red); }

.activity-content h4 {
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.activity-content p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ===== 任务列表 ===== */
.task-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.task-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.task-item:hover {
    background: var(--gray-100);
}

.task-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.task-item input[type="checkbox"]:checked {
    accent-color: var(--primary-red);
}

.task-item label {
    flex: 1;
    font-size: 14px;
    color: var(--gray-700);
    cursor: pointer;
}

.task-item input[type="checkbox"]:checked + label {
    text-decoration: line-through;
    color: var(--gray-400);
}

/* ===== 车辆状态 ===== */
.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.vehicle-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.vehicle-item:hover {
    background: var(--gray-100);
    transform: translateX(2px);
}

.vehicle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-white);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.vehicle-info {
    flex: 1;
}

.vehicle-info h4 {
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 4px;
    font-weight: 600;
}

.vehicle-info p {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: var(--spacing-sm);
}

.vehicle-progress {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ff6666 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar.gray {
    background: var(--gray-300);
}

/* ===== 团队成员 ===== */
.team-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.team-member {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
}

.team-member:hover {
    background: var(--gray-100);
}

.team-member img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.team-member h4 {
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.team-member p {
    font-size: 12px;
    color: var(--gray-500);
}

.team-member .status-dot {
    margin-left: auto;
    width: 10px;
    height: 10px;
    border: 2px solid var(--primary-white);
}

.team-member .status-dot.online {
    background: var(--color-green);
}

.team-member .status-dot.offline {
    background: var(--gray-400);
    animation: none;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1400px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: var(--spacing-md);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .top-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .search-box {
        right: 0;
        width: 100%;
        max-width: 280px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 28px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== 额外动画效果 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 应用动画 */
.card {
    animation: fadeIn 0.5s ease-out;
}

.stat-card {
    animation: scaleIn 0.4s ease-out;
}

.project-item,
.activity-item,
.task-item,
.team-member,
.vehicle-item {
    animation: fadeIn 0.3s ease-out;
}

/* 加载动画 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* 脉冲动画 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
    }
}

.stat-card.red {
    animation: scaleIn 0.4s ease-out, pulse-glow 3s infinite;
}

/* 进度条动画 */
@keyframes progressLoad {
    from {
        width: 0;
    }
}

.progress-bar {
    animation: progressLoad 1.5s ease-out;
}

/* 卡片入场动画 */
.left-column .card:nth-child(1) {
    animation-delay: 0.1s;
}

.left-column .card:nth-child(2) {
    animation-delay: 0.2s;
}

.left-column .card:nth-child(3) {
    animation-delay: 0.3s;
}

.right-column .card:nth-child(1) {
    animation-delay: 0.15s;
}

.right-column .card:nth-child(2) {
    animation-delay: 0.25s;
}

.right-column .card:nth-child(3) {
    animation-delay: 0.35s;
}

.right-column .card:nth-child(4) {
    animation-delay: 0.45s;
}

/* 统计卡片动画延迟 */
.stat-card:nth-child(1) {
    animation-delay: 0s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* ============================================
   登录页面样式
============================================ */

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-box {
    background: var(--primary-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    animation: slideInDown 0.5s ease-out;
}

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

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

.login-logo {
    display: inline-block;
    margin-bottom: 16px;
}

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

.login-header p {
    font-size: 14px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

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

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-red);
    color: var(--primary-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #e63939;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 68, 68, 0.3);
}

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

.login-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: 24px;
}

.demo-accounts h4 {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
    text-align: center;
}

.demo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge.admin {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.role-badge.finance {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.role-badge.business {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.role-badge.driver {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

/* ===== 用户下拉菜单 ===== */
.user-dropdown {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.user-menu-btn img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-red);
    padding: 2px;
    background: var(--primary-white);
    box-shadow: 0 2px 6px rgba(255, 68, 68, 0.2);
}

.user-menu-btn span {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--primary-white);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    z-index: 1000;
    animation: dropdownIn 0.2s ease-out;
}

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

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.user-menu-header img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-red);
    padding: 2px;
    background: var(--primary-white);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.25);
}

.user-menu-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

.user-menu-role {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-menu-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0 8px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.user-menu-item:hover {
    background: var(--gray-50);
}

.user-menu-item.logout {
    color: #ef4444;
}

.user-menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   新页面样式
============================================ */

/* ===== 页面头部 ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--gray-100);
    width: 100%;
}

.page-header h2 {
    font-size: 24px;
    color: var(--gray-800);
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.view-toggle .btn-icon {
    border: none;
    background: transparent;
    transition: all 0.2s ease;
}

.view-toggle .btn-icon.active {
    background: var(--primary-white);
    color: var(--primary-red);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-toggle .btn-icon:hover {
    background: var(--primary-white);
}

.search-input,
.filter-select,
.date-input {
    padding: 10px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus,
.filter-select:focus,
.date-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-small {
    padding: 6px 12px;
    background: var(--primary-white);
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: var(--primary-red);
    color: var(--primary-white);
}

.btn-small.btn-danger {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-small.btn-danger:hover {
    background: #ef4444;
    color: white;
}

/* ===== 数据统计页面 ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.chart-container {
    padding: var(--spacing-lg);
    min-height: 350px;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
}

.chart-container h3 {
    font-size: 16px;
    color: var(--gray-700);
    margin-bottom: var(--spacing-lg);
}

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

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-600);
}

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

/* ===== 项目列表页面 ===== */
.page-projects {
    width: 100%;
}

.project-name-cell {
    max-width: 300px;
}

.project-name-cell strong {
    color: var(--gray-800);
    font-size: 14px;
}

.project-name-cell small {
    font-size: 12px;
    line-height: 1.4;
}

#projectsTable {
    width: 100%;
}

#projectsTable th:nth-child(1) { width: 25%; }
#projectsTable th:nth-child(2) { width: 10%; }
#projectsTable th:nth-child(3) { width: 10%; }
#projectsTable th:nth-child(4) { width: 10%; }
#projectsTable th:nth-child(5) { width: 10%; }
#projectsTable th:nth-child(6) { width: 15%; }
#projectsTable th:nth-child(7) { width: 10%; }
#projectsTable th:nth-child(8) { width: 10%; }

.badge {
    display: inline-block;
    white-space: nowrap;
}

/* ===== 车辆管理页面 ===== */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    width: 100%;
}

.vehicle-card {
    background: var(--primary-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-red);
}

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

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-100);
}

.vehicle-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
}

.vehicle-type {
    padding: 4px 12px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.vehicle-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item .label {
    font-size: 13px;
    color: var(--gray-500);
}

.info-item .value {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 600;
}

.status-active { color: #4ade80; }
.status-idle { color: #fbbf24; }
.status-maintenance { color: #f87171; }

.vehicle-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.vehicle-actions button {
    flex: 1;
}

/* ===== 状态徽章 ===== */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.status-badge.inactive {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

.status-badge.warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* ===== 任务调度页面 ===== */
.tasks-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-lg);
    width: 100%;
}

.task-column {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    min-height: 500px;
}

.column-header {
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-header.pending {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.column-header.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.column-header.completed {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.task-card {
    background: var(--primary-white);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: grab;
}

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

.task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.task-meta {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.task-type,
.task-area {
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 11px;
    color: var(--gray-600);
}

.task-details {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: var(--spacing-sm);
}

.task-details div {
    margin-bottom: 4px;
}

.task-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--gray-100);
}

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

/* ===== 页面容器优化 ===== */
#pageContainer {
    width: 100%;
    max-width: 100%;
}

.page-stats,
.page-vehicles,
.page-staff,
.page-tasks,
.page-attendance,
.page-users,
.page-add-user,
.page-edit-user,
.page-roles,
.page-dispatch {
    width: 100%;
    max-width: 100%;
}

/* ===== 响应式优化 ===== */
@media (max-width: 1600px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1400px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .tasks-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .header-actions input,
    .header-actions select,
    .header-actions button {
        flex: 1;
        min-width: 120px;
    }
    
    .vehicles-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* ===== 个人信息页面 ===== */
.page-profile {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.profile-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

.profile-main {
    display: flex;
    flex-direction: column;
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: var(--radius-md);
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    position: relative;
    padding: 6px;
    background: linear-gradient(135deg, #ff4444 0%, #ff6b6b 50%, #ff8787 100%);
    box-shadow: 0 8px 24px rgba(255, 68, 68, 0.3), 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.profile-avatar-large::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: var(--radius-full);
    background: var(--primary-white);
    z-index: 0;
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(255, 68, 68, 0.4), 0 6px 12px rgba(0, 0, 0, 0.15);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.profile-info-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.profile-info-row:hover {
    background: var(--gray-100);
}

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

.profile-info-row span {
    color: var(--gray-800);
    font-size: 14px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    background: #4ade80;
    color: white;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-100);
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

.action-btn:hover {
    background: var(--primary-white);
    border-color: var(--primary-red);
    color: var(--primary-red);
    transform: translateX(4px);
}

.action-btn svg {
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.action-btn:hover svg {
    color: var(--primary-red);
}

.account-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
}

.stat-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

/* 响应式 */
@media (max-width: 1024px) {
    .profile-content {
        grid-template-columns: 1fr;
    }
}

/* ===== 模态框样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-500);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
}

.form-group label .required {
    color: var(--primary-red);
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--gray-800);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.btn-secondary {
    padding: 10px 20px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-primary {
    padding: 10px 20px;
    border: none;
    background: var(--primary-red);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #e63939;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 68, 68, 0.3);
}

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

/* 复选框服务选项样式 */
input[type="checkbox"]:checked + div {
    color: var(--primary-red);
}

label:has(input[type="checkbox"]:checked) {
    border-color: var(--primary-red) !important;
    background: rgba(255, 68, 68, 0.05) !important;
}

/* 输入框数字样式 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 新建项目模态框响应式 */
@media (max-width: 1024px) {
    .modal[style*="max-width: 1200px"] {
        max-width: 95vw !important;
    }
    
    .modal-body > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .modal-body > div > div:first-child {
        border-right: none !important;
        border-bottom: 1px solid var(--gray-200);
    }
}

/* 订单摘要固定样式优化 */
.order-summary-section {
    position: sticky;
    top: 0;
}


/* 照片上传插槽样式 */
[id^="photoSlot"]:hover {
    border-color: var(--primary-red) !important;
    background: rgba(255, 68, 68, 0.02);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[id^="photoSlot"]:active {
    transform: translateY(0);
}

/* ===== 表单分区样式 ===== */
.form-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-red);
    display: inline-block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--gray-100);
}

/* ===== 定位按钮 ===== */
.location-btn {
    transition: all 0.2s ease;
}

.location-btn:hover {
    background: #e63939 !important;
    transform: translateY(-50%) scale(1.05) !important;
    box-shadow: 0 4px 10px rgba(255, 68, 68, 0.4);
}

.location-btn:active {
    transform: translateY(-50%) scale(0.98) !important;
}

.location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 车牌号快速输入 ===== */
.province-quick-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    z-index: 5;
}

.province-quick-btn:hover {
    background: #e63939;
    transform: translateY(-50%) scale(1.05);
}

.province-quick-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.province-selector {
    margin-top: 8px;
    padding: 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    animation: slideDown 0.2s ease-out;
}

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

.province-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.province-btn {
    padding: 10px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.province-btn:hover {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 68, 68, 0.2);
}

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

@media (max-width: 768px) {
    .province-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 480px) {
    .province-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== 用户管理页面样式 ===== */
.page-users .badge,
.page-add-user .badge,
.page-edit-user .badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    display: inline-block;
}

/* 禁用的输入框样式 */
.page-edit-user input:disabled,
.page-edit-user textarea:disabled,
.page-edit-user select:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
    opacity: 0.7;
}

.page-edit-user input:disabled + small {
    font-size: 12px;
    color: var(--gray-400);
}

/* 用户管理表格操作按钮组 */
.page-users .data-table td:last-child {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.page-users .btn-icon {
    padding: 6px;
    transition: all 0.2s ease;
}

.page-users .btn-icon:hover {
    transform: scale(1.1);
}

/* 表单分组样式增强 */
.add-user-form .form-section,
.edit-user-form .form-section {
    margin-bottom: var(--spacing-xl);
}

.add-user-form .form-section:last-of-type,
.edit-user-form .form-section:last-of-type {
    margin-bottom: 0;
}

/* 密码输入框提示 */
.edit-user-form .form-section small {
    display: block;
    margin-top: -8px;
    margin-bottom: 12px;
    color: var(--gray-500);
    font-size: 13px;
}

/* 用户状态徽章动画 */
.page-users .badge {
    animation: fadeIn 0.3s ease;
}

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

/* ===== 角色管理页面样式 ===== */
.page-roles {
    padding: var(--spacing-lg);
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.role-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.3s ease;
}

.role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

.role-card-header {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
    border-bottom: 1px solid var(--gray-100);
}

.role-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.role-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.role-info {
    flex: 1;
}

.role-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.role-username {
    font-size: 13px;
    color: var(--gray-500);
}

.role-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.role-status.active {
    background-color: #4CAF50;
}

.role-status.inactive {
    background-color: #999;
}

.role-card-body {
    padding: var(--spacing-lg);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

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

.role-detail-item.full-width {
    grid-column: 1 / -1;
}

.role-detail-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-detail-item span {
    font-size: 14px;
    color: var(--text-primary);
}

.role-detail-item .role-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    width: fit-content;
}

.role-remarks {
    font-size: 13px !important;
    color: var(--gray-600) !important;
    line-height: 1.5;
}

.permissions-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.permission-tag {
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.permission-tag:hover {
    background: var(--primary-red);
    color: white;
    transform: scale(1.05);
}

.role-card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.btn-outline {
    background: white;
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
}

.btn-outline:hover {
    background: var(--primary-red);
    color: white;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .roles-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .roles-grid {
        grid-template-columns: 1fr;
    }
    
    .role-card-body {
        grid-template-columns: 1fr;
    }
}

/* ===== 任务调度页面样式 ===== */
.page-dispatch {
    padding: 16px;
}

.page-dispatch .page-header {
    margin-bottom: 16px;
}

.dispatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* 在超大屏幕上最多显示4列 */
@media (min-width: 1920px) {
    .dispatch-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 在大屏幕上最多显示3列 */
@media (min-width: 1400px) and (max-width: 1919px) {
    .dispatch-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dispatch-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.2s ease;
    border-left: 3px solid #FF9800;
}

.dispatch-card.dispatched {
    border-left-color: #4CAF50;
}

.dispatch-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dispatch-card-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid var(--gray-100);
}

.dispatch-project-info {
    width: 100%;
}

.project-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.project-title-row h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.dispatch-complete-badge {
    padding: 3px 8px;
    background: #4CAF50;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.dispatch-pending-badge {
    padding: 3px 8px;
    background: #FF9800;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.dispatch-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.dispatch-customer,
.dispatch-phone {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-600);
}

.dispatch-customer svg,
.dispatch-phone svg {
    opacity: 0.6;
    width: 13px;
    height: 13px;
}

.dispatch-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.dispatch-card-body {
    padding: 12px 14px;
    background: white;
}

.dispatch-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.dispatch-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dispatch-info-item label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dispatch-info-item span {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-highlight {
    color: var(--primary-red) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

.dispatch-progress {
    margin-top: 8px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.progress-header label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

.progress-header span {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-red);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.3s ease;
}

.dispatch-assignment {
    padding: 12px 14px;
    background: #f8f9fa;
    border-top: 1px solid var(--gray-100);
}

.assignment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.assignment-header svg {
    color: var(--primary-red);
    width: 16px;
    height: 16px;
}

.dispatch-current-assignment {
    background: white;
    border-radius: 6px;
    padding: 10px;
    border: 2px solid #4CAF50;
}

.assigned-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.assigned-driver-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.assigned-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #4CAF50;
    flex-shrink: 0;
}

.assigned-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.assigned-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.assigned-details strong {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assigned-details small {
    font-size: 11px;
    color: var(--gray-600);
}

.assigned-connector {
    color: #4CAF50;
    flex-shrink: 0;
}

.assigned-connector svg {
    width: 20px;
    height: 20px;
}

.assigned-vehicle-info {
    text-align: right;
    flex: 1;
    min-width: 0;
}

.vehicle-plate {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.vehicle-type {
    font-size: 11px;
    color: var(--gray-600);
    margin-top: 2px;
}

.btn-change-assignment {
    width: 100%;
    padding: 7px 12px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-change-assignment svg {
    width: 14px;
    height: 14px;
}

.btn-change-assignment:hover {
    background: var(--gray-50);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.assignment-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assignment-selector label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

.dispatch-select-enhanced {
    padding: 9px 11px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dispatch-select-enhanced:hover {
    border-color: var(--primary-red);
}

.dispatch-select-enhanced:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.1);
}

.no-pairs-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #FFF3CD;
    border: 1px solid #FFE69C;
    border-radius: 4px;
    color: #856404;
    font-size: 11px;
}

.no-pairs-warning svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.dispatch-notes {
    padding: 10px 14px;
    background: #E3F2FD;
    border-top: 1px solid #BBDEFB;
}

.dispatch-notes label {
    font-size: 11px;
    font-weight: 600;
    color: #1976D2;
    display: block;
    margin-bottom: 6px;
}

.dispatch-notes p {
    margin: 0;
    font-size: 12px;
    color: #1565C0;
    line-height: 1.4;
}

.dispatch-modal {
    max-width: 600px;
}

/* 响应式优化 */
@media (max-width: 1400px) {
    .dispatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 1024px) {
    .dispatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .dispatch-grid {
        grid-template-columns: 1fr;
    }
    
    .dispatch-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .assigned-team {
        flex-direction: column;
        align-items: stretch;
    }
    
    .assigned-connector {
        transform: rotate(90deg);
        margin: 4px 0;
    }
    
    .assigned-vehicle-info {
        text-align: left;
    }
}

