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

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
}

.subtitle {
    font-size: 1.2em;
    color: #7f8c8d;
}

/* 搜索区域 */
.search-area {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-btn {
    padding: 15px 25px;
    font-size: 1.1em;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #2980b9;
}

.filter-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-label {
    font-size: 1.1em;
    font-weight: bold;
    color: #2c3e50;
}

.filter-select {
    padding: 10px 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    min-width: 150px;
}

/* 统计区域 */
.stats-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

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

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-number.available {
    color: #27ae60;
}

.stat-number.borrowed {
    color: #e74c3c;
}

.stat-label {
    font-size: 1.1em;
    color: #7f8c8d;
    font-weight: bold;
}

/* 图书列表 */
.books-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.books-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.book-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 5px solid #3498db;
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.book-card.available {
    border-left-color: #27ae60;
}

.book-card.borrowed {
    border-left-color: #e74c3c;
}

.book-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.book-author {
    font-size: 1.1em;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.book-category {
    display: inline-block;
    background: #ecf0f1;
    color: #2c3e50;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.book-price {
    font-size: 1.2em;
    font-weight: bold;
    color: #e67e22;
    margin-bottom: 10px;
    text-align: right;
}

.book-status {
    font-size: 1.1em;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
}

.book-status.available {
    background: #d5f4e6;
    color: #27ae60;
}

.book-status.borrowed {
    background: #fadbd8;
    color: #e74c3c;
}

/* 底部信息 */
.footer {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.footer p {
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #7f8c8d;
}

.admin-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.admin-link a:hover {
    text-decoration: underline;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    font-size: 1.2em;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2em;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .filter-area {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .books-list {
        grid-template-columns: 1fr;
    }
    
    .stats-area {
        grid-template-columns: 1fr;
    }
}

/* 适老化设计 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    body {
        background: white;
        color: black;
    }
    
    .header, .search-area, .stat-card, .book-card, .footer {
        background: white;
        border: 2px solid black;
    }
}