* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.header-content {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    text-align: center;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

header .description {
    margin-bottom: 0;
    margin-top: 10px;
}

.highlight-name {
    font-size: 1.2em;
    font-weight: bold;
}

.header-image {
    max-width: 268px;
    width: 268px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.header-right a:hover .header-image {
    transform: scale(1.05);
}

.nav-link {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: #f5f5f5;
    color: #333;
}

.nav-link.active {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
}

.description {
    color: #d32f2f;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}


.upload-area {
    border: 3px dashed #0d9488;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: #f0fdfa;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #0f766e;
    background: #ccfbf1;
}

.upload-area.dragover {
    border-color: #4caf50;
    background: #e8f5e9;
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 5px;
}

.upload-hint {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.file-list {
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 10px;
}

.file-item .file-name {
    flex: 1;
    color: #333;
}

.file-item .file-size {
    color: #999;
    margin: 0 15px;
}

.file-item .remove-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 3px;
    cursor: pointer;
}

.preview-section {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.preview-info {
    margin-bottom: 15px;
    color: #666;
}

.column-mapping {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.mapping-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mapping-item label {
    font-weight: 500;
    color: #333;
    min-width: 100px;
}

.mapping-item select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
}

.mapping-item .required {
    color: #e53935;
    font-weight: bold;
}

.preview-table-container {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.preview-table th {
    background: #f5f5f5;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.preview-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
}

.preview-table tr:hover {
    background: #f9f9f9;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
}

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

.btn-primary {
    background: #0d9488;
    color: white;
}

.btn-success {
    background: #4caf50;
    color: white;
}

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

.btn-info {
    background: #2196f3;
    color: white;
}

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

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    display: none;
    line-height: 1.6;
    white-space: pre-line;
    max-height: 400px;
    overflow-y: auto;
}

.message.success {
    background: #c8e6c9;
    color: #2e7d32;
    display: block;
}

.message.error {
    background: #ffcdd2;
    color: #c62828;
    display: block;
}

.message.info {
    background: #bbdefb;
    color: #1565c0;
    display: block;
}

/* 上传进度条样式 */
.progress-container {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.progress-text {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.stats-header h2 {
    color: #333;
}

/* 标签页导航样式 */
.tab-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #333;
    background: #f5f5f5;
}

.tab-btn.active {
    color: #0d9488;
    border-bottom-color: #0d9488;
    font-weight: 600;
}

/* 标签页内容区域 */
.tab-content {
    margin-top: 20px;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-header h2 {
    color: #333;
    margin: 0;
}

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

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.8em;
    font-weight: bold;
}

.stat-card .stat-value.unpaid {
    color: #ffeb3b;
}

.stat-card .stat-value.paid {
    color: #c8e6c9;
}

.filter-section {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
}

.sort-select,
.payment-filter {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
    background: white;
    min-width: 150px;
}

.filter-multi-select {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-multi-select label {
    font-weight: 500;
    color: #333;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
    max-height: 150px;
    overflow-y: auto;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background 0.2s;
}

.filter-checkbox-item:hover {
    background: #e3f2fd;
}

.filter-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-checkbox-item span {
    user-select: none;
}

.table-section {
    margin-top: 20px;
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    table-layout: auto;
}

/* 文件管理表格特殊样式 */
#files-table {
    table-layout: auto;
    width: 100%;
    min-width: 1000px;
}

#files-table th:nth-child(1),
#files-table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

#files-table th:nth-child(2),
#files-table td:nth-child(2) {
    min-width: 400px;
    width: auto;
}

#files-table th:nth-child(3),
#files-table td:nth-child(3) {
    width: 120px;
    min-width: 120px;
}

#files-table th:nth-child(4),
#files-table td:nth-child(4) {
    width: 180px;
    min-width: 180px;
}

#files-table th:nth-child(5),
#files-table td:nth-child(5) {
    width: 200px;
    min-width: 200px;
}

thead {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

/* 文件名列样式 - 确保完整显示 */
#files-table td:nth-child(2) {
    word-break: break-all;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: none;
    min-width: 300px;
}

th {
    font-weight: 600;
}

tbody tr:hover {
    background: #f5f5f5;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

.month-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.month-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
    margin: 4px;
}

.month-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.month-badge.paid {
    background: #c8e6c9;
    color: #2e7d32;
}

.month-badge.unpaid {
    background: #ffe0b2;
    color: #e65100;
}

.month-income {
    font-weight: 600;
    color: #4caf50;
}

.payment-status {
    font-size: 0.9em;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.payment-status.paid {
    background: #4caf50;
    color: white;
}

.payment-status.unpaid {
    background: #ff9800;
    color: white;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

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

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 8px;
    }
}

/* 日历样式 */
.calendar-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.calendar-header h3 {
    font-size: 1.5em;
    color: #333;
    min-width: 100px;
    text-align: center;
}

.btn-year-nav {
    background: #0d9488;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.3s;
}

.btn-year-nav:hover {
    background: #5568d3;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.calendar-month {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-month-content {
    cursor: pointer;
    flex: 1;
}

.calendar-month:hover {
    border-color: #0d9488;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.calendar-month.uploaded {
    background: #e8f5e9;
    border-color: #4caf50;
}

.calendar-month.uploaded::after {
    content: '✓';
    position: absolute;
    top: 5px;
    left: 5px;
    background: #4caf50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.calendar-month.selected {
    background: #0d9488;
    color: white;
    border-color: #0d9488;
}

.calendar-month-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.calendar-month-date {
    font-size: 0.9em;
    color: #666;
}

.calendar-month.selected .calendar-month-date {
    color: rgba(255, 255, 255, 0.9);
}

.calendar-month.uploaded .calendar-month-date {
    color: #4caf50;
    font-weight: 500;
}

.calendar-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.8;
    z-index: 10;
}

