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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 工具类 */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 顶部导航栏 */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.logo-text {
    white-space: nowrap;
}

/* 搜索区域 */
.search-section {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-color-alpha);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.clear-search-btn {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.clear-search-btn.hidden {
    display: none;
}

.search-icon,
.clear-icon {
    width: 20px;
    height: 20px;
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.suggestions-section {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.suggestions-section:last-child {
    border-bottom: none;
}

.suggestions-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.suggestions-section ul {
    list-style: none;
}

.suggestions-section li {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.suggestions-section li:hover {
    background-color: var(--bg-hover);
}

/* 控制按钮 */
.controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.control-btn:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-color);
}

.control-btn .icon {
    width: 18px;
    height: 18px;
}

.lucky-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
    color: white;
    border-color: var(--accent-color);
}

.lucky-btn:hover {
    background: linear-gradient(135deg, var(--accent-color-dark), var(--accent-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 主要内容区域 */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* 书籍展示区域 */
.books-section {
    position: relative;
}

/* 加载状态 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 书籍网格 - 强制无空白版本 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    width: 100%;
}

/* 强制网格填充 - 针对常见屏幕尺寸 */
@media (min-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 599px) {
    .books-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* 确保书籍卡片填满空间 */
.book-card {
    width: 100%;
    min-height: 300px;
}

/* 书籍卡片 */
.book-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color-alpha);
}

.book-image-container {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.book-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-image {
    transform: scale(1.05);
}

.book-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
    color: var(--text-secondary);
    font-size: 3rem;
}

.book-info {
    padding: 1rem;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.book-author-item {
    cursor: pointer;
    transition: color 0.2s ease;
}

.book-author-item:hover {
    color: var(--accent-color);
}

.author-separator {
    color: var(--text-secondary);
    cursor: default;
}

.book-author:hover {
    color: var(--accent-color);
}

.book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.book-tag {
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.book-tag:hover {
    background-color: var(--accent-color-alpha);
    color: var(--accent-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--bg-hover);
    border-color: var(--accent-color);
}

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

.page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0 1rem;
}

/* 模态弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background-color: var(--bg-secondary);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.book-image-section {
    flex-shrink: 0;
    width: 300px;
}

.modal-book-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.book-info-section {
    flex: 1;
    min-width: 0;
}

.modal-book-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.modal-book-author {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-author-item {
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-author-item:hover {
    color: var(--accent-color);
}

.modal-book-author:hover {
    color: var(--accent-color);
}

.modal-book-publisher {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.publisher-label {
    font-weight: 500;
    color: var(--text-primary);
}

.publisher-name {
    color: var(--accent-color);
    font-weight: 500;
}

.modal-book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-book-tag {
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-book-tag:hover {
    background-color: var(--accent-color-alpha);
    color: var(--accent-color);
}

.modal-book-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.modal-book-meta {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.book-isbn {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', monospace;
}

/* 真实3D骰子 */
.dice-roller {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    cursor: pointer;
    transition: all 0.3s ease;
    perspective: 1000px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.dice-roller:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.dice-container {
    position: relative;
    width: 70px;
    height: 70px;
    transform-style: preserve-3d;
}

.dice {
    width: 70px;
    height: 70px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: rotateX(-25deg) rotateY(25deg) rotateZ(0deg);
}

.dice.rolling {
    animation: diceShake 0.3s ease-in-out, diceGlow 1.2s ease-in-out;
}

@keyframes diceShake {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-4px) translateY(-4px) rotateZ(3deg); }
    50% { transform: translateX(4px) translateY(-3px) rotateZ(-3deg); }
    75% { transform: translateX(-3px) translateY(4px) rotateZ(2deg); }
}

@keyframes diceGlow {
    0% { 
        filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
    }
    50% { 
        filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4)) 
                drop-shadow(0 0 30px rgba(59, 130, 246, 0.6))
                drop-shadow(0 0 60px rgba(59, 130, 246, 0.3));
    }
    100% { 
        filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
    }
}

.dice-face {
    position: absolute;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, 
        #ffffff 0%, 
        #f8f9fa 25%, 
        #e9ecef 50%, 
        #dee2e6 75%, 
        #ced4da 100%);
    border: 3px solid #adb5bd;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        inset 2px 0 4px rgba(255, 255, 255, 0.6),
        inset -2px 0 4px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    position: relative;
}

.dice-face::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 8px;
    pointer-events: none;
}

/* 骰子各面的3D位置 */
.dice-face-1 { transform: rotateY(0deg) translateZ(35px); }
.dice-face-2 { transform: rotateY(90deg) translateZ(35px); }
.dice-face-3 { transform: rotateY(180deg) translateZ(35px); }
.dice-face-4 { transform: rotateY(-90deg) translateZ(35px); }
.dice-face-5 { transform: rotateX(90deg) translateZ(35px); }
.dice-face-6 { transform: rotateX(-90deg) translateZ(35px); }

/* 真实的凹陷骰子点 */
.dot {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, 
        #1a1a1a 0%, 
        #2d2d2d 30%, 
        #404040 60%, 
        #1a1a1a 100%);
    border-radius: 50%;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.9),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1),
        inset 1px 0 2px rgba(0, 0, 0, 0.7),
        inset -1px 0 2px rgba(255, 255, 255, 0.05),
        0 1px 2px rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 2;
}

.dot::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    z-index: 3;
}

.dot::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 3px;
    height: 3px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    z-index: 1;
}

/* 骰子点的精确位置 */
/* 1点 - 居中 */
.dice-face-1 .dot.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 2点 - 对角线 */
.dice-face-2 .dot.top-left {
    position: absolute;
    top: 15px;
    left: 15px;
}

.dice-face-2 .dot.bottom-right {
    position: absolute;
    bottom: 15px;
    right: 15px;
}

