:root {
    --primary-100: #00B0FF;
    --primary-glow: rgba(0, 176, 255, 0.4);
    --text-100: #FFFFFF;
    --text-200: #e0e0e0;
    --bg-100: #05090F;
    --bg-150: #0E1522;
    --bg-200: #161F2E;
    --bg-300: #242F42;
    
    --text80: rgba(255,255,255,0.8);
    --text60: rgba(255,255,255,0.6);
    --text40: rgba(255,255,255,0.3);

    --highlight: #FF8C42; 
    --border-thin: 1px solid rgba(255, 255, 255, 0.06);
    --card-shadow-glow: 0 40px 100px -20px rgba(0, 176, 255, 0.15);
    
    --sidebar-width: 260px;
}

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

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-300); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-100); }

body {
    background-color: var(--bg-100);
    color: var(--text-100);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}
h1 {
    font-size: 46px;
    color:var(--text80);
    font-weight: bold;
    margin:0;
    padding:0;
}
h2 {
    font-size: 36px;
    color:var(--text80);
    font-weight: bold;
    margin:0;
    padding:0;
}
h3 {
    font-size: 28px;
    color:var(--text80);
    font-weight: bold;
    margin:0;
    padding:0;
}
h4 {
    font-size: 22px;
    color:var(--text80);
    font-weight: bold;
    margin:0;
    padding:0;
}
h5 {
    font-size: 18px;
    color: var(--text80);
    font-weight: bold;
    line-height:36px;
    margin:0;
    padding:0;
}
h6 {
    font-size: 12px;
    color: var(--text40);
    font-weight: lighter;
    line-height:22px;
    margin:0;
    padding:0;
}

/* 布局容器 */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* 左侧导航栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-150);
    border-right: var(--border-thin);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.search-wrapper {
    position: relative;
}
.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}
.search-input:focus {
    border-color: var(--primary-100);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(0, 176, 255, 0.1);
}

.nav-tags {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.nav-tag {
    padding: 14px 20px;
    border-radius: 14px;
    color: var(--text60);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
    user-select: none;
}
.nav-tag:hover {
    color: var(--text-100);
    background: rgba(255, 255, 255, 0.03);
}
.nav-tag.active {
    background: rgba(0, 176, 255, 0.1);
    color: var(--primary-100);
    border-color: rgba(0, 176, 255, 0.2);
}

/* 侧边栏底部按钮区域 */
.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 20px;
}
.footer-btns {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.study-btn {
    background: var(--primary-100);
    color: var(--bg-100);
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 20px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.study-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--primary-glow);
}
 .footer-links {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: flex-start;
}
.footer-link-item {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: var(--border-thin);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text60);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}
.footer-link-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-100);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 工具提示文字提示 */
.footer-link-item[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--bg-300);
    color: var(--text-100);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: var(--border-thin);
    z-index: 10;
}
.footer-link-item:hover::before {
    opacity: 1;
    bottom: 115%;
}

.current-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0px 12px;
    /* border-top: var(--border-thin); */
}
.current-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-300);
    border: var(--border-thin);
}
.current-user-info {
    display: flex;
    flex-direction: column;
}
.current-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}
.current-user-status {
    font-size: 0.65rem;
    color: var(--primary-100);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 60px 40px;
    max-width: calc(100vw - var(--sidebar-width));
}

#book-list-container {
    display: grid;
    /* 拉长卡片宽度以适配 4:3 比例 */
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    gap: 32px;
}

/* 书单卡片横向排版 */
.book-card {
    background: var(--bg-150);
    border: var(--border-thin);
    border-radius: 28px;
    display: flex;
    flex-direction: row; 
    overflow: hidden;
    position: relative;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}
.book-card:hover {
    transform: translateY(-10px) scale(1.01);
    border-color: rgba(0, 176, 255, 0.4);
    box-shadow: var(--card-shadow-glow);
}

