/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    text-align: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
}

/* 导航菜单 */
.nav-menu {
    list-style: none;
    margin-top: 20px;
}

.nav-menu li {
    margin: 5px 0;
}

.nav-menu a {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-menu a:hover {
    background-color: rgba(255,255,255,0.1);
    border-left-color: #fff;
    padding-left: 25px;
}

.nav-menu a.active {
    background-color: rgba(255,255,255,0.2);
    border-left-color: #fff;
    font-weight: 600;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s ease;
}

/* 顶部导航栏 */
.top-nav {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-nav h1 {
    font-size: 20px;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info span {
    font-size: 14px;
    color: #666;
}

.btn-logout {
    background: #ff4757;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #ff3742;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

table tr:hover {
    background-color: #f8f9fa;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* 搜索栏样式 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 财务报表搜索表单基础样式 */
.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    max-width: 100%;
}

.search-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.search-form .form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.search-form .form-group input,
.search-form .form-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

.search-form .form-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.search-form .form-actions button {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #fff;
}

.search-form .form-actions .btn-primary {
    background-color: #667eea;
}

.search-form .form-actions .btn-secondary {
    background-color: #6c757d;
}

.search-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.search-form-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form-label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.search-form-inputs {
    display: flex;
    gap: 5px;
}

.search-form-inputs input[type="datetime-local"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
}

.search-form-item select {
    width: 180px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
}

.search-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

.search-form-actions button {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

.search-form-actions .btn-primary {
    background-color: #667eea;
}

.search-form-actions .btn-secondary {
    background-color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h2,
    .sidebar-header p,
    .nav-menu span {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
        padding: 10px;
    }
    
    .top-nav h1 {
        font-size: 16px;
    }
    
    .card {
        padding: 15px;
    }
    
    table th,
    table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    /* 财务报表搜索表单移动端样式 */
    .search-form {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 10px;
    }

    .search-form .form-group input,
    .search-form .form-group select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .search-form .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-form .form-actions button {
        padding: 12px 20px;
        font-size: 16px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .search-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-form-item {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        width: 100%;
    }

    .search-form-label {
        white-space: normal;
        margin-bottom: 3px;
        font-size: 14px;
    }

    .search-form-inputs {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .search-form-inputs input[type="datetime-local"] {
        width: 100%;
        box-sizing: border-box;
    }

    .search-form-item select {
        width: 100%;
        box-sizing: border-box;
    }

    .search-form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-left: 0;
        width: 100%;
    }

    .search-form-actions button {
        padding: 12px 20px;
        font-size: 16px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .main-content {
        margin-left: 0;
        padding: 10px;
        overflow-x: hidden;
    }
    
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
    
    /* 卡片不溢出 */
    .card {
        overflow: hidden;
        padding: 10px;
        margin-left: -5px;
        margin-right: -5px;
        border-radius: 0;
    }
    
    /* 统计卡片2x2布局 */
    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-card h3 {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .stat-card .value {
        font-size: 18px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card .change {
    font-size: 12px;
    color: #28a745;
}

/* 图表容器 */
.chart-container {
    height: 300px;
    margin-top: 20px;
}
