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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header h1 i {
    margin-right: 10px;
    color: #ffd700;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: flex-start;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.stat-label {
    color: #7f8c8d;
    font-size: 12px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* 图表容器 */
.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.chart-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

.chart-container h2 i {
    margin-right: 10px;
    color: #667eea;
}

.chart-wrapper {
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-wrapper img {
    max-width: 100%;
    height: auto;
}

.loading {
    color: #7f8c8d;
    font-size: 16px;
}

/* 记录列表 */
.records-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.records-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
}

.records-header h2 i {
    margin-right: 10px;
    color: #667eea;
}

/* 快速搜索栏 */
.quick-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-search-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
    transition: border-color 0.3s ease;
}

.quick-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.quick-search-input::placeholder {
    color: #adb5bd;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.records-table th {
    background: #f8f9fa;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.records-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.records-table tr:hover {
    background-color: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px !important;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-unpaid {
    background: #f8d7da;
    color: #721c24;
}

.status-reviewed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-unreviewed {
    background: #fff3cd;
    color: #856404;
}

/* 日期背景色 */
.date-past {
    background-color: #d4edda !important; /* 淡绿色 - 昨日及之前 */
}

.date-today {
    background-color: #d1ecf1 !important; /* 淡蓝色 - 今日 */
}

.date-future {
    background-color: #fff3cd !important; /* 淡黄色 - 明天及之后 */
}

/* 快捷操作按钮 */
.quick-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.quick-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.quick-btn-paid {
    background: #28a745;
    color: white;
}

.quick-btn-unpaid {
    background: #dc3545;
    color: white;
}

.quick-btn-reviewed {
    background: #17a2b8;
    color: white;
}

.quick-btn-unreviewed {
    background: #ffc107;
    color: #212529;
}

.quick-btn-copy {
    background: #6c757d;
    color: white;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #e9ecef;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

.modal-content.small {
    max-width: 400px;
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* 表单行布局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row .form-group {
    margin-bottom: 15px;
}

/* 表单分区 */
.form-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.form-section h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

/* 只读输入框 */
.readonly-input {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .records-header {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-search-bar {
        justify-content: center;
    }

    .quick-search-input {
        flex: 1;
        min-width: 120px;
    }

    /* 移动端表格优化 */
    .table-wrapper {
        margin: 0 -15px;
        padding: 0 15px;
    }

    .records-table {
        font-size: 11px;
        min-width: 900px;
    }

    .records-table th,
    .records-table td {
        padding: 8px 5px;
        white-space: nowrap;
    }

    /* 酒店名称列允许换行 */
    .records-table td:nth-child(3) {
        white-space: normal;
        max-width: 120px;
        word-break: break-all;
    }

    /* 快捷操作按钮堆叠显示 */
    .quick-actions {
        flex-direction: column;
        gap: 3px;
    }

    .quick-btn {
        font-size: 10px;
        padding: 3px 6px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }

    .stat-content h3 {
        font-size: 24px;
    }

    .records-table {
        font-size: 10px;
    }

    .records-table th,
    .records-table td {
        padding: 6px 3px;
    }

    /* 隐藏部分列在极小屏幕上 */
    .records-table th:nth-child(6),
    .records-table td:nth-child(6) {
        display: none;
    }

    .quick-search-bar {
        width: 100%;
    }

    .quick-search-input {
        width: 100%;
    }
}
