/* ===== 布局：全局 / 顶栏 / 侧边栏 / 主区域 / 标签栏 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif; background: transparent; color: var(--text); }

/* 背景轮播 */
.global-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.global-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.5s ease-in-out; }
.global-bg img.active { opacity: 1; }
.global-bg::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .25); }

/* 顶栏 */
.topbar { height: var(--topbar-h); background: linear-gradient(135deg, rgba(79, 110, 247, .92), rgba(58, 86, 212, .92)); backdrop-filter: blur(12px); color: #fff; padding: 0 20px; display: flex; align-items: center; gap: 16px; flex-shrink: 0; z-index: 20; }
.topbar .logo { font-size: 18px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.topbar .user-info { font-size: 12px; opacity: .8; margin-left: auto; white-space: nowrap; }
.topbar .cc-btn { display: none; align-items: center; gap: 6px; background: rgba(255, 255, 255, .15); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: #fff; border: none; }
.topbar .cc-btn:active { background: rgba(255, 255, 255, .25); }
.topbar .cc-btn .arrow { font-size: 10px; opacity: .7; }

/* 退出登录按钮 */
.logout-btn { display: flex; align-items: center; gap: 5px; padding: 7px 16px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .9); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .25s ease; white-space: nowrap; margin-left: auto; backdrop-filter: blur(4px); }
.logout-btn:hover { background: rgba(255, 77, 79, .6); border-color: rgba(255, 77, 79, .8); color: #fff; box-shadow: 0 2px 8px rgba(255, 77, 79, .3); }
.logout-btn:active { background: rgba(255, 77, 79, .8); transform: scale(.96); }

/* 侧边栏 */
.sidebar { width: var(--sidebar-w); height: calc(100vh - var(--topbar-h)); overflow-y: auto; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-right: 1px solid var(--border); flex-shrink: 0; z-index: 10; transition: width .3s, margin-left .3s; overflow-x: hidden; }
.sidebar.collapsed { width: 0; border-right: none; overflow: hidden; }
.sidebar-toggle { width: 28px; height: 28px; border-radius: 6px; background: rgba(255, 255, 255, .15); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.sidebar-toggle:active { background: rgba(255, 255, 255, .25); }
.sidebar-hd { padding: 16px 20px 12px; font-weight: 700; font-size: 15px; color: var(--text); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); z-index: 1; display: flex; align-items: center; gap: 6px; }
.sidebar-hd::before { content: ''; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }

/* 主区域 */
.layout { display: flex; height: calc(100vh - var(--topbar-h)); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.main-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px; position: relative; z-index: 1; }

/* 桌面标签栏 */
.desktop-tabs { display: flex; gap: 4px; padding: 0 20px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; }
.desktop-tabs .dtab { padding: 12px 20px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .2s; white-space: nowrap; }
.desktop-tabs .dtab:hover { color: var(--primary); }
.desktop-tabs .dtab.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }

/* 底部标签栏 */
.bottom-tabs { display: none; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-top: 1px solid var(--border); flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom); }
.bottom-tabs .btab { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0 8px; cursor: pointer; transition: color .2s; color: var(--text3); font-size: 10px; position: relative; }
.bottom-tabs .btab svg { width: 22px; height: 22px; margin-bottom: 2px; fill: currentColor; }
.bottom-tabs .btab.active { color: var(--primary); }
.bottom-tabs .btab.active::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 20px; height: 2px; background: var(--primary); border-radius: 1px; }