/* 3点 - 对角线加中心 */
.dice-face-3 .dot.top-left {
    position: absolute;
    top: 12px;
    left: 12px;
}

.dice-face-3 .dot.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dice-face-3 .dot.bottom-right {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

/* 4点 - 四角 */
.dice-face-4 .dot.top-left {
    position: absolute;
    top: 12px;
    left: 12px;
}

.dice-face-4 .dot.top-right {
    position: absolute;
    top: 12px;
    right: 12px;
}

.dice-face-4 .dot.bottom-left {
    position: absolute;
    bottom: 12px;
    left: 12px;
}

.dice-face-4 .dot.bottom-right {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

/* 5点 - 四角加中心 */
.dice-face-5 .dot.top-left {
    position: absolute;
    top: 10px;
    left: 10px;
}

.dice-face-5 .dot.top-right {
    position: absolute;
    top: 10px;
    right: 10px;
}

.dice-face-5 .dot.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dice-face-5 .dot.bottom-left {
    position: absolute;
    bottom: 10px;
    left: 10px;
}

.dice-face-5 .dot.bottom-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* 6点 - 两列三行 */
.dice-face-6 .dot.top-left {
    position: absolute;
    top: 8px;
    left: 15px;
}

.dice-face-6 .dot.top-right {
    position: absolute;
    top: 8px;
    right: 15px;
}

.dice-face-6 .dot.middle-left {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
}

.dice-face-6 .dot.middle-right {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

.dice-face-6 .dot.bottom-left {
    position: absolute;
    bottom: 8px;
    left: 15px;
}

.dice-face-6 .dot.bottom-right {
    position: absolute;
    bottom: 8px;
    right: 15px;
}

/* 骰子阴影 */
.dice-shadow {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: radial-gradient(ellipse, 
        rgba(0, 0, 0, 0.4) 0%, 
        rgba(0, 0, 0, 0.2) 50%, 
        transparent 100%);
    border-radius: 50%;
    filter: blur(3px);
    z-index: -1;
}

/* 暗黑主题下的骰子样式 */
.theme-dark .dice-face {
    background: linear-gradient(135deg, 
        #4a5568 0%, 
        #2d3748 25%, 
        #1a202c 50%, 
        #171923 75%, 
        #0f1419 100%);
    border-color: #2d3748;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.4),
        inset 2px 0 4px rgba(255, 255, 255, 0.1),
        inset -2px 0 4px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.theme-dark .dice-face::before {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
}

.theme-dark .dot {
    background: radial-gradient(circle, 
        #000000 0%, 
        #0a0a0a 30%, 
        #1a1a1a 60%, 
        #000000 100%);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.95),
        inset 0 -1px 2px rgba(255, 255, 255, 0.05),
        inset 1px 0 2px rgba(0, 0, 0, 0.9),
        inset -1px 0 2px rgba(255, 255, 255, 0.02),
        0 1px 2px rgba(255, 255, 255, 0.1);
}

.theme-dark .dot::before {
    background: rgba(255, 255, 255, 0.08);
}

.theme-dark .dot::after {
    background: rgba(0, 0, 0, 0.6);
}

.theme-dark .dice-shadow {
    background: radial-gradient(ellipse, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(0, 0, 0, 0.4) 50%, 
        transparent 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dice-roller {
        bottom: 1rem;
        right: 1rem;
        transform: scale(0.85);
    }
    
    .dice-roller:hover {
        transform: scale(0.95);
    }
    
    .dice-container {
        width: 60px;
        height: 60px;
    }
    
    .dice {
        width: 60px;
        height: 60px;
    }
    
    .dice-face {
        width: 60px;
        height: 60px;
        padding: 8px;
    }
    
    .dice-face-1, .dice-face-2, .dice-face-3, .dice-face-4 { 
        transform: rotateY(var(--rotation, 0deg)) translateZ(30px); 
    }
    .dice-face-5 { transform: rotateX(90deg) translateZ(30px); }
    .dice-face-6 { transform: rotateX(-90deg) translateZ(30px); }
    
    .dot {
        width: 10px;
        height: 10px;
    }
}

/* 底部 */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.about-link,
.home-link,
.nav-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.about-link:hover,
.home-link:hover,
.nav-link:hover {
    color: var(--accent-color-dark);
}

/* 关于页面特殊样式 */
.about-page {
    padding: 3rem 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.about-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-section ul,
.about-section ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.about-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.tech-category h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.version-info {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem 0;
    }
    
    .search-section {
        order: 2;
        width: 100%;
    }
    
    .controls {
        order: 1;
        justify-content: center;
    }
    
    .control-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .control-btn span {
        display: none;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .modal-body {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .book-image-section {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .modal-book-title {
        font-size: 1.5rem;
    }
    
    .dice-roller {
        bottom: 1rem;
        right: 1rem;
        transform: scale(0.8);
    }
    
    .dice-roller:hover {
        transform: scale(0.9);
    }
    
    .about-content h1 {
        font-size: 2rem;
    }
    
    .about-section h2 {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-stack {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.875rem;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.75rem;
    }
    
    .book-info {
        padding: 0.75rem;
    }
    
    .book-title {
        font-size: 0.875rem;
    }
    
    .book-author {
        font-size: 0.8rem;
    }
    
    .book-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 400px) {
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.625rem;
    }
    
    .book-info {
        padding: 0.625rem;
    }
    
    .book-title {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .book-author {
        font-size: 0.75rem;
    }
    
    .book-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
}

@media (max-width: 360px) {
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 0.5rem;
    }
    
    .book-info {
        padding: 0.5rem;
    }
    
    .book-title {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .book-author {
        font-size: 0.7rem;
    }
    
    .book-tag {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
    }
}