/* ========== 全局变量 & 基础重置 ========== */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text2: #999;
  --accent: #ff4470;
  --accent2: #ff6b8a;
  --green: #2ecc71;
  --orange: #f39c12;
  --blue: #3498db;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.4);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; -webkit-tap-highlight-color:transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color:inherit; text-decoration:none; }
button { border:none; background:none; cursor:pointer; font:inherit; color:inherit; }
input, textarea, select { font:inherit; color:inherit; }

/* ========== 顶部栏 ========== */
.top-bar {
  position: sticky; top:0; z-index:100;
  display:flex; align-items:center; gap:8px;
  padding:10px 12px;
  background: var(--bg);
  border-bottom:1px solid var(--border);
}
.top-bar .logo { font-weight:700; font-size:17px; white-space:nowrap; }
.top-bar .top-spacer { flex:1; }

/* ========== 底部导航 ========== */
.bottom-nav {
  position: fixed; bottom:0; left:0; right:0; z-index:100;
  display:flex; justify-content:space-around;
  padding:6px 0 var(--safe-bottom);
  background: var(--surface);
  border-top:1px solid var(--border);
}
.nav-item {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:4px 0; min-width:56px;
  color: var(--text2); font-size:11px; transition: color .2s;
}
.nav-item.active { color: var(--accent); }
.nav-item svg { width:22px; height:22px; }

/* ========== 子页面通用 ========== */
.sub-page {
  display:none; position:fixed; top:0; left:0; width:100%; height:100%;
  background: var(--bg); z-index:200; overflow-y:auto;
  flex-direction:column;
}
.sub-page.open { display:flex; }
.sub-header {
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; background: var(--bg);
  border-bottom:1px solid var(--border);
}
.sub-header-back {
  color: var(--accent); font-size:15px; padding:4px 0;
}
.sub-header-title {
  font-size:16px; font-weight:600; flex:1; text-align:center; margin-right:40px;
}
.sub-body { flex:1; padding:12px 16px; overflow-y:auto; }

/* ========== 分类标签 ========== */
.cat-tabs {
  display:flex; gap:6px; padding:8px 12px;
  overflow-x:auto; scrollbar-width:none;
}
.cat-tabs::-webkit-scrollbar { display:none; }
.cat-tab {
  flex-shrink:0; padding:6px 14px; border-radius:20px;
  font-size:13px; background:var(--surface2); color:var(--text2);
  transition: all .2s; white-space:nowrap;
}
.cat-tab.active { background:var(--accent); color:#fff; }

/* ========== 卡片 ========== */
.feed-card {
  margin:0 12px 12px; border-radius:var(--radius);
  background:var(--surface); overflow:hidden;
}
.feed-card-header {
  display:flex; align-items:center; gap:10px; padding:10px 12px 6px;
  cursor:pointer;
}
.feed-header-arrow { margin-left:auto; color:var(--text2); flex-shrink:0; }
.feed-partner-badge {
  font-size:10px; padding:2px 6px; border-radius:8px;
  background:var(--green); color:#fff; flex-shrink:0;
}
.feed-avatar {
  width:36px; height:36px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:16px; color:#fff; flex-shrink:0;
}
.feed-source { font-size:14px; font-weight:600; }
.feed-source-sub { font-size:12px; color:var(--text2); }
.feed-title { font-size:16px; font-weight:600; line-height:1.4; }
.feed-desc { padding:4px 12px; font-size:13px; color:var(--text2); line-height:1.5; }
.feed-tags { display:flex; gap:6px; padding:6px 12px; flex-wrap:wrap; }
.feed-tag {
  font-size:11px; padding:2px 8px; border-radius:10px;
  background:rgba(255,68,112,.15); color:var(--accent);
}

/* ========== 轮播 ========== */
.feed-carousel {
  position:relative; width:100%; padding-top:56.25%;
  overflow:hidden; background:#111;
}
.feed-carousel img {
  position:absolute; top:0; left:0; width:100%; height:100%;
  object-fit:cover; opacity:0; transition:opacity .5s;
}
.feed-carousel img.active { opacity:1; }

/* ========== 按钮 ========== */
.btn-accent {
  display:block; width:100%; padding:12px;
  background:var(--accent); color:#fff; border:none;
  border-radius:var(--radius-sm); font-size:15px; font-weight:600;
  text-align:center; margin:10px 0;
}

/* ========== Toast ========== */
.toast {
  position:fixed; bottom:100px; left:50%; transform:translateX(-50%);
  padding:10px 20px; border-radius:20px;
  background:var(--surface2); color:var(--text); font-size:13px;
  z-index:999; opacity:0; transition:opacity .3s;
  pointer-events:none;
}
.toast.show { opacity:1; }

/* ========== 模态弹窗 ========== */
.modal-overlay {
  display:none; position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(0,0,0,.7); z-index:300;
  justify-content:center; align-items:center;
}
.modal-overlay.open { display:flex; }
.modal-card {
  width:90%; max-width:380px; padding:20px;
  background:var(--surface); border-radius:var(--radius);
}
