/* 校园书易通 - 校园书籍交易平台 - 样式表 */

/* 重置样式和公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
}

.logo a {
    color: #3498db;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #34495e;
}

.user-actions a {
    color: #3498db;
    text-decoration: none;
    margin-left: 10px;
}

/* 主要内容样式 */
main {
    min-height: calc(100vh - 180px);
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary:hover {
    background-color: #219653;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

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

.btn-warning:hover {
    background-color: #e67e22;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

/* 书籍卡片样式 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
    padding: 0 10px;
}

.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.book-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.book-card h4 {
    padding: 15px 10px 5px;
    font-size: 1.1rem;
    color: #2c3e50;
}

.book-card .author {
    color: #7f8c8d;
    font-size: 0.9rem;
    padding: 0 10px 5px;
}

.book-card .price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0 10px 5px;
}

.book-card .condition {
    color: #95a5a6;
    font-size: 0.9rem;
    padding: 0 10px 10px;
}

.book-card .description {
    color: #7f8c8d;
    font-size: 0.85rem;
    padding: 0 10px 10px;
    line-height: 1.4;
}

/* 如何使用样式 */
.how-it-works {
    padding: 60px 0;
    background-color: #ecf0f1;
}

.how-it-works h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: #2c3e50;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.step h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #3498db;
}

.step p {
    color: #7f8c8d;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px 0;
}

/* 页头标题样式 */
.page-header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.back-btn {
    position: absolute;
    left: 20px;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
}

/* 表单样式 - 专门针对出售页面 */
.sell-form-section {
    padding: 20px 0;
    background-color: #f8f9fa;
}

.sell-book-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.form-group label::after {
    content: attr(data-required);
    color: #e74c3c;
    margin-left: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #f8f9fa;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: white;
}

/* 密码输入框容器 */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 40px;
    flex: 1;
}

.password-toggle {
    position: absolute;
    right: 12px;
    cursor: pointer;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.password-toggle:hover {
    color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group.half-width {
    width: calc(50% - 10px);
}

.form-group.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
    transform: scale(1.2);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.form-actions .btn {
    padding: 14px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    flex: 1;
    max-width: 200px;
}

.form-actions .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #2573a7);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.form-actions .btn {
    background-color: #95a5a6;
    color: white;
    flex: 1;
    max-width: 200px;
}

.form-actions .btn:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(127, 140, 141, 0.4);
}

.help-text {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 5px;
    font-style: italic;
}

/* 搜索和筛选区域 */
.search-section {
    padding: 20px 0;
    background-color: white;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 300px;
}

.search-form .btn {
    padding: 12px 25px;
    border-radius: 8px;
    margin-left: -5px;
}

.filters {
    background-color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #e1e8ed;
}

.filter-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: white;
    min-width: 120px;
}

/* Toast 通知样式 */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
    text-align: center;
    font-weight: 500;
}

.toast-success {
    background: linear-gradient(135deg, #27ae60, #219653);
}

.toast-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.toast-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 字段错误样式 */
.field-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 500;
}

/* 购物车数量样式 */
.cart-count {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
    display: inline-block;
}

/* 购物车页面样式 */
.cart-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.cart-items {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 20px;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart h3 {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #ecf0f1;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    flex: 0 0 80px;
}

.item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.item-details {
    flex: 1;
    padding: 0 15px;
}

.item-details h4 {
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 600;
}

.item-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
}

.item-quantity {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.item-quantity label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 500;
}

.quantity-input {
    width: 60px;
    padding: 8px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}