/* 封面区域：移除 padding 确保撑满，设定 4:3 高宽比 */
.poster-section { 
    width: 280px; 
    flex-shrink: 0; 
    background: var(--bg-200); 
    overflow: hidden; 
    position: relative; 
    display: flex;
    align-items: stretch; 
    aspect-ratio: 4 / 3; /* 封面区域高宽比 4:3 */
}

/* 封面图片：设定 4:3 高宽比，使用 object-fit: cover 撑满区域 */
.poster-image { 
    width: 100%; 
    height: 100%; 
    aspect-ratio: 4 / 3; 
    object-fit: cover; /* 撑满区域，消除侧边空隙 */
    display: block; 
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1); 
    border-radius: 0; 
}

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

.content-section { flex: 1; padding: 32px; display: flex; flex-direction: column; position: relative; }
.info-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.book-name { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -0.02em; padding-right: 60px; }
.domain-badge { display: inline-block; padding: 4px 12px; background: rgba(0, 176, 255, 0.1); color: var(--primary-100); font-size: 0.6rem; border-radius: 100px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; border: 1px solid rgba(0, 176, 255, 0.2); }
.tag-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { font-size: 0.65rem; color: var(--text60); background: rgba(255,255,255,0.05); padding: 4px 12px; border-radius: 6px; font-weight: 600; border: var(--border-thin); }
.book-intro { font-size: 0.9rem; color: var(--text40); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.golden-sentence { margin-bottom: 24px; padding: 20px 0; border-top: var(--border-thin); }
.quote-text { color: var(--text-200); font-size: 1.05rem; font-weight: 500; font-style: italic; line-height: 1.5; opacity: 0.9; }

.audio-btn {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary-100); color: var(--bg-100);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px var(--primary-glow);
}
.audio-btn:hover { transform: scale(1.1); box-shadow: 0 12px 32px var(--primary-glow); }
.audio-btn.playing { background: var(--highlight); box-shadow: 0 8px 24px rgba(255, 140, 66, 0.3); }

.wave-icon { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.wave-bar { width: 3px; background: currentColor; border-radius: 1px; transition: height 0.3s ease; }
.playing .wave-bar { animation: wave-move 0.6s ease-in-out infinite alternate; }
.playing .wave-bar:nth-child(2) { animation-delay: 0.15s; }
.playing .wave-bar:nth-child(3) { animation-delay: 0.3s; }
.playing .wave-bar:nth-child(4) { animation-delay: 0.45s; }
@keyframes wave-move { from { height: 6px; } to { height: 18px; } }

.card-top-action { position: absolute; top: 32px; right: 32px; }
.card-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.creator { display: flex; align-items: center; gap: 12px; }
.creator-avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--bg-300); object-fit: cover; border: var(--border-thin); }
.creator-name { font-size: 0.8rem; color: var(--text60); font-weight: 700; }
.rating-box { font-size: 1.1rem; font-weight: 900; color: var(--highlight); display: flex; align-items: center; gap: 6px; }

