:root {
    --bg: #0c0d0f; --panel: #14171a; --border: #2d3139;
    --text: #ffffff; --muted: #848e9c;
    --win: #0ecb81; --loss: #f6465d; --accent: #f0b90b;
}

/* 全局滚动条美化 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2d3139; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3d424d; }

body { background: var(--bg); color: var(--text); font-family: 'PingFang SC', sans-serif; margin: 0; display: flex; height: 100vh; overflow: hidden; }

/* 登录遮罩 */
#authOverlay { position:fixed; top:0; left:0; width:100%; height:100%; background:var(--bg); z-index:9999; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.auth-box { background:var(--panel); padding:40px; border-radius:12px; border:1px solid var(--border); text-align:center; width:300px; }

/* 侧边栏 */
.sidebar { width: 420px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100%; order: 1; }
.sidebar-section { border-bottom: 1px solid var(--border); padding: 15px; }
.section-title { font-size: 13px; font-weight: bold; color: var(--accent); margin-bottom: 12px; }

/* 年度统计滚动区域 */
.year-scroll-container { 
    max-height: 85px; 
    overflow-y: auto;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.year-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.03);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--border);
}
.year-row.active { border-left-color: var(--accent); background: rgba(240, 185, 11, 0.05); }

/* 主视图 */
.main-view { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; order: 2; }

/* 审计项：样式与性能 - 书名跑马灯核心实现 */
.book-title-wrapper {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    position: relative;
    margin-right: 10px;
    font-size: 14px;
}

/* 当书名过长时触发动画 */
.book-item:hover .book-title-wrapper {
    display: inline-block;
}

.book-item:hover .book-title-wrapper {
    animation: marquee 5s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 兼容性滚动条（审计项保留） */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0b0e11; }
::-webkit-scrollbar-thumb { background: #3b3f47; border-radius: 10px; }

/* 统计栏 */
.stats-bar { display: flex; gap: 20px; background: var(--panel); padding: 15px; border-radius: 8px; border: 1px solid var(--border); }
.stat-item { border-left: 2px solid var(--border); padding-left: 15px; }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-val { font-size: 18px; font-weight: bold; }

/* 日历样式 */
.cal-container { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr) 120px; gap: 2px; background: var(--border); border: 1px solid var(--border); }
.cal-cell { background: var(--bg); min-height: 110px; padding: 10px 0px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.cal-header { width: 100%; padding-left: 8px; box-sizing: border-box; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.cal-val { font-size: 14px; font-weight: bold; text-align: center; flex: 1; display: flex; align-items: center; justify-content: center; }
.cal-sub { font-size: 9px; text-align: center; color: var(--muted); opacity: 0.7; }

/* 灰色 Emoji 样式 */
.vs-emoji { filter: grayscale(70%); opacity: 0.8; font-size: 10px; margin-right: 2px; }
.vs-sep { color:#848e9c; margin: 0 6px; font-weight: normal; }

.cell-win { background: rgba(14, 203, 129, 0.12) !important; }
.cell-win .cal-val { color: var(--win); }
.cell-loss { background: rgba(246, 70, 93, 0.12) !important; }
.cell-loss .cal-val { color: var(--loss); }
.week-total { background: #1c2127 !important; cursor: default; align-items: center; }

/* 其它 */
.log-area { flex: 1; overflow-y: auto; padding: 15px; }
.log-card { background: #1c2127; border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-bottom: 12px; }
#detailsModal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 480px; max-height: 70vh; background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; z-index: 10000; padding: 20px; overflow-y: auto; box-shadow: 0 0 50px #000; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 9999; }
.btn { background: var(--accent); color: #000; border: none; padding: 10px; border-radius: 4px; font-weight: bold; cursor: pointer; width: 100%; }
input { background: #0c0d0f; border: 1px solid var(--border); color: white; padding: 8px; border-radius: 4px; width: 100%; margin-bottom: 8px; box-sizing: border-box; }