.quantity-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.item-total {
    flex: 0 0 100px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

.item-actions {
    flex: 0 0 100px;
    text-align: center;
}

.remove-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.cart-summary {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 25px;
    width: 100%;
    max-width: 350px;
    align-self: flex-end;
}

.cart-summary h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.3rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.summary-item.total {
    font-weight: bold;
    font-size: 1.2rem;
    color: #e74c3c;
    padding-top: 15px;
    border-top: 2px solid #ecf0f1;
    margin-top: 10px;
}

.checkout-btn {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #27ae60, #219653);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    padding: 20px 0;
}

.page-btn {
    display: inline-block;
    padding: 10px 16px;
    border: 2px solid #e1e8ed;
    background-color: white;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.page-btn:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.page-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 管理员操作区域样式 */
.admin-actions {
    margin-top: 250px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.admin-actions h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.admin-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.admin-actions-grid .btn {
    display: block !important;
    padding: 12px 15px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 4px;
}

.admin-actions-grid .btn[style*="display: none"] {
    display: none !important;
}

/* 响应式支持 */
@media (max-width: 768px) {
    .admin-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* 管理员操作占位区域样式 */
.admin-actions-placeholder {
    display: inline-block;
    width: 120px;
    height: 40px;
    border: 2px solid transparent;
    background: transparent;
    margin: 0 8px;
    vertical-align: top; /* 确保与其他按钮对齐 */
}

.admin-actions-placeholder.admin-visible {
    border: 2px solid #e74c3c; /* 红色边框，类似原始问题中的红框 */
    border-radius: 4px;
}

.admin-manage-btn {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 2px;
    background-color: #f39c12;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.admin-manage-btn:hover {
    background-color: #e67e22;
}

/* 分类标签按钮样式 */
.category-tabs { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 10px; 
    margin-bottom: 30px; 
}

.category-btn { 
    padding: 12px 20px; 
    background-color: #f8f9fa; 
    border: 2px solid #e1e8ed; 
    border-radius: 30px; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 600; 
    color: #7f8c8d; 
    transition: all 0.3s ease; 
    min-width: 90px; 
    text-align: center; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.category-btn:hover { 
    background-color: #e1e8ed; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

.category-btn.active { 
    background-color: #3498db; 
    color: white; 
    border-color: #3498db; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3); 
}

/* 响应式媒体查询 */
@media (max-width: 1024px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group.half-width {
        width: 100%;
        margin-bottom: 25px;
    }
    
    .cart-summary {
        max-width: 100%;
        align-self: stretch;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 5px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn, 
    .form-actions .btn-primary {
        max-width: 100%;
    }
    
    .search-input {
        min-width: auto;
        flex: 1;
    }
    
    .filter-group {
        display: block;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .item-image, .item-details, .item-quantity, .item-total, .item-actions {
        flex: none;
    }
    
    .item-quantity {
        flex-direction: row;
        gap: 10px;
    }
    
    .page-header h2 {
        font-size: 1.8rem;
    }
}

/* 用户书籍页面样式 */
.user-books-section {
    padding: 20px 0;
    background-color: #f8f9fa;
}

.user-books-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.user-books-table th,
.user-books-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.user-books-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 15px;
}

.user-books-table tbody tr {
    transition: background-color 0.2s;
}

.user-books-table tbody tr:hover {
    background-color: #f8f9ff;
}

.user-books-table tbody tr:last-child td {
    border-bottom: none;
}

.user-books-table .status-available {
    color: #27ae60;
    font-weight: 600;
    background-color: #e8f5e9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
}

.user-books-table .status-withdrawn {
    color: #f39c12;
    font-weight: 600;
    background-color: #fef9e7;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
}

.user-books-table .book-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.user-books-table .btn {
    margin: 0;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.user-books-table .btn-warning {
    background-color: #f39c12;
    color: white;
}

.user-books-table .btn-warning:hover {
    background-color: #e67e22;
}

.user-books-table .btn-success {
    background-color: #27ae60;
    color: white;
}

.user-books-table .btn-success:hover {
    background-color: #219653;
}

.user-books-table .btn-info {
    background-color: #3498db;
    color: white;
}

.user-books-table .btn-info:hover {
    background-color: #2980b9;
}

.user-books-table .btn.disabled {
    background-color: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
}

.user-books-table .btn.disabled:hover {
    background-color: #bdc3c7;
}

/* 卡片式布局适配 */
@media (max-width: 768px) {
    .user-books-table,
    .user-books-table thead,
    .user-books-table tbody,
    .user-books-table th,
    .user-books-table td,
    .user-books-table tr {
        display: block;
    }

    .user-books-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .user-books-table tr {
        border: 1px solid #e1e8ed;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .user-books-table td {
        border: none;
        border-bottom: 1px solid #e1e8ed;
        position: relative;
        padding-left: 40% !important;
    }

    .user-books-table td:last-child {
        border-bottom: none;
    }

    .user-books-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 15px;
        width: 35%;
        text-align: left;
        font-weight: 600;
        color: #2c3e50;
    }

    .user-books-table .book-actions {
        padding-left: 40% !important;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .user-books-table .book-actions:before {
        display: none;
    }
}

/* 空书籍消息样式 */
.no-books-message {
    text-align: center;
    padding: 60px 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.no-books-message h3 {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.no-books-message p {
    color: #95a5a6;
    font-size: 1.1rem;
}

/* 响应式媒体查询 */
@media (max-width: 1024px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group.half-width {
        width: 100%;
        margin-bottom: 25px;
    }
    
    .cart-summary {
        max-width: 100%;
        align-self: stretch;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 5px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn, 
    .form-actions .btn-primary {
        max-width: 100%;
    }
    
    .search-input {
        min-width: auto;
        flex: 1;
    }
    
    .filter-group {
        display: block;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .item-image, .item-details, .item-quantity, .item-total, .item-actions {
        flex: none;
    }
    
    .item-quantity {
        flex-direction: row;
        gap: 10px;
    }
    
    .page-header h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .sell-book-form {
        padding: 25px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero h2 {
        font-size: 1.6rem;
    }
    
    .page-header {
        padding: 30px 0;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .step {
        padding: 20px;
    }
}

/* 书籍详情页面样式 */
.book-detail-section {
    padding: 40px 0;
    background-color: white;
}

.book-detail-container {
    display: flex;
    gap: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 40px;
}

.book-image {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 300px;
}

.book-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.book-info {
    flex: 1;
    padding: 10px;
}

.book-info > h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.book-info > p {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: #34495e;
}

.book-info .book-price {
    font-size: 1.8rem;
    color: #e74c3c;
    font-weight: bold;
    margin: 15px 0;
}

.book-info .book-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.rating {
    color: #f39c12;
    font-weight: normal;
}

.book-description {
    margin: 25px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.book-description h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.3rem;
}

.book-description p {
    color: #555;
    line-height: 1.7;
}

.book-meta {
    margin: 25px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.book-meta p {
    display: flex;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.book-meta p:last-child {
    border-bottom: none;
}

.book-meta p strong {
    display: inline-block;
    width: 120px;
    color: #2c3e50;
    font-weight: 600;
}

.book-meta p span {
    color: #555;
    flex: 1;
}

.book-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.book-actions .btn {
    flex: 1;
    min-width: 150px;
    padding: 14px 20px;
    font-size: 1.1rem;
    border-radius: 8px;
    text-align: center;
}

.related-books {
    padding: 30px 0;
    background-color: #f8f9fa;
}

.related-books h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* 移动端适配 */
@media (max-width: 992px) {
    .book-detail-container {
        flex-direction: column;
    }
    
    .book-image {
        flex: 0 0 auto;
        max-width: 100%;
    }
    
    .book-info .book-meta p strong {
        width: 100px;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .book-detail-container {
        padding: 20px;
        gap: 20px;
    }
    
    .book-info > h2 {
        font-size: 1.8rem;
    }
    
    .book-actions {
        flex-direction: column;
    }
    
    .book-actions .btn {
        min-width: auto;
    }
    
    .book-meta p strong {
        display: block;
        width: auto;
        margin-bottom: 5px;
    }
}

/* 预约购买模态框样式 */
.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);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideDown 0.3s;
}

.modal-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

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

.modal-body {
    padding: 25px;
}

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

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.modal-body .form-group .required {
    color: #e74c3c;
    margin-left: 2px;
}

.modal-body .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.modal-body .form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.modal-body .form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #6c757d;
}

.modal-body .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-body .form-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-body .form-actions {
        flex-direction: column;
    }
    
    .modal-body .form-actions .btn {
        width: 100%;
    }
}

/* 库存编辑功能样式 */
.stock-value {
    cursor: pointer;
    color: #3498db;
    font-weight: bold;
    transition: color 0.3s;
}

.stock-value:hover {
    color: #2980b9;
    text-decoration: underline;
}

.stock-value.editing {
    cursor: default;
    color: inherit;
    text-decoration: none;
}

.stock-edit-input {
    width: 50px;
    padding: 2px 5px;
    font-size: 14px;
    border: 1px solid #3498db;
    border-radius: 3px;
    text-align: center;
}

.stock-edit-input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.3);
}

/* 已下架书籍导航栏样式 */
#withdrawn-nav a {
    color: #e67e22;
    font-weight: bold;
}

#withdrawn-nav a:hover {
    color: #d35400;
}