/* ==================== 主色调：白色 + 深棕色(#8B5A2B) 点缀 ==================== */
:root {
    --primary: #8B5A2B;
    --primary-dark: #6B3E1A;
    --primary-light: #C49A6C;
    --secondary: #F5F0E8;
    --text-dark: #2C2C2C;
    --text-light: #6B6B6B;
    --border: #E8E0D8;
    --success: #2E7D32;
    --warning: #F57C00;
    --danger: #C62828;
    --info: #1976D2;
    --bg-light: #F8F5F0;
    
    /* 响应式间距变量 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* 字体大小变量 */
    --font-xs: 11px;
    --font-sm: 13px;
    --font-md: 14px;
    --font-lg: 16px;
    --font-xl: 18px;
    --font-xxl: 20px;
    --font-xxxl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', 'PingFang SC', 'Helvetica Neue', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    font-size: var(--font-md);
    line-height: 1.5;
}

/* ==================== 容器布局 ==================== */
.container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 10px;
}

/* 大屏幕优化 */
@media (min-width: 1920px) {
    .container {
        padding: 0 10px;
    }
}

@media (min-width: 1400px) and (max-width: 1919px) {
    .container {
        padding: 0 10px;
    }
}

/* ==================== 登录页面样式 ==================== */
.login-page {
    background: linear-gradient(135deg, #F8F5F0 0%, #ECE4D8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.login-box {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 40px 32px;
    transition: transform 0.3s ease;
}

@media (max-width: 480px) {
    .login-box {
        padding: 28px 20px;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .login-icon {
        font-size: 48px;
    }
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: 20px;
    }
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.login-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s;
}

.login-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-light);
}

/* ==================== 主页面样式 ==================== */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
        padding: 12px 10px;
    }
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .logo h1 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 16px;
    }
}

.logo p {
    font-size: 12px;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .logo p {
        font-size: 11px;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 480px) {
    .user-info {
        gap: 8px;
    }
}

.user-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.user-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.role-admin {
    background: #E8F0FE;
    color: var(--info);
}

.role-operator {
    background: var(--secondary);
    color: var(--primary);
}

.logout-btn {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--secondary);
    color: var(--danger);
}

/* ==================== 导航栏 ==================== */
.nav {
    background: white;
    border-radius: 16px;
    margin: 20px 0;
    padding: 0 8px;
    display: flex;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar {
    height: 4px;
}

.nav::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

.nav::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.nav li {
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    white-space: nowrap;
    font-size: 14px;
}

@media (max-width: 768px) {
    .nav li {
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .nav li {
        padding: 10px 12px;
        font-size: 12px;
    }
}

.nav li:hover {
    background: var(--secondary);
    color: var(--primary);
}

.nav li.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

/* ==================== 主要内容区 ==================== */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    min-height: 600px;
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 12px;
        border-radius: 12px;
    }
}

.page {
    display: none;
}

.page.active-page {
    display: block;
}

/* ==================== 页面头部 ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 20px;
    }
}

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    position: relative;
    padding-left: 16px;
}

@media (max-width: 768px) {
    .page-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 18px;
        padding-left: 12px;
    }
}

.page-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

@media (max-width: 480px) {
    .btn {
        padding: 6px 16px;
        font-size: 13px;
    }
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 90, 43, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #1B5E20;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

@media (max-width: 480px) {
    .btn-sm {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* ==================== 表格样式 ==================== */
.table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

@media (max-width: 768px) {
    table {
        font-size: 13px;
        min-width: 500px;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 12px;
        min-width: 450px;
    }
}

th, td {
    border: 1px solid var(--border);
    padding: 12px 16px;
    text-align: left;
}

@media (max-width: 768px) {
    th, td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    th, td {
        padding: 8px 10px;
    }
}

th {
    background: var(--secondary);
    font-weight: 600;
    color: var(--text-dark);
}

tr:hover {
    background: #FEF9F0;
}

/* ==================== 徽章样式 ==================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

@media (max-width: 480px) {
    .badge {
        padding: 3px 10px;
        font-size: 11px;
    }
}

.badge-success {
    background: #E8F5E9;
    color: var(--success);
}

.badge-warning {
    background: #FFF3E0;
    color: var(--warning);
}

.badge-danger {
    background: #FFEBEE;
    color: var(--danger);
}

.badge-info {
    background: #E3F2FD;
    color: var(--info);
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--secondary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
}

@media (max-width: 768px) {
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
}

.card h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .card h3 {
        font-size: 16px;
    }
}

.card h4 {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ==================== 统计卡片网格 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .stat-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 12px;
    }
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

@media (max-width: 768px) {
    .stat-number {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 24px;
    }
}

.stat-label {
    color: var(--text-light);
    margin-top: 8px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .stat-label {
        font-size: 12px;
    }
}

/* ==================== 进度条 ==================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #E8E0D8;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 16px;
    }
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

@media (max-width: 480px) {
    .form-control {
        padding: 8px 12px;
        font-size: 13px;
    }
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

select.form-control {
    cursor: pointer;
    background: white;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ==================== 布局 ==================== */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .row {
        gap: 16px;
    }
}

.col {
    flex: 1;
    min-width: 280px;
}

@media (max-width: 768px) {
    .col {
        min-width: 100%;
    }
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    padding: 16px;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    max-height: 85%;
    overflow: auto;
    padding: 28px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 16px;
        border-radius: 16px;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 480px) {
    .modal-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

@media (max-width: 480px) {
    .modal-header h3 {
        font-size: 18px;
    }
}

.close {
    cursor: pointer;
    font-size: 28px;
    color: var(--text-light);
    transition: all 0.3s;
}

.close:hover {
    color: var(--danger);
}

/* ==================== 表单行 ==================== */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ==================== 警告框 ==================== */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #FFEBEE;
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #E8F5E9;
    color: var(--success);
    border-left: 4px solid var(--success);
}

/* ==================== 报告样式 ==================== */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.report-table th,
.report-table td {
    border: 1px solid var(--border);
    padding: 10px;
}

@media (max-width: 768px) {
    .report-table th,
    .report-table td {
        padding: 8px;
        font-size: 12px;
    }
}

/* ==================== 动画 ==================== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== 响应式辅助类 ==================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .hide-phone {
        display: none !important;
    }
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}