/* 详情悬浮面板样式 */
#modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(2, 5, 10, 0.8);
    backdrop-filter: blur(40px) saturate(150%);
    z-index: 1000;
    display: none; 
    opacity: 0;
    transition: all 0.5s ease;
}
#modal-overlay.active { display: block; opacity: 1; }
.modal-container {
    max-width: 1500px; height: 90vh; margin: 5vh auto;
    background: linear-gradient(145deg, var(--bg-150), rgba(14, 21, 34, 0.8));
    border-radius: 40px; border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; overflow: hidden;
    box-shadow: 0 100px 150px -50px rgba(0,0,0,0.8);
}
.modal-left { width: 22%; padding: 50px; border-right: 1px solid rgba(255,255,255,0.05); background: rgba(0,0,0,0.2); }
.btn-favorite {
    margin-top: 30px; width: 100%; padding: 14px; background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; color: #fff;
    font-size: 0.9rem; font-weight: 700; display: flex; align-items: center;
    justify-content: center; gap: 10px; cursor: pointer; transition: all 0.3s;
}
.btn-favorite:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--primary-100); transform: translateY(-2px); }
.btn-favorite.active { background: var(--primary-100); color: #000; border-color: var(--primary-100); }
.modal-middle { width: 53%; padding: 50px; overflow-y: auto; }
.sub-books-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* 调整卡片宽度 */
    gap: 28px; 
    margin-top: 30px; 
}
.file-box {
    height: auto; /* 改为auto，让内容决定高度 */
    background: var(--bg-200); 
    border-radius: 24px;
    position: relative; 
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column; /* 垂直排列 */
    padding-bottom: 15px; /* 底部留白 */
}
.file-box:hover { transform: translateY(-8px); border-color: var(--primary-100); background: var(--bg-300); }
.front-page-pic { 
    width: 100%; 
    aspect-ratio: 2 / 3; /* 2:3比例 */
    overflow: hidden; 
    background: #000;
    border-radius: 16px 16px 0 0; /* 只圆角顶部 */
}
.front-page-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.type-badge-overlay {
    position: absolute; 
    top: 15px; 
    left: 15px; 
    padding: 4px 10px; 
    border-radius: 6px;
    font-size: 0.6rem; 
    font-weight: 900; 
    background: var(--primary-100); 
    color: var(--bg-100); 
    z-index: 2;
}
.file-box h1,
.file-box h5 {
    position: static; /* 改为正常文档流 */
}

.file-box h1 {
    font-size: 2.5rem; 
    font-weight: 900;
    color: rgba(255,255,255,0.04); 
    line-height: 1;
    margin: 15px 20px 5px 20px; /* 在图片下方 */
}

.file-box h5 {
    font-size: 0.95rem; 
    font-weight: 700; 
    color: #fff;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    margin: 0 20px 15px 20px; /* 在序号下方 */
}
.file-box .archive-info-box-actions { 
    position: absolute; 
    top: 15px; 
    right: 15px; /* 移动到右上角 */
    z-index: 3; 
}
.modal-right { width: 25%; padding: 40px; border-left: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; background: rgba(0,0,0,0.1); }
.comments-list { flex: 1; overflow-y: auto; padding-right: 10px; display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.comment-item {
    background: rgba(255,255,255,0.03); padding: 15px; border-radius: 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.comment-header { display: flex; align-items: center; gap: 10px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-300); }
.comment-username { font-size: 0.85rem; font-weight: 700; color: #fff; }
.comment-time { font-size: 0.7rem; color: var(--text40); }
.comment-body { font-size: 0.9rem; color: var(--text80); line-height: 1.4; }
.comment-actions { display: flex; gap: 15px; }
.action-btn { background: none; border: none; color: var(--text40); cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; transition: color 0.2s; }
.action-btn:hover { color: var(--primary-100); }
.comment-input-area { margin-top: 30px; padding: 20px; background: var(--bg-200); border-radius: 24px; border: 1px solid rgba(255,255,255,0.05); }
.comment-input { width: 100%; background: transparent; border: none; color: #fff; resize: none; margin-bottom: 10px; font-size: 0.95rem; font-family: inherit; }
.btn-submit { background: var(--primary-100); color: #000; border: none; padding: 10px 20px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.close-modal {
    position: absolute; top: 30px; right: 40px; width: 50px; height: 50px; background: rgba(255,255,255,0.05);
    border-radius: 15px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.8rem; transition: all 0.3s; z-index: 1100;
}

@media (max-width: 1100px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: var(--border-thin); padding: 20px; }
    .main-content { max-width: 100%; padding: 30px 20px; }
    .modal-container { flex-direction: column; height: 95vh; margin: 2.5vh auto; overflow-y: auto; }
    .modal-left, .modal-middle, .modal-right { width: 100%; border: none; height: auto; }
}