:root {
  --bg-app: #f1f5f9;
  --bg-card: rgba(255,255,255,0.85);
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-nav: rgba(255,255,255,0.80);
  --border-color: rgba(226,232,240,0.6);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
[data-theme="dark"] {
  --bg-app: #0b1120;
  --bg-card: rgba(30,41,59,0.85);
  --bg-card-hover: rgba(30,41,59,0.95);
  --bg-nav: rgba(15,23,42,0.80);
  --border-color: rgba(51,65,85,0.6);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-light: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
}
* { margin:0; padding:0; box-sizing:border-box; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 1024px) {
  html, body {
    overflow: auto !important;
    height: auto !important;
    min-height: 100vh;
  }
}
a { text-decoration:none; color:inherit; }
ul { list-style:none; }
button { font-family: inherit; }
::-webkit-scrollbar { width:4px; height:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--text-muted); border-radius:8px; }

/* ============ NAVBAR ============ */
.navbar {
  position:fixed;
  top:0; left:0; right:0;
  z-index:1000;
  background: var(--bg-nav);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom:1px solid var(--border-color);
  padding: 0 max(1.5rem, var(--safe-right)) 0 max(1.5rem, var(--safe-left));
  padding-top: var(--safe-top);
  height:calc(64px + var(--safe-top));
  display:flex; align-items:center; justify-content:space-between;
  gap: 1.5rem;
}
.nav-brand { font-weight:700; font-size:1.2rem; display:flex; align-items:center; gap:0.4rem; flex-shrink:0; }
.nav-brand i { color:var(--accent); font-size:1.2rem; }
.nav-brand span { font-weight:400; color:var(--text-muted); }
.nav-tabs { display: flex; gap: 0.3rem; align-items: center; flex: 1; }
.nav-tab {
  padding: 0.4rem 0.9rem; border-radius: 30px;
  font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
  transition: all 0.15s ease;
}
.nav-tab:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-tab.active { background: var(--accent); color: #fff; }
.nav-actions { display:flex; align-items:center; gap:0.5rem; }
.search-wrap { position: relative; }
.search-wrap input {
  border:1px solid var(--border-color); background: var(--bg-card);
  padding: 0.35rem 0.8rem 0.35rem 2rem;
  border-radius:40px; font-size:0.8rem; width:180px;
  outline:none; color: var(--text-primary); transition: all var(--transition);
}
.search-wrap input:focus { width:220px; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.search-wrap i { position:absolute; left:0.7rem; top:50%; transform: translateY(-50%); color: var(--text-muted); font-size:0.8rem; }
.theme-toggle {
  background: var(--bg-card); border:1px solid var(--border-color);
  border-radius: 40px; width: 34px; height: 34px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; color: var(--text-secondary); transition: all var(--transition);
}
.theme-toggle:hover { background: var(--accent-light); color: var(--accent); }
.auth-user-info { display:flex; align-items:center; gap:0.4rem; }
.nav-avatar {
  width: 34px; height: 34px; border-radius:50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:600; cursor:pointer; font-size:0.85rem;
  transition: transform 0.2s;
}
.nav-avatar:hover { transform: scale(1.05); }
.username { font-size:0.8rem; font-weight:500; max-width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.logout-btn { background:none; border:none; color: var(--text-muted); font-size:0.7rem; cursor:pointer; padding:0.1rem 0.4rem; border-radius:6px; }
.logout-btn:hover { color:#ef4444; background:#fef2f2; }

/* ============ 语言切换 ============ */
.lang-toggle-group {
  display: flex;
  background: var(--bg-card);
  border-radius: 40px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  flex-shrink: 0;
}
.lang-toggle-group button {
  background: transparent;
  border: none;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.lang-toggle-group button.active { background: var(--accent); color: #fff; }
.lang-toggle-group button:not(.active):hover { color: var(--text-primary); background: rgba(0,0,0,0.05); }

/* ============ APP CONTAINER ============ */
.app-container {
  height: calc(100vh - 94px - var(--safe-top));
  margin-top: calc(64px + var(--safe-top));
  padding: 1rem max(1.5rem, var(--safe-right)) 1rem max(1.5rem, var(--safe-left));
  display: grid;
  grid-template-columns: 180px 1fr 260px;
  gap: 1.25rem;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .app-container {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 50px - var(--safe-top));
    margin-top: calc(50px + var(--safe-top));
    padding: 0.4rem !important;
    gap: 0.4rem !important;
    overflow: visible !important;
  }
}

.sidebar-categories, .hot-section, .category-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm), var(--shadow-md);
  border: 1px solid var(--border-color);
}
.sidebar-categories {
  max-height: 100%;
  overflow-y: auto;
  min-height: 0;
}
.cat-label {
  font-size:0.65rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); padding: 0 0.6rem 0.5rem; font-weight:600;
}
.cat-item {
  display:flex; align-items:center; gap:0.5rem;
  padding:0.5rem 0.8rem; border-radius: var(--radius-sm);
  cursor:pointer; font-weight:500; font-size:0.85rem;
  color: var(--text-secondary); transition: all 0.15s;
  margin-bottom: 2px;
}
.cat-item:hover { background: var(--bg-app); color: var(--text-primary); }
.cat-item.active { background: var(--accent-light); color: var(--accent); font-weight:600; }
.cat-item i { width:18px; text-align:center; font-size:0.85rem; }

/* ============ MAIN CONTENT ============ */
.main-content { display:flex; flex-direction:column; gap:1rem; min-height: 0; height: 100%; }
.category-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.cat-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:0.4rem; margin-bottom: 0.5rem; flex-shrink: 0; }
.cat-header h3 { font-size:1.05rem; display:flex; align-items:center; gap:0.4rem; }
.cat-header h3 i { color: var(--accent); }
.source-info { font-size:0.7rem; color: var(--text-muted); background: var(--bg-app); padding:0.2rem 0.7rem; border-radius:40px; }
.sub-categories {
  display:flex; flex-wrap:wrap; gap:0.3rem;
  border-bottom:1px solid var(--border-color);
  padding-bottom:0.4rem; margin-bottom:0.5rem;
  align-items: center;
  flex-shrink: 0;
}
.sub-tag {
  padding:0.15rem 0.7rem; border-radius:30px; font-size:0.7rem;
  background: var(--bg-app); color: var(--text-secondary);
  cursor:pointer; transition: all 0.15s;
  display:inline-flex; align-items:center; gap:0.25rem;
}
.sub-tag:hover { background: var(--border-color); }
.sub-tag.active { background: var(--accent); color:#fff; }
.status-dot { display:inline-block; width:6px; height:6px; border-radius:50%; }
.status-dot.ok { background:#22c55e; }
.status-dot.fail { background:#ef4444; }
.calendar-toggle-btn {
  padding:0.15rem 0.7rem; border-radius:30px; font-size:0.7rem;
  background: var(--accent-light); color: var(--accent);
  cursor:pointer; border:1px solid var(--accent);
  display:inline-flex; align-items:center; gap:0.3rem;
  margin-left: auto; font-weight: 500;
}
.calendar-toggle-btn:hover { background: var(--accent); color:#fff; }
.calendar-toggle-btn.active { background: var(--accent); color:#fff; }
.calendar-toggle-btn .badge {
  background: #22c55e; color:#fff; font-size:0.5rem;
  border-radius: 50%; padding: 0 5px; min-width: 16px;
  text-align: center; line-height: 16px;
}

/* ============ CALENDAR ============ */
.calendar-wrapper {
  overflow: hidden;
  max-height: 0; opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  flex-shrink: 0;
}
.calendar-wrapper.visible { max-height: 460px; opacity: 1; margin-bottom: 0.6rem; }
.calendar-container { background: var(--bg-app); border-radius: var(--radius-md); padding: 0.8rem 1rem; }
.calendar-nav { display:flex; justify-content: space-between; align-items:center; margin-bottom: 0.5rem; }
.calendar-nav .month-year { font-weight: 600; font-size: 0.9rem; }
.calendar-nav .nav-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 6px;
}
.calendar-nav .nav-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.calendar-nav .view-btns { display: flex; gap: 0.2rem; }
.calendar-nav .view-btns button {
  background: none; border: 1px solid var(--border-color);
  border-radius: 4px; padding: 0.1rem 0.5rem; font-size: 0.55rem;
  cursor: pointer; color: var(--text-muted);
}
.calendar-nav .view-btns button.active { background: var(--accent); color:#fff; border-color: var(--accent); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-grid .weekday { text-align: center; font-size:0.55rem; color: var(--text-muted); font-weight:600; padding: 0.15rem 0; }
.calendar-grid .day {
  text-align: center; padding: 0.25rem 0; border-radius: 6px;
  cursor: pointer; font-size: 0.7rem; color: var(--text-secondary);
  position: relative; min-height: 28px; display:flex;
  align-items:center; justify-content:center;
}
.calendar-grid .day:hover { background: var(--bg-card); }
.calendar-grid .day.other-month { opacity: 0.4; }
.calendar-grid .day.today { background: var(--accent-light); color: var(--accent); font-weight: 700; }
.calendar-grid .day.selected { background: var(--accent); color:#fff; font-weight: 700; }
.calendar-grid .day.has-article::after {
  content: ''; position: absolute; bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: #22c55e;
}
.calendar-filter-info {
  font-size:0.65rem; color: var(--text-muted);
  margin-top: 0.4rem; padding-top: 0.4rem;
  border-top: 1px solid var(--border-color);
  display:flex; justify-content: center; align-items: center; gap: 0.8rem;
}
.calendar-filter-info .clear-filter { color: var(--accent); cursor: pointer; font-weight: 600; }
.calendar-filter-info .clear-filter:hover { text-decoration: underline; }

/* ============ ARTICLE LIST ============ */
.article-list-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#articleList {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.skeleton-card { display: flex; gap: 0.8rem; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--border-color); }
.skeleton-card .skeleton-img { width: 100px; height: 68px; border-radius: 8px; background: var(--bg-app); animation: pulse 1.5s ease-in-out infinite; flex-shrink: 0; }
.skeleton-card .skeleton-content { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-card .skeleton-line { height: 12px; border-radius: 6px; background: var(--bg-app); animation: pulse 1.5s ease-in-out infinite; }
.skeleton-card .skeleton-line:nth-child(2) { width: 80%; }
.skeleton-card .skeleton-line:nth-child(3) { width: 40%; height: 8px; }
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 0.8; } }

.article-card {
  display: flex; gap: 0.8rem;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  align-items: flex-start; cursor: pointer;
  border-radius: 8px; position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.article-card:hover { background: var(--bg-card-hover); box-shadow: var(--shadow-sm); }
.article-card:last-child { border-bottom: none; }
.article-card .card-img-wrap {
  flex-shrink: 0; width: 100px; height: 68px;
  border-radius: 8px; overflow: hidden;
  background: var(--bg-app);
  display: flex; align-items: center; justify-content: center;
}
.article-card .card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.article-card .card-content { flex: 1; min-width: 0; }
.article-card .card-title {
  font-weight: 600; font-size: 0.9rem; line-height: 1.4;
  margin-bottom: 2px; color: var(--text-primary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .card-desc {
  font-size: 0.75rem; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 2px;
}
.article-card .card-meta {
  font-size: 0.65rem; color: var(--text-muted);
  display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center;
  overflow: visible;
}
.article-card .card-meta a {
  color: var(--accent); cursor: pointer;
  display: inline-flex; align-items: center;
}
.article-card .card-meta a:hover { text-decoration: underline; }
.score-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.55rem; font-weight: 700;
  padding: 0.05rem 0.4rem 0.05rem 0.3rem;
  border-radius: 30px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; flex-shrink: 0;
}
.translate-btn {
  background: none; border: 1px solid var(--border-color);
  border-radius: 30px; padding: 0.05rem 0.5rem;
  font-size: 0.55rem; font-weight: 500; cursor: pointer;
  color: var(--text-secondary); transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 0.15rem;
  touch-action: manipulation; flex-shrink: 0;
}
.translate-btn:hover { background: var(--bg-app); border-color: var(--text-muted); }
.translate-btn.translated { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.translate-btn.loading { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

#loadMoreContainer {
  flex-shrink: 0;
  text-align: center;
  padding: 0.6rem 0 0.3rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.3rem;
}
.load-more-btn {
  background: var(--bg-app); border: 1px solid var(--border-color);
  padding: 0.4rem 1.5rem; border-radius: 40px;
  cursor: pointer; font-weight: 500; font-size: 0.8rem;
  color: var(--accent); transition: all 0.2s;
}
.load-more-btn:hover { background: var(--accent); color:#fff; border-color: var(--accent); }
.load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.load-more-end { color: var(--text-muted); font-size: 0.7rem; padding: 0.2rem 0; }

/* ============ SIDEBAR RIGHT（仅热门文章，独占高度） ============ */
.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.hot-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.hot-section h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
#hotList {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.hot-item {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.hot-item:hover { background: var(--bg-app); }
.hot-item:last-child { border-bottom: none; }
.hot-item .htitle {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-item .hviews {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============ MODAL ============ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 2000; justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg-card); backdrop-filter: blur(16px);
  max-width: 700px; width: 94%;
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem 1.25rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
  max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--border-color);
  position: relative;
  animation: modalFadeIn 0.25s ease;
}
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.96) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 0.8rem; right: 1.2rem; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--text-muted); }
.modal-close:hover { color: var(--text-primary); }
.modal-title { font-size: 1.3rem; font-weight: 700; line-height: 1.4; margin-bottom: 0.4rem; padding-right: 2rem; }
.modal-source-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
.modal-source-line .source-name { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.modal-source-line .source-time { font-size: 0.75rem; color: var(--text-muted); }
.modal-body { font-size: 0.9rem; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; margin-bottom: 1rem; max-height: 50vh; overflow-y: auto; user-select: none; }
.modal-footer { display: flex; gap: 0.5rem; flex-wrap: wrap; border-top: 1px solid var(--border-color); padding-top: 0.8rem; }
.btn {
  padding: 0.35rem 1rem; border-radius: 40px;
  font-weight: 500; font-size: 0.8rem;
  cursor: pointer; border: 1px solid var(--border-color);
  background: var(--bg-app); color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.btn:hover { background: var(--border-color); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.copyright-tip { width: 100%; text-align: center; font-size: 0.55rem; color: var(--text-muted); padding-top: 0.4rem; border-top: 1px solid var(--border-color); margin-top: 0.4rem; }

/* ============ AUTH ============ */
.auth-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 3000; justify-content: center; align-items: center;
}
.auth-overlay.active { display: flex; }
.auth-box {
  background: var(--bg-card); backdrop-filter: blur(16px);
  max-width: 400px; width: 92%;
  border-radius: var(--radius-md);
  padding: 1.5rem; position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
  border: 1px solid var(--border-color);
}
.auth-close { position: absolute; top: 0.8rem; right: 1.2rem; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--text-muted); }
.auth-box h2 { margin-bottom: 1rem; font-size: 1.3rem; }
.auth-field input {
  width: 100%; padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-color); background: var(--bg-app);
  border-radius: var(--radius-sm); margin-bottom: 0.7rem;
  font-size: 0.9rem; outline: none; color: var(--text-primary);
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.auth-field .captcha-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.7rem; }
.auth-field .captcha-row input { flex: 1; margin-bottom: 0; }
.auth-field .captcha-row img { height: 44px; border-radius: 6px; border: 1px solid var(--border-color); cursor: pointer; }
.auth-field .captcha-row button { background: var(--bg-app); border: 1px solid var(--border-color); border-radius: 6px; padding: 0 10px; cursor: pointer; height: 44px; color: var(--text-secondary); }
#authSubmit {
  width: 100%; padding: 0.6rem; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 1rem; cursor: pointer;
}
#authSubmit:hover { background: #1d4ed8; }
#authError { color: #ef4444; font-size: 0.8rem; margin-bottom: 0.5rem; }
.auth-toggle { text-align: center; margin-top: 0.8rem; font-size: 0.8rem; color: var(--text-muted); }
.auth-toggle a { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* ============ 内置浏览器 ============ */
.browser-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 5000;
  justify-content: center;
  align-items: center;
}
.browser-overlay.active { display: flex; }
.browser-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  width: 96%;
  max-width: 900px;
  height: 92vh;
  max-height: 800px;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}
.browser-toolbar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: var(--bg-nav);
  flex-wrap: wrap;
}
.browser-btn {
  background: none; border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 6px; cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem; transition: all 0.15s;
  min-height: 32px;
}
.browser-btn:hover { background: var(--border-color); color: var(--text-primary); }
.browser-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.browser-translate-btn {
  background: var(--accent); color: #fff;
  border-radius: 20px; padding: 0.25rem 1rem;
  font-weight: 500;
}
.browser-translate-btn:hover { background: #1d4ed8; color: #fff; }
.browser-translate-btn.translated { background: #22c55e; }
.browser-translate-btn.translated:hover { background: #16a34a; }
.browser-url {
  flex: 1; border: 1px solid var(--border-color);
  background: var(--bg-app);
  border-radius: 20px;
  padding: 0.25rem 0.8rem;
  font-size: 0.75rem; color: var(--text-primary);
  outline: none; min-width: 60px; min-height: 32px;
}
.browser-content {
  flex: 1; overflow-y: auto;
  padding: 1.5rem;
  -webkit-overflow-scrolling: touch;
}
.browser-loading, .browser-error {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); gap: 1rem;
}
.browser-loading i { font-size: 2.5rem; color: var(--accent); }
.browser-error i { font-size: 3rem; color: #ef4444; }
.browser-error p { font-size: 1rem; }
.browser-retry-btn {
  background: var(--accent); color: #fff;
  border: none; padding: 0.5rem 2rem;
  border-radius: 40px; cursor: pointer;
  font-size: 0.9rem;
}
.browser-retry-btn:hover { background: #1d4ed8; }
.browser-page-title {
  font-size: 1.3rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.8rem; line-height: 1.4;
}
.browser-page-body, .browser-translated-body {
  font-size: 0.9rem; line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word;
  user-select: none;
  max-height: 55vh; overflow-y: auto;
}
.browser-translated-body {
  border-top: 3px solid var(--accent);
  padding: 1.2rem; margin-top: 1rem;
  background: var(--accent-light);
  border-radius: 10px;
  color: var(--text-primary);
}
.browser-translated-body::before {
  content: '📖 中文翻译';
  display: block; font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.6rem; font-size: 0.9rem;
}
.browser-copyright {
  text-align: center; padding: 0.8rem;
  font-size: 0.6rem; color: var(--text-muted);
  border-top: 2px solid var(--border-color);
  margin-top: 1.2rem; opacity: 0.7;
  background: var(--bg-app); border-radius: 8px;
}
.browser-copyright p { margin: 0.2rem 0; }
.browser-copyright .title { font-weight: 600; color: var(--accent); }
.browser-status {
  display: flex; justify-content: space-between;
  padding: 0.3rem 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.65rem; color: var(--text-muted);
  flex-shrink: 0; background: var(--bg-nav);
}

/* ============ MISC ============ */
#copyrightFooter {
  text-align: center;
  padding: 6px 0;
  font-size: 0.55rem;
  color: var(--text-muted);
  background: var(--bg-nav);
  border-top: 1px solid var(--border-color);
  margin-top: 0;
}
#toast-container {
  position: fixed; top: 80px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column;
  gap: 6px; pointer-events: none;
}
.toast {
  padding: 10px 18px; border-radius: 10px; color: #fff;
  font-weight: 500; font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease;
  min-width: 180px; max-width: 360px;
  pointer-events: auto;
}
.toast.success { background: rgba(34,197,94,0.95); }
.toast.error { background: rgba(239,68,68,0.95); }
.toast.info { background: rgba(59,130,246,0.95); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.fade-out { animation: fadeOut 0.3s forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }
.empty-state { text-align: center; padding: 2rem 0; color: var(--text-muted); font-size: 0.9rem; }
.empty-state i { display: block; font-size: 2rem; margin-bottom: 0.5rem; }
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .sidebar-categories { max-height: none; padding: 0.5rem; }
  #categoryList { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0.3rem; }
  .cat-label { display: none; }
  .cat-item {
    white-space: nowrap; padding: 0.3rem 0.7rem; font-size: 0.7rem;
    background: var(--bg-app); border-radius: 30px; margin: 0;
  }
  .sidebar-right { flex-direction: row; overflow-x: auto; height: auto; }
  .hot-section { flex: 1 0 260px; min-height: 300px; }
  .category-section { height: auto; min-height: 500px; }
  #articleList { max-height: 50vh; }
  .nav-tabs .nav-tab { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
  .search-wrap input { width: 100px; }
}
@media (max-width: 768px) {
  .browser-box { width: 100% !important; height: 100vh !important; max-height: 100vh !important; border-radius: 0 !important; }
  .browser-toolbar { padding: 0.2rem 0.3rem !important; gap: 0.15rem !important; flex-wrap: nowrap !important; }
  .browser-btn { padding: 0.15rem 0.35rem !important; font-size: 0.6rem !important; min-height: 26px !important; }
  .browser-url { font-size: 0.6rem !important; min-height: 26px !important; min-width: 40px !important; }
  .browser-translate-btn { padding: 0.15rem 0.5rem !important; font-size: 0.6rem !important; }
  .browser-content { padding: 0.6rem !important; }
  .browser-page-title { font-size: 0.95rem !important; }
  .browser-page-body, .browser-translated-body { font-size: 0.75rem !important; max-height: 45vh !important; }
}
@media (max-width: 640px) {
  .navbar { padding: 0 0.6rem; height: 52px; gap: 0.4rem; }
  .nav-brand { font-size: 0.85rem; }
  .nav-brand span { display: none; }
  .nav-tabs .nav-tab { font-size: 0.68rem; padding: 0.25rem 0.5rem; }
  .search-wrap input { width: 70px; font-size: 0.7rem; padding-left: 1.6rem; }
  .search-wrap input:focus { width: 90px; }
  .username { display: none; }
  .app-container { padding: 0.4rem; }
}
/* ============================================================
   用户下拉菜单
   ============================================================ */
.user-menu {
  position: relative;
}

.auth-user-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 30px;
  transition: background 0.15s;
}
.auth-user-info:hover {
  background: var(--bg-app);
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  flex-shrink: 0;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  padding: 0.4rem;
  z-index: 999;
  animation: dropdownIn 0.15s ease;
}

.user-menu.open .user-dropdown {
  display: block;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-app);
  color: var(--text-primary);
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropdown-item:hover i {
  color: var(--accent);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.dropdown-item.danger:hover i {
  color: #ef4444;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.3rem 0.4rem;
}

/* ============================================================
   ★ 手机端 navbar 紧凑化 v6
   —— 头像和铃铛紧贴，4 个 tab 完整显示，搜索保留
   ============================================================ */

@media (max-width: 900px) {

  /* 1. navbar 紧凑：右侧只留 34px 给铃铛，不再有大片空白 */
  body .navbar {
    padding: 0 calc(34px + var(--safe-right)) 0 calc(0.4rem + var(--safe-left)) !important;
    height: 50px !important;
    gap: 0.1rem !important;
    overflow: visible !important;
  }

  /* 2. 品牌：保留图标（小屏时可以隐藏，见下方 <350px） */
  body .navbar .nav-brand {
    font-size: 1.05rem !important;
    flex-shrink: 0 !important;
  }
  body .navbar .nav-brand span {
    display: none !important;
  }

  /* 3. 4 个 tab 完整显示 */
  body .navbar .nav-tabs {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    gap: 0.05rem !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
  }
  body .navbar .nav-tabs .nav-tab {
    flex: 0 0 auto !important;
    font-size: 0.72rem !important;
    padding: 0.28rem 0.5rem !important;
    white-space: nowrap !important;
    border-radius: 20px !important;
  }

  /* 4. "智能问答" → "问答"（省一半宽） */
  body .navbar .nav-tabs .nav-tab[data-path="/rag"] {
    font-size: 0 !important;
    padding: 0.28rem 0.5rem !important;
    position: relative !important;
  }
  body .navbar .nav-tabs .nav-tab[data-path="/rag"]::after {
    content: '问答' !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    display: inline-block !important;
    line-height: 1 !important;
  }
  body .navbar .nav-tabs .nav-tab[data-path="/rag"].active::after {
    color: #fff !important;
  }

  /* 5. 右侧操作区紧贴 */
  body .navbar .nav-actions {
    flex-shrink: 0 !important;
    gap: 0.1rem !important;
  }

  /* 6. 搜索框：收成小圆图标，点击展开 */
  body .navbar .nav-actions .search-wrap {
    display: block !important;
  }
  body .navbar .search-wrap input {
    width: 26px !important;
    padding: 0.3rem 0 !important;
    font-size: 0 !important;
    text-align: center !important;
    cursor: pointer !important;
    border-radius: 50% !important;
  }
  body .navbar .search-wrap input::placeholder { color: transparent !important; }
  body .navbar .search-wrap input:focus {
    width: 120px !important;
    padding: 0.3rem 0.6rem 0.3rem 1.7rem !important;
    font-size: 0.72rem !important;
    text-align: left !important;
    border-radius: 20px !important;
    cursor: text !important;
  }
  body .navbar .search-wrap input:focus::placeholder { color: var(--text-muted) !important; }
  body .navbar .search-wrap i {
    left: 0.4rem !important;
    font-size: 0.7rem !important;
    pointer-events: none !important;
  }

  /* 7. 主题按钮 26px */
  body .navbar .theme-toggle {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.68rem !important;
    flex-shrink: 0 !important;
  }

  /* 8. 头像 26px */
  body .navbar .auth-user-info {
    padding: 0 !important;
    gap: 0 !important;
  }
  body .navbar .nav-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.6rem !important;
  }
  body .navbar .username { display: none !important; }

  /* 9. ★ 铃铛：紧贴头像右边 */
  body .orbital-bell {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.68rem !important;
    top: calc(12px + var(--safe-top)) !important;
    right: calc(4px + var(--safe-right)) !important;
    z-index: 10001 !important;
  }

  /* 10. 语言切换彻底从 navbar 隐藏（保持在下拉菜单里） */
  body .navbar .nav-actions .lang-toggle-group {
    display: none !important;
  }
}

/* 超小屏 < 350px：品牌图标也让位 */
@media (max-width: 350px) {
  body .navbar .nav-brand { display: none !important; }
  body .navbar .nav-tabs .nav-tab {
    font-size: 0.68rem !important;
    padding: 0.26rem 0.4rem !important;
  }
  body .navbar .nav-tabs .nav-tab[data-path="/rag"]::after {
    font-size: 0.68rem !important;
  }
  body .navbar .search-wrap input { width: 24px !important; }
  body .navbar .search-wrap input:focus { width: 100px !important; }
  body .navbar .theme-toggle {
    width: 24px !important; height: 24px !important;
    font-size: 0.62rem !important;
  }
  body .navbar .nav-avatar {
    width: 24px !important; height: 24px !important;
    font-size: 0.56rem !important;
  }
  body .orbital-bell {
    width: 24px !important; height: 24px !important;
    font-size: 0.64rem !important;
  }
}