/* Structural compatibility layer. All color and spacing tokens live in tokens.css. */

/* Loading bar */
.loading-bar { position:fixed; top:0; left:0; height:3px; background:var(--c-primary); z-index:9999; width:0; transition:width .4s; border-radius:0 2px 2px 0; }
.loading-bar.active { width:40%; animation:loadingPulse 1.2s ease-in-out infinite; }
@keyframes loadingPulse { 0% { width:0; left:0; } 50% { width:60%; left:0; } 100% { width:0; left:100%; } }

/* Reset & Base */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { height:100%; }
body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans SC","PingFang SC",sans-serif; background:var(--bg-page); color:var(--text-primary); height:100vh; height:100dvh; overflow:hidden; display:flex; flex-direction:column; -webkit-font-smoothing:antialiased; min-height:100dvh; }
/* 移动端兜底：若内部滚动区失效，允许整页滚动 */
@media (max-width: 768px) {
  body { overflow-y:auto; }
  .pages { min-height: calc(100dvh - var(--header-h) - var(--tab-h)); }
}

/* Header */
.app-header { height:var(--header-h); padding:0 20px; display:flex; align-items:center; justify-content:space-between; background:var(--bg-page); flex-shrink:0; border-bottom:1px solid var(--border-color); }
.app-header-left { display:flex; align-items:center; gap:8px; }
.app-logo { width:28px; height:28px; background:var(--c-primary); border-radius:8px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:15px; font-weight:700; }
.app-title { font-size:17px; font-weight:700; letter-spacing:-.3px; }
.app-header-right { display:flex; align-items:center; gap:4px; }
.header-btn { width:34px; height:34px; border:none; border-radius:8px; background:transparent; color:var(--text-secondary); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:18px; transition:background .15s; }
.header-btn:hover { background:var(--warm-100); }

/* Pages */
.pages { flex:1; position:relative; overflow:hidden; }
.page { display:none; position:absolute; inset:0; overflow-y:auto; padding:16px 16px 24px; scroll-behavior:smooth; -webkit-overflow-scrolling:touch; }
.page.active { display:block; }
.page::-webkit-scrollbar { width:4px; }
.page::-webkit-scrollbar-thumb { background:var(--warm-200); border-radius:2px; }

/* Tab Bar */
.tab-bar { height:var(--tab-h); min-height:var(--tab-h); display:flex; align-items:stretch; background:var(--white); border-top:1px solid var(--border-color); flex-shrink:0; padding-bottom:env(safe-area-inset-bottom,0); }
.tab-item { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border:none; background:transparent; color:var(--text-tertiary); cursor:pointer; transition:color .15s; padding:6px 0; position:relative; -webkit-tap-highlight-color:transparent; min-height:44px; }
.tab-item .tab-icon { font-size:20px; line-height:1; }
.tab-item .tab-label { font-size:10px; font-weight:500; letter-spacing:.3px; }
.tab-item.active { color:var(--c-primary); }
.tab-item.active::before { content:""; position:absolute; top:0; left:50%; transform:translateX(-50%); width:20px; height:2.5px; border-radius:0 0 3px 3px; background:var(--c-primary); }

/* Shared */
.card { background:var(--bg-card); border-radius:var(--br); padding:20px; box-shadow:var(--shadow-sm); border:1px solid var(--border-color); }
.card-title { font-size:15px; font-weight:600; }
.card-subtitle { font-size:12px; color:var(--text-secondary); }
.section-title { font-size:13px; font-weight:600; color:var(--text-secondary); margin:20px 0 10px 4px; letter-spacing:.3px; }
.skeleton { background:linear-gradient(90deg,var(--warm-100) 25%,var(--warm-200) 50%,var(--warm-100) 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:8px; }
@keyframes shimmer { 0% { background-position:200% 0; } 100% { background-position:-200% 0; } }
.empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; text-align:center; }
.empty-state .empty-icon { font-size:36px; margin-bottom:12px; opacity:.4; }
.empty-state .empty-title { font-size:16px; font-weight:600; margin-bottom:4px; }
.empty-state .empty-desc { font-size:13px; color:var(--text-secondary); line-height:1.5; }

