:root {
    --primary-color: #0066cc;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    color: var(--text-color);
    background-color: #f9f9f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 20px;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
}

.btn:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.book-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.book-info {
    padding: 15px;
}

.price {
    color: #e44d26;
    font-weight: bold;
    font-size: 1.2rem;
}

.badge {
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 5px;
}

/* Filters */
.filters {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input, .filters select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Auth forms */
.auth-form {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Requests */
.request-item {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.request-meta {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.sold {
    opacity: 0.6;
    position: relative;
}

.sold::after {
    content: '已售出';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 4px solid #dc3545;
    color: #dc3545;
    font-size: 2rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}
