:root { --primary: #00a1d6; --corset: #2c3e50; --bg: #f5f7fa; --panel: #ffffff; --text: #222; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }
body { margin: 0; font-family: -apple-system, system-ui, sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }

/* 基础组件 */
.glass-panel { background: var(--panel); border-radius: 16px; padding: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.input-box { width: 100%; padding: 14px; margin-bottom: 15px; border: 1px solid #e1e4e8; border-radius: 10px; font-size: 15px; background: #fafbfc; transition: 0.2s;}
.input-box:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(0,161,214,0.1); }
.btn-primary { padding: 14px; border: none; border-radius: 25px; background: var(--primary); color: #fff; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 16px;}
.btn-primary:active { transform: scale(0.98); }
.btn-ghost { padding: 12px; border: none; background: transparent; color: #888; font-weight: bold; cursor: pointer; border-radius: 25px;}
.btn-ghost:hover { background: #f0f2f5; }

/* 布局 */
.main-layout { max-width: 1400px; margin: 20px auto; padding: 0 15px; display: grid; grid-template-columns: 240px 1fr 280px; gap: 25px; align-items: start; }
.nav-tabs { display: flex; gap: 25px; margin-bottom: 25px; border-bottom: 2px solid #eee; padding-bottom: 10px;}
.nav-tabs button { border: none; background: none; font-size: 18px; font-weight: bold; cursor: pointer; color: #999; padding: 0 0 5px 0; position: relative; transition: 0.2s;}
.nav-tabs button.active { color: var(--text); }
.nav-tabs button.active::after { content: ''; position: absolute; bottom: -12px; left: 20%; width: 60%; height: 4px; background: var(--primary); border-radius: 4px; }

.tag-list span { display: inline-block; padding: 6px 14px; background: #f4f5f7; border-radius: 20px; font-size: 13px; margin: 4px 4px 4px 0; cursor: pointer; color: #666; transition: 0.2s;}
.tag-list span.active, .tag-list span:hover { background: var(--primary); color: #fff; }

/* 瀑布流 */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.book-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03); cursor: pointer; transition: transform 0.3s, box-shadow 0.3s; }
.book-card:hover { transform: translateY(-6px); box-shadow: 0 12px 25px rgba(0,0,0,0.08); }
.cover-box { height: 230px; background: #eaeff2; overflow: hidden; }
.cover-box img { width: 100%; height: 100%; object-fit: cover; }
.info { padding: 12px; }
.title { font-size: 15px; font-weight: bold; margin-bottom: 5px; color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 42px;}

/* 动态 */
.dynamic-sidebar { height: calc(100vh - 100px); position: sticky; top: 90px; }
.scroll-wrap { height: calc(100% - 40px); overflow-y: auto; scrollbar-width: none; padding-right: 5px;}
.scroll-wrap::-webkit-scrollbar { display: none; }
.dyn-item { padding: 15px; background: #f8f9fa; border-radius: 12px; margin-bottom: 12px; display: flex; gap: 12px; align-items: flex-start;}
.dyn-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid #eee;}

/* 详情页 */
#detail-view { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #fff; z-index: 2000; overflow-y: auto; padding-bottom: 80px; }
.detail-header { background: linear-gradient(180deg, #eef2f7 0%, #fff 100%); padding: 50px 20px 30px; text-align: center; position: relative;}
.close-btn { position: absolute; top: 20px; left: 20px; background: rgba(0,0,0,0.3); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 10;}
.detail-cover { width: 180px; height: 250px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); object-fit: cover; margin-bottom: 20px; }
#d-title { margin: 0 0 10px 0; font-size: 26px; color: #222; }
.detail-meta { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.tag-row span { display: inline-block; padding: 4px 12px; background: #f0f2f5; color: var(--primary); border-radius: 4px; font-size: 13px; margin: 0 8px 8px 0; }
.intro-text { line-height: 1.8; color: #555; background: #fafbfc; padding: 25px; border-radius: 12px; margin: 20px 0; font-size: 15px;}
.action-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); padding: 12px 20px; border-top: 1px solid #eee; display: flex; gap: 15px; justify-content: center; z-index: 2100;}
.action-btn { padding: 15px; border-radius: 30px; font-size: 16px; font-weight: bold; cursor: pointer; border: none; flex: 1; max-width: 250px; display: flex; justify-content: center; align-items: center;}

/* 书评 */
.comment-input { width: 100%; padding: 15px; border: 1px solid #e1e4e8; border-radius: 12px; resize: vertical; min-height: 80px; font-family: inherit; font-size: 15px;}
.comment-item { display: flex; gap: 15px; margin-bottom: 25px; border-bottom: 1px solid #f5f5f5; padding-bottom: 20px; }
.comment-item img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }

/* 阅读器 */
#reader-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #f4f7f9; z-index: 3000; overflow-y: auto; }
.reader-container { max-width: 1000px; margin: 0 auto; display: flex; gap: 25px; padding: 25px; }
.reader-catalog { width: 280px; background: #fff; border-radius: 16px; padding: 20px; height: calc(100vh - 110px); position: sticky; top: 85px; overflow-y: auto;}
.reader-article { flex: 1; background: #fff; padding: 50px; border-radius: 16px; font-size: 19px; line-height: 2; min-height: 80vh; color:#2c3e50;}
.ch-btn { display: block; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; border: 1px solid #f0f2f5; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; transition: 0.2s;}
.ch-btn.active, .ch-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0f7ff; font-weight: bold; }

/* 模态弹窗 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 4000; justify-content: center; align-items: center; }
.modal-content { background: #fff; border-radius: 20px; padding: 30px; width: 90%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); max-height: 85vh; overflow-y: auto; }
.history-item { padding: 12px 0; border-bottom: 1px dashed #eee; font-size: 14px; display: flex; justify-content: space-between; cursor: pointer; color: #666;}
.history-item:hover { color: var(--primary); }

.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px); background: #333; color: #fff; padding: 12px 25px; border-radius: 30px; font-size: 14px; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 9999;}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

header { height: 70px; }
.logo-box { display: flex; align-items: center; gap: 12px; height: 100%; cursor: pointer; }
.logo-box img { max-height: 50px; width: auto; object-fit: contain; }
.logo-box span { font-size: 24px; font-weight: 800; color: #2c3e50; }

.user-info-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 20px; background: #f8f9fa; border: 1px solid #eee; cursor: pointer;}
.user-info-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

@media (max-width: 1000px) {
    .main-layout { grid-template-columns: 1fr; }
    .sidebar, .dynamic-sidebar { display: none; }
    .reader-container { flex-direction: column; padding: 15px;}
    .reader-catalog { width: 100%; position: static; height: auto; }
    .reader-article { padding: 25px 15px; }
}