*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22263a;
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --border: #2d3148;
  --hot: #f59e0b;
  --radius: 14px;
  --header-h: 80px;
  --sidebar-w: 220px;
  --footer-h: 37px;
  --footer-bg: #12141b;
}

/* 油画扁平风 - 清爽浅色主题 */
body.theme-pastel {
  --bg: #faf7f4;
  --bg2: #ffffff;
  --bg3: #f0ebe4;
  --accent: #e07a8f;
  --accent2: #c45c7a;
  --text: #2d2320;
  --text2: #8a7570;
  --border: #e8ddd8;
  --hot: #e8935a;
  --footer-bg: #faf6f2;
}
body.theme-pastel .search-btn { background: var(--accent); }
body.theme-pastel .nav-btn.primary { background: var(--accent); border-color: var(--accent); }
body.theme-pastel .cat-btn.active { color: var(--accent2); }
body.theme-pastel .cat-btn.active span.cat-label { background: rgba(224,122,143,.12); }
body.theme-pastel .section-title { border-left-color: var(--accent); }
body.theme-pastel .card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(224,122,143,.15); }

body { background: var(--bg); color: var(--text); font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; min-height: 100vh; }

/* ── Header ── */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--bg); border-bottom: none; height: var(--header-h); }
.header-inner { height: 100%; display: grid; grid-template-columns: var(--sidebar-w) 1fr auto; align-items: center; position: relative; }

.logo { display: flex; align-items: center; gap: 12px; white-space: nowrap; flex-shrink: 0; padding-left: 16px; }
.logo-icon { font-size: 32px; }
.logo-text-wrap { display: flex; flex-direction: column; gap: 5px; }
.logo-title { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1; }
.logo-title em { font-style: normal; color: var(--accent2); }
.logo-sub { font-size: 11px; color: var(--text2); line-height: 1; }

.search-box { width: 90%; max-width: 800px; display: flex; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; height: 44px; justify-self: center; }
.search-box input { flex: 1; background: none; border: none; outline: none; padding: 0 16px; color: var(--text); font-size: 14px; }
.search-box input::placeholder { color: var(--text2); }
.search-btn { background: var(--accent); border: none; padding: 0 20px; cursor: pointer; font-size: 13px; color: #fff; font-weight: 600; transition: background .2s; white-space: nowrap; }
.search-btn:hover { background: var(--accent2); }

.header-nav { display: flex; gap: 10px; padding-right: 24px; }
.nav-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .2s; white-space: nowrap; }
.nav-btn:hover { border-color: var(--accent); color: var(--text); }
.nav-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.nav-btn.primary:hover { background: var(--accent2); border-color: var(--accent2); }

/* ── Page body ── */
.page-body { margin-top: var(--header-h); min-height: calc(100vh - var(--header-h)); }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 80; overflow-y: auto; background: var(--bg); border-right: none; display: flex; flex-direction: column; padding: 16px 0 calc(16px + var(--footer-h)); }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-title { font-size: 11px; font-weight: 700; color: var(--text2); letter-spacing: .08em; text-transform: uppercase; padding: 0 16px 10px; }
.sidebar nav { flex: 1; }
.cat-btn { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; color: var(--text2); padding: 9px 10px 9px 16px; cursor: pointer; font-size: 15px; text-align: left; transition: color .18s, background-color .18s; overflow: hidden; }
.cat-btn:hover { color: var(--text); }
.cat-btn::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--accent2); opacity: 0; transition: opacity .12s ease; }
.cat-btn.active::before { opacity: 1; }
.cat-btn.active { color: var(--accent2); font-weight: 600; }
.cat-btn.active span.cat-label { background: rgba(108,99,255,.18); border-radius: 10px; padding: 6px 14px 6px 10px; display: block; width: 100%; }
.sidebar-footer { padding: 16px; font-size: 12px; color: var(--text2); border-top: 1px solid rgba(255,255,255,.06); margin-top: auto; }
.sidebar-footer strong { color: var(--accent2); }

/* ── Main content ── */
.main { margin-left: var(--sidebar-w); padding: 24px 28px 48px; min-width: 0; }
.section { margin-bottom: 36px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px; padding-left: 10px; border-left: 3px solid var(--accent); display: flex; align-items: center; gap: 8px; }
.section-count { color: var(--text2); font-weight: 400; font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }

/* ── Card ── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all .22s; position: relative; display: flex; flex-direction: column; gap: 8px; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(108,99,255,.18); }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--bg3); flex-shrink: 0; }
.card-icon-fallback { width: 36px; height: 36px; border-radius: 8px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.card-region { font-size: 11px; color: var(--text2); background: var(--bg3); padding: 1px 6px; border-radius: 4px; }
.card-desc { font-size: 12px; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card-stars { font-size: 11px; color: var(--hot); }
.card-link { font-size: 11px; color: var(--accent2); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.hot-badge { position: absolute; top: 10px; right: 10px; background: linear-gradient(135deg,#f59e0b,#ef4444); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }

/* ── No results ── */
.no-results { text-align: center; padding: 80px 0; color: var(--text2); font-size: 15px; }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; padding: 32px; max-width: 440px; width: 90%; position: relative; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--text2); font-size: 18px; cursor: pointer; }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal p { color: var(--text2); font-size: 14px; line-height: 1.8; }
.modal input, .modal textarea { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 14px; outline: none; margin-bottom: 10px; }
.modal textarea { resize: vertical; min-height: 80px; }
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal .submit-btn { width: 100%; background: var(--accent); border: none; color: #fff; padding: 11px; border-radius: 8px; font-size: 14px; cursor: pointer; margin-top: 4px; }
.modal .submit-btn:hover { background: var(--accent2); }
.qr-placeholder { width: 160px; height: 160px; background: var(--bg3); border-radius: 12px; margin: 16px auto; display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 13px; }

/* ── Site footer ── */
.site-footer { position: relative; z-index: 90; width: 100%; display: flex; justify-content: center; align-items: center; gap: 4px; min-height: var(--footer-h); padding: 6px 16px; color: var(--text2); font-size: 12px; background: var(--footer-bg); }
.site-footer a { color: var(--text2); text-decoration: none; }
.site-footer a:hover { color: var(--accent2); }
.site-footer span { margin: 0 4px; color: var(--border); }
.beian-icon { width: 16px; height: 16px; opacity: .8; }

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 160px; }
  .logo-sub { display: none; }
  .header-nav .nav-btn:not(.primary) { display: none; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
/* 每日精读 */
.news-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.news-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; gap: 6px; }
.news-card:hover { border-color: var(--accent); transform: translateX(2px); }
.news-card.news-read { opacity: .6; }
.news-card.news-ignored { opacity: .35; filter: grayscale(.4); }
.news-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; }
.news-summary { font-size: 12px; color: var(--text2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.news-meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 6px; }
.news-badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.news-badge-read { color: #4ade80; background: rgba(74,222,128,.15); }
.news-badge-ignored { color: var(--text2); background: var(--bg3); }
body.theme-pastel .news-badge-read { color: #15803d; background: rgba(21,128,61,.1); }
.news-ignore-btn { margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text2); font-size: 11px; padding: 2px 8px; cursor: pointer; flex-shrink: 0; }
.news-ignore-btn:hover { border-color: var(--accent2); color: var(--accent2); }