.calendar-delete-btn:hover {
    opacity: 1;
    background: #d32f2f;
    transform: scale(1.1);
}

.calendar-month:hover .calendar-delete-btn {
    opacity: 1;
}

/* 书籍卡片样式 */
.book-cards-section {
    margin-top: 20px;
    margin-bottom: 20px;
}

.book-cards-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3em;
}

.book-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.book-card {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.book-card-name {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
    word-break: break-all;
    line-height: 1.4;
}

.book-card-time {
    font-size: 0.85em;
    opacity: 0.9;
    margin-top: 5px;
}

.book-card.selected {
    border: 3px solid #4caf50;
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
}

/* 新增：其他文件上传区域样式 */
.upload-section {
    margin-bottom: 30px;
}

.upload-section h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 15px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #f0f0f0;
    text-decoration: none;
}

.modal-body {
    padding: 30px;
}

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

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

.form-group .required {
    color: #f44336;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* 表格中无效字段的样式 */
.invalid-field {
    background-color: #ffebee;
    color: #c62828;
    border-left: 3px solid #f44336;
    padding-left: 5px;
}

.error-icon {
    color: #f44336;
    font-size: 1.2em;
    margin-left: 5px;
    cursor: help;
    vertical-align: middle;
}

.error-icon:hover {
    color: #d32f2f;
}

/* 页脚样式 */
.main-footer {
    margin-top: 50px;
    padding: 30px 20px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-row {
    margin-bottom: 10px;
}

.footer-row:last-child {
    margin-bottom: 0;
}

.footer-copyright,
.footer-contact,
.footer-beian {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.footer-beian a {
    color: #0d9488;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-beian a:hover {
    color: #0f766e;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-footer {
        padding: 20px 15px;
        margin-top: 30px;
    }

    .footer-copyright,
    .footer-contact,
    .footer-beian {
        font-size: 12px;
    }

    .footer-row {
        margin-bottom: 8px;
    }
}
