* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 功能选择页面样式 */
.home-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.home-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.home-header h1 {
    color: #667eea;
    font-size: 22px;
}

.home-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.home-tip {
    text-align: center;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    flex-shrink: 0;
}

.function-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    min-height: 0;
}

.function-card {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.function-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    color: #667eea;
}

.function-icon {
    font-size: 36px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.function-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    flex-shrink: 0;
}

.function-card:hover .function-title {
    color: #667eea;
}

.function-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 10px;
    }
    
    .function-card {
        padding: 15px 10px;
        border-radius: 10px;
    }
    
    .function-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }
    
    .function-title {
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .function-desc {
        font-size: 11px;
    }
    
    .home-header {
        padding: 10px 15px;
    }
    
    .home-header h1 {
        font-size: 18px;
    }
    
    .home-main {
        padding: 12px 10px;
    }
    
    .home-tip {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 8px;
    }
    
    .function-card {
        padding: 12px 8px;
        border-radius: 8px;
    }
    
    .function-icon {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .function-title {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .function-desc {
        font-size: 10px;
    }
    
    .home-header {
        padding: 8px 12px;
    }
    
    .home-header h1 {
        font-size: 16px;
    }
    
    .home-main {
        padding: 10px 8px;
    }
    
    .home-tip {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* 手机端文件上传优化 */
    input[type="file"] {
        padding: 12px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    input[type="file"]::-webkit-file-upload-button {
        padding: 10px 20px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .function-card {
        padding: 10px 6px;
    }
    
    .function-icon {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .function-title {
        font-size: 13px;
    }
    
    .function-desc {
        font-size: 9px;
    }
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.error-msg {
    color: #e74c3c;
    margin-top: 10px;
    text-align: center;
    display: none;
}

.login-tip {
    margin-top: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 主应用布局 */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info span {
    font-weight: 500;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 250px;
    height: calc(100vh - 60px);
    background: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 101;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
}

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.nav-item.active {
    background: #f0f4ff;
    color: #667eea;
    border-left-color: #667eea;
}

.nav-icon {
    margin-right: 10px;
    font-size: 20px;
}

/* 主内容区 */
.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 60px);
    max-width: 1400px;
    width: 100%;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page h2 {
    margin-bottom: 20px;
    color: #333;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.warning {
    border-left: 4px solid #f39c12;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filter-bar select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.total-amount {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

.total-amount span {
    font-size: 20px;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e9ecef;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .btn {
    margin-right: 5px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* 状态标签 */
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-urgent {
    background: #f8d7da;
    color: #721c24;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-bar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .data-table {
        font-size: 14px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .modal-content {
        margin: 20px auto;
        padding: 20px;
        width: 95%;
    }

    .nav-item {
        padding: 12px 15px;
    }
}

/* 操作日志样式 */
.activity-log-section {
    margin-top: 30px;
}

.activity-log {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-height: 500px;
    overflow-y: auto;
}

.activity-log-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.activity-log-item:last-child {
    border-bottom: none;
}

.activity-log-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.activity-log-content {
    flex: 1;
}

.activity-log-text {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.activity-log-time {
    color: #999;
    font-size: 12px;
}

.activity-log-user {
    font-weight: 600;
}

/* 日志页面样式 */
.log-page-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.log-list-page {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    min-height: 400px;
}

.log-item-page {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.log-item-page:last-child {
    border-bottom: none;
}

.log-item-icon-page {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.log-item-content-page {
    flex: 1;
}

.log-item-text-page {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 6px;
}

.log-item-user-page {
    font-weight: 600;
    color: #667eea;
}

.log-item-time-page {
    color: #999;
    font-size: 12px;
}

.log-pagination-page {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.log-page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.3s;
}

.log-page-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.log-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.log-page-info {
    font-size: 14px;
    color: #666;
}

.log-info {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .log-list-page {
        padding: 15px;
    }

    .log-item-page {
        padding: 12px 0;
    }

    .log-item-text-page {
        font-size: 13px;
    }

    .log-pagination-page {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }

    .log-page-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .log-page-info {
        font-size: 12px;
        width: 100%;
        text-align: center;
    }
}
    color: #667eea;
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }

    .logo {
        font-size: 20px;
    }

    .stats-grid {
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 24px;
    }
    
    /* 手机端文件上传优化 */
    input[type="file"] {
        padding: 12px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    input[type="file"]::-webkit-file-upload-button {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .activity-log {
        padding: 15px;
        max-height: 400px;
    }
    
    .activity-log-text {
        font-size: 13px;
    }
}

