/* ============================================
 * 面试题库 Web 版 - 大厂级 UI 设计
 * ============================================ */

/* ====== CSS 变量 ====== */
:root {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD1;
  --primary-bg: #F0EEFF;
  --accent: #00CEC9;
  --accent-light: #81ECEC;
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #FF7675;

  /* 颾度色 */
  --easy: #55E6C1;
  --easy-bg: #D4F8EC;
  --easy-text: #019875;
  --medium: #FDCB6E;
  --medium-bg: #FFF8E1;
  --medium-text: #B7791F;
  --hard: #FF7675;
  --hard-bg: #FFE5E5;
  --hard-text: #D63031;

  --bg: #F8F9FC;
  --bg-card: #FFFFFF;
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-muted: #B2BEC3;
  --border: #E8EBF0;
  --border-light: #F0F2F5;

  --shadow-xs: 0 1px 3px rgba(108,92,231,0.04);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(108,92,231,0.12);
  --shadow-primary: 0 4px 20px rgba(108,92,231,0.25);
  --shadow-nav: 0 1px 20px rgba(45,52,54,0.08);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

/* ====== Reset & Base ====== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; border: none; background: none; font-family: inherit; outline: none; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ====== 导航栏 Navbar ====== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-nav);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; padding: 0 32px;
}
.nav-brand {
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex; align-items: center; gap: 8px;
  transition: opacity .2s;
}
.nav-brand:hover { opacity: 0.8; }

.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 9px 22px; border-radius: 50px;
  font-size: 14.5px; font-weight: 500;
  color: var(--text-secondary);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.nav-link::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .25s ease;
}
.nav-link:hover { color: var(--primary); background: var(--primary-bg); }
.nav-link.active {
  color: var(--primary); background: var(--primary-bg);
  font-weight: 600;
}
.nav-link.active::after { width: 40%; }
#nav-profile { display: none; }
.mobile-link[data-action="profile"] { display: none; }

.hamburger { display: none; flex-direction: column; gap: 5.5px; cursor: pointer; padding: 4px; }
.hamburger span {
  width: 24px; height: 2.5px; background: var(--text-primary); border-radius: 4px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.mobile-menu { display: none; }

/* ====== 主内容区 ====== */
.main-content { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.page { display: none; animation: pageIn .35s ease-out; }
/* 非 active 的页面强制隐藏（覆盖 auth-page 等子类的 display:flex） */
.page:not(.active) { display: none !important; }
.page.active { display: block; }
/* 认证页需要保持 flex 布局，不能被 block 覆盖 */
.page.auth-page.active { display: flex !important; }

/* 认证页需要全屏显示 — 脱离 main-content 宽度限制 */
.main-content:has(.page.auth-page.active) {
  max-width: none;
  padding: 0 40px;
}
.main-content > .auth-page {
  min-height: 100vh;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== Hero Banner（紧凑型） ====== */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #a29bfe 30%, var(--accent) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 28px; color: white;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
/* 装饰背景 */
.hero-banner::before {
  content: '';
  position: absolute; top: -40px; right: -30px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-banner::after {
  content: '';
  position: absolute; bottom: -20px; left: -20px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-title {
  font-size: 24px; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 4px; position: relative;
}
.hero-desc {
  font-size: 14px; opacity: 0.88; margin-bottom: 8px; max-width: 480px;
  position: relative; line-height: 1.5;
}
.hero-stats {
  display: flex; align-items: center; gap: 16px; font-size: 13.5px; opacity: 0.85;
  position: relative;
}
.hero-stats strong { font-weight: 700; }
.stat-dot { opacity: 0.45; font-size: 18px; }

/* 统计数字高亮 */
.hero-stats strong {
  background: rgba(255,255,255,0.18);
  padding: 1px 8px; border-radius: 6px;
}

/* ====== Section 卡片容器 ====== */
.section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow .25s;
}
.category-section { padding: 24px 28px; }

/* 一级分类 */
.category-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.cat-btn {
  padding: 10px 26px; border-radius: 50px; font-size: 14.5px;
  background: var(--bg); color: var(--text-secondary); font-weight: 500;
  border: 1.5px solid transparent;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.cat-btn::before {
  content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary), var(--accent));
  opacity: 0; transition: opacity .25s; z-index: 0;
  border-radius: 50px;
}
.cat-btn span, .cat-btn { position: relative; z-index: 1; }
.cat-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-bg);
  transform: translateY(-1px);
}
.cat-btn.active {
  background: linear-gradient(135deg, var(--primary), #8B7CF7);
  color: white;
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}
.cat-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(108,92,231,0.35);
}

/* 二级分类 */
.subcat-section { padding: 20px 24px; border-top: 1px solid var(--border-light); }
.subcat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px;
}
.subcat-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; border-radius: var(--radius);
  background: var(--bg); border: 2px solid transparent;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.subcat-btn:hover { 
  background: var(--primary-bg); 
  border-color: var(--primary-light);
  transform: translateY(-2px);
}
.subcat-btn.active {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(108,92,231,0.15);
}
.subcat-icon { font-size: 28px; line-height: 1; }
.subcat-img {
  width: 40px; height: 40px;
  object-fit: contain;
}
.subcat-name { 
  font-size: 13px; color: var(--text-secondary); text-align: center; 
  line-height: 1.35; font-weight: 500;
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.subcat-btn.active .subcat-name { color: var(--primary); font-weight: 600; }

/* 筛选提示栏 */
.filter-hint-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding: 14px 20px;
  background: linear-gradient(135deg, var(--primary-bg), #F5F0FF);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  font-size: 14px; color: var(--primary-dark);
}
.filter-hint-bar strong { font-weight: 700; }
.clear-filter { 
  color: var(--text-muted); cursor: pointer; font-size: 13px; 
  padding: 4px 12px; border-radius: 8px;
  transition: all .2s;
  font-weight: 500;
}
.clear-filter:hover { color: var(--danger); background: var(--hard-bg); }

/* ====== 筛选栏 ====== */
.filter-bar {
  display: flex; gap: 10px; padding: 18px 28px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.fil-btn {
  flex: 1; padding: 11px 0; border-radius: 50px; font-size: 14.5px;
  background: var(--bg); color: var(--text-secondary); font-weight: 500;
  border: 1.5px solid transparent;
  transition: all .25s;
}
.fil-btn:hover { background: var(--border-light); border-color: var(--border); }
.fil-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(108,92,231,0.25);
  font-weight: 600;
}

/* ====== 题目卡片列表 ====== */
.question-list { display: flex; flex-direction: column; gap: 10px; }

.q-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  border-left: 4px solid var(--primary-light);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.q-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: linear-gradient(180deg, var(--primary), var(--accent));
  transition: width .25s;
}
.q-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.q-card:hover::before { width: 6px; }
.q-card:active { transform: scale(0.995); }
.q-card.highlight {
  background: linear-gradient(135deg, #FFFBF0, #FFF8E1);
  border-color: var(--warning);
}
.q-card.highlight::before { background: linear-gradient(180deg, #FDCB6E, #F9CA24); }

.q-card-title {
  flex: 1; font-size: 15.5px; color: var(--text-primary);
  line-height: 1.55; margin-right: 20px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-weight: 450;
}

.q-card-diff {
  font-size: 12px; padding: 5px 14px; border-radius: 50px;
  font-weight: 600; flex-shrink: 0; letter-spacing: 0.3px;
  text-transform: uppercase;
}
.q-card-diff.easy, .q-card-diff.ez { 
  background: var(--easy-bg); color: var(--easy-text);
  border: 1px solid var(--easy);
}
.q-card-diff.medium { 
  background: var(--medium-bg); color: var(--medium-text);
  border: 1px solid var(--medium);
}
.q-card-diff.hard { 
  background: var(--hard-bg); color: var(--hard-text);
  border: 1px solid var(--hard);
}

/* ====== 加载/空状态 ====== */
.load-more-area { text-align: center; padding: 36px 0 48px; }
.loading-text, .nomore-text { 
  color: var(--text-muted); font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
/* loading 动画 */
.loading-text::before {
  content: '';
  display: inline-block; width: 16px; height: 16px;
  border: 2.5px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loadmore-btn {
  padding: 13px 56px; border-radius: 50px; font-size: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; font-weight: 600;
  box-shadow: var(--shadow-primary);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  letter-spacing: 0.5px;
}
.loadmore-btn:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 28px rgba(108,92,231,0.35);
}

.empty-state {
  text-align: center; padding: 72px 40px; color: var(--text-muted);
}
.empty-state p { font-size: 16px; font-weight: 500; }
.empty-state .empty-icon { 
  font-size: 64px; margin-bottom: 18px; display: block;
  opacity: 0.6;
}

/* ====== 详情页 ====== */
.detail-container {
  max-width: 820px; margin: 0 auto;
  animation: detailIn .4s ease-out;
}
@keyframes detailIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  transition: all .25s;
  box-shadow: var(--shadow-xs);
}
.back-btn:hover { 
  background: var(--primary-bg); 
  color: var(--primary);
  border-color: var(--primary-light);
  transform: translateX(-2px);
}

.detail-header {
  background: var(--bg-card);
  padding: 36px 38px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.detail-meta { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.detail-cat-tag {
  font-size: 13px; font-weight: 600; color: var(--success);
  background: var(--easy-bg);
  padding: 6px 16px; border-radius: 50px;
  border: 1px solid var(--easy);
}
.detail-diff-tag {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg); padding: 6px 16px; border-radius: 50px;
}
.detail-q-title { 
  font-size: 26px; font-weight: 700; line-height: 1.45; 
  margin-bottom: 18px; letter-spacing: -0.3px;
  color: var(--text-primary);
}
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.d-tag { 
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  background: var(--bg); padding: 6px 16px; border-radius: 50px;
  border: 1px solid var(--border);
}

/* 答案区域 */
.answer-sec {
  background: var(--bg-card);
  padding: 32px 38px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.answer-head { 
  display: flex; align-items: center; justify-content: space-between; 
  margin-bottom: 24px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}
.answer-title { 
  font-size: 21px; font-weight: 700; 
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.copy-answer-btn { 
  font-size: 13.5px; font-weight: 500; color: var(--primary);
  padding: 8px 20px; border: 1.5px solid var(--primary-light);
  border-radius: 50px;
  background: var(--primary-bg);
  transition: all .25s;
}
.copy-answer-btn:hover { 
  background: var(--primary); 
  color: white;
  border-color: transparent;
}

/* 答案预览态 */
.answer-preview-text {
  background: linear-gradient(135deg, #FAFBFD, #F5F7FA);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.78;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 20px;
  font-style: italic;
}
.reveal-answer-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 18px 0; border-radius: 50px;
  font-size: 16px; font-weight: 600; color: white;
  background: linear-gradient(135deg, var(--primary), #8B7CF7);
  box-shadow: 0 6px 24px rgba(108,92,231,0.3);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  letter-spacing: 0.5px;
}
.reveal-answer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(108,92,231,0.4);
}
.reveal-arrow { font-size: 12px; animation: bounceDown 1.5s infinite; }
@keyframes bounceDown {
  0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); }
}

/* 收起按钮 */
.collapse-answer-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 0; border-radius: 50px;
  margin-top: 32px; font-size: 13.5px; font-weight: 500;
  background: var(--bg); color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all .2s;
}
.collapse-answer-btn:hover { background: var(--border-light); color: var(--text-secondary); }

/* 答案 Markdown 渲染容器 */
.answer-md-wrap { 
  animation: answerReveal .4s cubic-bezier(.4,0,.2,1); 
}
@keyframes answerReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.markdown-body {
  box-sizing: border-box;
  min-width: 200px;
  max-width: 100%;
  margin: 0;
  padding: 4px 2px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --color-fg-default: #1f2329;
  --color-fg-muted: #4e5969;
  --color-accent-fg: #165dff;
  --color-canvas-subtle: #f2f3f5;
  --color-border-default: #e5e6eb;
  --color-border-muted: #f2f3f5;
  line-height: 1.75;
  font-size: 15px;
  color: var(--color-fg-default);
}

/* 标题 */
.markdown-body h1 {
  font-size: 2em; font-weight: 600; padding-bottom: .5em;
  border-bottom: 1px solid var(--color-border-muted);
  margin-top: 1.5em; margin-bottom: 1em;
}
.markdown-body h2 {
  font-size: 1.5em; font-weight: 600; padding-bottom: .3em;
  border-bottom: 1px solid var(--color-border-muted);
  margin-top: 1.5em; margin-bottom: 1em;
}
.markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
  font-weight: 600; margin-top: 1.25em; margin-bottom: .5em;
}
.markdown-body h3:first-child { margin-top: 0; }

/* 段落 */
.markdown-body p { margin: .8em 0; }

/* 列表 */
.markdown-body ul, .markdown-body ol { padding-left: 2em; margin-top: .6em; margin-bottom: 1em; }
.markdown-body li { margin-top: .35em; margin-bottom: .35em; line-height: 1.75; }
/* 关键修复：列表项内部的段落间距（解决列表项内文字拥挤/散乱问题） */
.markdown-body li > p { margin-top: .4em; margin-bottom: .4em; }
/* 列表项内第一个段落不需要上边距 */
.markdown-body li > p:first-child { margin-top: .2em; }
.markdown-body ul > li::marker { color: #6c5ce7; }
.markdown-body ol > li::marker { color: #6c5ce7; font-weight: 700; }

/* 加粗 / 斜体 */
.markdown-body strong { font-weight: 600; color: #165dff; }
.markdown-body em { color: var(--color-fg-muted); font-style: italic; }

/* 行内代码 */
.markdown-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .88em;
  background-color: var(--color-canvas-subtle);
  border-radius: 4px;
  padding: .2em .45em;
}

/* 代码块 */
.markdown-body pre {
  padding: 16px 18px;
  border-radius: 6px;
  background-color: #f6f8fa;
  margin-top: .75em; margin-bottom: 1em;
  overflow-x: auto;
  line-height: 1.6;
}
.markdown-body pre code {
  padding: 0; background: transparent; border-radius: 0;
  font-size: .88em;
}

/* 引用 */
.markdown-body blockquote {
  padding: 0 1em;
  color: var(--color-fg-muted);
  border-left: .25em solid var(--color-border-default);
  margin: 1em 0;
}

/* 链接 */
.markdown-body a { color: var(--color-accent-fg); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

/* 表格 */
.markdown-body table { border-collapse: collapse; width: 100%; margin: 1em 0; display: block; overflow-x: auto; }
.markdown-body table th, .markdown-body table td {
  border: 1px solid var(--color-border-default);
  padding: 7px 13px;
}
.markdown-body table th {
  background: linear-gradient(135deg, #f8f9fb, #F0F2F5);
  font-weight: 600;
}
.markdown-body table tr:nth-child(2n) { background-color: var(--color-canvas-subtle); }
.markdown-body table tr:hover td { background: #eef1ff; }

/* 分隔线 */
.markdown-body hr { border: none; border-top: 1px dashed var(--color-border-default); margin: 2em 0; opacity: .6; }

/* 图片 */
.markdown-body img { max-width: 100%; height: auto; border-radius: 6px; }

/* 响应式 */
@media (max-width: 767px) {
  .markdown-body { font-size: 14.5px; line-height: 1.72; }
  .markdown-body pre { padding: 12px 14px; font-size: 84%; }
}

/* 标签区域 */
.tag-sec { 
  background: var(--bg-card); padding: 24px 38px; 
  border-radius: var(--radius-lg); margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.tag-sec h4 { font-size: 17px; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.tag-flex { display: flex; flex-wrap: wrap; gap: 8px; }
.t-item { 
  font-size: 13px; font-weight: 500; color: var(--text-secondary); 
  background: var(--bg); padding: 7px 18px; border-radius: 50px;
  border: 1px solid var(--border-light);
  transition: all .2s;
}
.t-item:hover { 
  border-color: var(--primary-light);
  background: var(--primary-bg);
  color: var(--primary);
}

/* 底部操作按钮 */
.detail-actions { display: flex; gap: 14px; padding: 0 0 44px; }
.act-btn {
  flex: 1; padding: 16px 0; border-radius: 50px; 
  font-size: 15.5px; font-weight: 600;
  background: var(--bg); color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all .25s;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
}
.act-btn:hover { 
  background: var(--border-light);
  border-color: var(--text-muted);
}
.act-btn.fav { 
  color: var(--danger);
  border-color: var(--hard);
  background: var(--hard-bg);
}
.act-btn.fav:hover {
  background: var(--danger);
  color: white;
}
.act-btn.primary { 
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; border-color: transparent;
  box-shadow: var(--shadow-primary);
}
.act-btn.primary:hover { 
  box-shadow: 0 6px 28px rgba(108,92,231,0.4);
  transform: translateY(-1px);
}

/* ====== Toast 提示 ====== */
.toast {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%) translateY(-10px);
  background: var(--text-primary); color: white; 
  padding: 12px 32px; border-radius: 50px;
  font-size: 14px; font-weight: 500; z-index: 9999; pointer-events: none;
  opacity: 0; transition: all .3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ====== 屏幕阅读器专用（Visually Hidden）======= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 语义化标签样式重置 */
header, nav, main, section, article, aside, footer {
  display: block;
}

/* ====== 面包屑导航 ====== */
.breadcrumb-nav {
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
}

.breadcrumb-item {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-item:hover {
  text-decoration: underline;
}

.breadcrumb-item.current {
  color: var(--text-secondary);
  cursor: default;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: var(--text-muted);
}

/* ====== 相关面试题推荐 ====== */
.related-section {
  margin: 24px 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.related-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.related-list {
  list-style: none;
  padding: 0;
}

.related-item {
  border-bottom: 1px solid var(--border-light);
}

.related-item:last-child {
  border-bottom: none;
}

.related-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.related-link:hover {
  color: var(--primary);
}

.related-title {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}

.related-diff {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.back-home-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--primary);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
}

.back-home-link:hover {
  text-decoration: underline;
}

/* ====== 页脚导航 ====== */
.page-footer-nav {
  margin-top: 32px;
  padding: 24px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.footer-nav-link {
  display: inline-block;
  margin: 0 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-nav-link:hover {
  color: var(--primary);
}

/* ====== 图片自适应优化 ====== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 图片懒加载占位 */
img[data-src] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

img[data-src].loaded {
  animation: none;
  background: transparent;
}

/* ====== 响应式：平板 (<=1024px) ====== */
@media (max-width: 1024px) {
  .main-content { max-width: 900px; }
  .hero-banner { padding: 18px 22px; }
  .hero-title { font-size: 22px; }
  .related-section { margin: 20px 16px; padding: 16px; }
}

/* ============================================
 * 认证页面：登录 / 注册（PC左右分栏 + 移动端自适应）
 * ============================================ */

/* 认证页容器 — PC端左右分栏居中显示，移动端仅表单 */
.auth-page { 
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: 40px;
  margin-bottom: 40px;
  background: #f5f7fa;
}

/* ====== 左侧品牌面板（PC端显示） ====== */
.auth-brand-panel {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #6C5CE7 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
  color: white;
  min-width: 0;
}
/* 装饰圆 */
.auth-brand-panel::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  top: -120px; right: -100px;
}
.auth-brand-panel::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -80px; left: -80px;
}

.auth-brand-icon {
  font-size: 72px; margin-bottom: 20px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.15));
  animation: logoBounce 2s ease-in-out infinite;
  position: relative; z-index: 1;
}
@keyframes logoBounce {
  0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); }
}
.auth-brand-title {
  font-size: 36px; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 12px; position: relative; z-index: 1;
}
.auth-brand-subtitle {
  font-size: 17px; opacity: 0.85; line-height: 1.6;
  max-width: 380px; text-align: center;
  position: relative; z-index: 1; margin-bottom: 40px;
}
/* 特性列表 */
.auth-features {
  display: flex; flex-direction: column; gap: 14px;
  position: relative; z-index: 1; width: 100%; max-width: 340px;
}
.auth-feature-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 14.5px; opacity: 0.9;
}
.auth-feature-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  backdrop-filter: blur(4px);
}

/* ====== 右侧表单面板 ====== */
.auth-form-panel {
  width: 480px; min-width: 420px;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  background: white;
  box-shadow: -8px 0 40px rgba(0,0,0,0.06);
  position: relative; z-index: 1;
}

.auth-container {
  width: 100%; max-width: 400px;
}

.auth-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  animation: none;
}

.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo {
  font-size: 48px; margin-bottom: 12px;
  display: inline-block; animation: logoBounce 2s ease-in-out infinite;
}
.auth-title {
  font-size: 26px; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.5px; margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 14.5px; color: var(--text-muted);
}

/* Tab 切换 */
.auth-tabs {
  display: flex; background: var(--bg); border-radius: 50px;
  padding: 4px; margin-bottom: 28px;
}
.auth-tab {
  flex: 1; padding: 11px 0; border-radius: 50px;
  font-size: 14.5px; font-weight: 600; color: var(--text-secondary);
  transition: all .25s;
}
.auth-tab:hover:not(.active) { color: var(--primary); }
.auth-tab.active {
  background: white; color: var(--primary);
  box-shadow: 0 2px 8px rgba(108,92,231,0.15);
}

/* 错误提示 */
.auth-error {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--hard-text);
  background: var(--hard-bg);
  border: 1px solid var(--danger);
  margin-bottom: 18px;
  animation: shakeIn .3s ease-out;
}
@keyframes shakeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 表单 */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field label {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.field-note { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }
.auth-field input {
  width: 100%; padding: 14px 18px; border-radius: var(--radius);
  font-size: 15px; color: var(--text-primary);
  background: var(--bg); border: 1.5px solid var(--border-light);
  transition: all .25s;
  outline: none;
}
.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
  background: white;
}
.auth-field input::placeholder { color: var(--text-muted); }

/* 登录/注册按钮 */
.auth-btn-primary {
  width: 100%; padding: 15px 0; border-radius: 50px;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  color: white; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 6px 24px rgba(108,92,231,0.3);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  margin-top: 6px;
}
.auth-btn-primary:hover:not(.loading) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(108,92,231,0.4);
}
.auth-btn-primary.loading {
  opacity: 0.7; cursor: not-allowed;
  pointer-events: none;
}
.auth-btn-primary:active:not(.loading) { transform: scale(0.98); }

.auth-footer {
  text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-secondary);
}
.auth-footer a {
  color: var(--primary); font-weight: 600;
  transition: color .2s;
}
.auth-footer a:hover { color: var(--primary-dark); text-decoration: underline; }

/* 微信扫码区域 */
.wechat-qrcode-area { text-align: center; }
.wechat-tip { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 20px; }
.qrcode-placeholder {
  width: 200px; height: 200px; margin: 0 auto 16px;
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: var(--bg);
}
.qrcode-icon { font-size: 40px; }
.qrcode-text { font-size: 13px; color: var(--text-muted); }
.wechat-note { font-size: 12.5px; color: var(--text-muted); max-width: 280px; margin: 0 auto; line-height: 1.55; }

/* ============================================
 * 个人中心
 * ============================================ */
.profile-container { max-width: 600px; margin: 0 auto; animation: pageIn .35s ease-out; }

.profile-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-lg); padding: 36px 30px;
  text-align: center; color: white; position: relative; overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
}
.profile-card::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 14px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; border: 3px solid rgba(255,255,255,0.35);
}
.profile-avatar-badge {
  position: absolute; bottom: 0; right: 0; font-size: 22px;
  background: white; border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.profile-name { font-size: 24px; font-weight: 700; margin-bottom: 4px; position: relative; }
.profile-id { font-size: 13px; opacity: 0.75; position: relative; }

.profile-section {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 22px 26px; margin-bottom: 16px;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border-light);
}
.section-label { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }

.bind-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border-light);
  transition: all .2s;
}
.bind-card:hover { border-color: var(--success); background: var(--easy-bg); }
.bind-icon-wechat { font-size: 32px; }
.bind-info { flex: 1; }
.bind-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.bind-status { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.bind-status.bound { color: var(--success); }
.bind-btn {
  padding: 8px 22px; border-radius: 50px; font-size: 13.5px; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer; transition: all .2s;
  white-space: nowrap;
}
.bind-btn-green { background: var(--success); color: white; }
.bind-btn-green:hover { background: #00A884; }
.unbind-btn { background: var(--hard-bg); color: var(--hard-text); border-color: var(--danger); }
.unbind-btn:hover { background: var(--danger); color: white; }

.action-list { display: flex; flex-direction: column; gap: 2px; }
.action-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 6px; border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text-secondary); cursor: pointer;
  transition: all .15s; border-bottom: 1px solid var(--border-light);
}
.action-item:last-child { border-bottom: none; }
.action-item:hover { background: var(--hard-bg); color: var(--hard-text); }
.action-icon { font-size: 20px; }
.action-text { flex: 1; font-weight: 500; }
.action-arrow { font-size: 22px; color: var(--text-muted); }

.profile-footer {
  text-align: center; padding: 24px 0; font-size: 12.5px; color: var(--text-muted);
}

/* 导航栏用户区域 */
.nav-user-area { display: flex; align-items: center; gap: 12px; }
.nav-username {
  font-size: 14px; font-weight: 600; color: var(--primary);
  background: var(--primary-bg); padding: 5px 14px; border-radius: 50px;
}
.nav-logout-btn {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  padding: 6px 14px; border-radius: 50px;
  border: 1px solid var(--border); transition: all .2s;
}
.nav-logout-btn:hover { background: var(--hard-bg); color: var(--hard-text); border-color: var(--danger); }

/* 确认弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(45,52,54,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: modalFadeIn .2s ease;
}
@keyframes modalFadeIn { from{opacity:0} to{opacity:1} }

.modal-box {
  background: white; border-radius: var(--radius-lg);
  padding: 32px 36px; min-width: 340px;
  max-width: 90vw; box-shadow: var(--shadow-lg);
  animation: modalSlideIn .3s cubic-bezier(.4,0,.2,1);
}
@keyframes modalSlideIn { from{transform:translateY(20px);opacity:.5} to{transform:translateY(0);opacity:1} }

.modal-msg {
  font-size: 16px; line-height: 1.65; color: var(--text-primary);
  margin-bottom: 28px; text-align: center;
}
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-btn {
  padding: 11px 32px; border-radius: 50px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.modal-btn-cancel {
  background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border);
}
.modal-btn-cancel:hover { background: var(--border-light); }
.modal-btn-confirm {
  background: var(--danger); color: white;
  box-shadow: 0 3px 14px rgba(255,118,117,0.3);
}
.modal-btn-confirm:hover { background: #E05C5B; }

/* ====== 响应式：手机端 (<=768px) ====== */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }

  /* 认证页手机适配 */
  .auth-brand-panel { display: none; }
  .auth-form-panel { width: 100%; min-width: 0; padding: 32px 20px; box-shadow: none; }
  .auth-container { max-width: 100%; }
  .auth-logo { font-size: 40px; }
  .auth-title { font-size: 23px; }
  .auth-field input { font-size: 15.5px; padding: 13px 16px; }
  .qrcode-placeholder { width: 170px; height: 170px; }

  /* 个人中心手机适配 */
  .profile-card { padding: 28px 24px; border-radius: var(--radius-md); }
  .profile-avatar { width: 64px; height: 64px; font-size: 28px; }
  .profile-name { font-size: 21px; }
  
  .mobile-menu {
    display: block; max-height: 0; overflow: hidden;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: max-height .35s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .mobile-menu.open { max-height: 200px; }
  .mobile-link {
    display: block; padding: 15px 32px; color: var(--text-secondary);
    font-size: 15px; font-weight: 500;
    border-top: 1px solid var(--border-light);
    transition: all .2s;
  }
  .mobile-link:hover, .mobile-link:active { 
    background: var(--primary-bg); 
    color: var(--primary); 
  }
  .mobile-logout {
    color: var(--hard-text) !important;
    border-top: 1px solid var(--border-light) !important;
    font-weight: 600 !important;
  }
  .mobile-logout:active { background: var(--hard-bg) !important; }

  .nav-inner { height: 58px; padding: 0 20px; }
  .nav-brand { font-size: 19px; }
  .main-content { padding: 18px 14px 40px; }

  .hero-banner { 
    padding: 18px 22px; margin-bottom: 16px; border-radius: var(--radius); 
  }
  .hero-title { font-size: 21px; margin-bottom: 2px; }
  .hero-desc { font-size: 13px; margin-bottom: 6px; }
  .hero-stats { font-size: 12.5px; gap: 12px; }

  .section { border-radius: var(--radius); margin-bottom: 14px; }
  .category-section { padding: 18px 18px; }
  .category-grid { gap: 8px; }
  .cat-btn { font-size: 13px; padding: 8px 18px; }

  .subcat-section { padding: 14px 16px; }
  .subcat-grid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
  .subcat-icon { font-size: 24px; }
  .subcat-img { width: 32px; height: 32px; }
  .subcat-name { font-size: 12px; max-width: 82px; }

  .filter-bar { padding: 12px 16px; gap: 7px; border-radius: var(--radius); margin-bottom: 14px; }
  .fil-btn { font-size: 13px; padding: 9px 0; }

  .q-card { padding: 16px 18px; border-radius: var(--radius-sm); }
  .q-card-title { font-size: 14px; margin-right: 14px; }
  .q-card-diff { font-size: 11px; padding: 4px 10px; }

  .detail-container { padding: 0; }
  .detail-header { padding: 24px 20px; border-radius: var(--radius); }
  .detail-q-title { font-size: 21px; }
  .answer-sec { padding: 22px 20px; border-radius: var(--radius); }
  .tag-sec { padding: 18px 20px; border-radius: var(--radius); }

  .back-btn { padding: 8px 18px; font-size: 13px; margin-bottom: 16px; }
  .loadmore-btn { padding: 11px 40px; font-size: 14px; }
}

/* ====== 超小屏 (<=480px) ====== */
@media (max-width: 480px) {
  .hero-banner { padding: 16px 18px; }
  .hero-title { font-size: 20px; margin-bottom: 2px; }
  .hero-desc { font-size: 12.5px; margin-bottom: 4px; }
  .cat-btn { font-size: 12.5px; padding: 7px 14px; }
  .q-card { padding: 14px 16px; }
  .q-card-title { font-size: 13.5px; }
  .detail-q-title { font-size: 19px; }
  .answer-preview-text { font-size: 14.5px; padding: 20px; }
  .markdown-body p, .markdown-body li { font-size: 14.5px; }
  .breadcrumb-nav { padding: 10px 16px; font-size: 13px; }
  .related-section { margin: 16px 0; padding: 14px; }
  .related-title { font-size: 16px; }
  .page-footer-nav { padding: 18px 12px; }
  .footer-nav-link { margin: 0 10px; font-size: 13px; }
}

/* ====== 移动端触摸优化 ====== */
@media (pointer: coarse) {
  /* 增大点击区域 */
  .q-card, .cat-btn, .subcat-btn, .nav-link, .mobile-link, .breadcrumb-item, .footer-nav-link {
    min-height: 44px;
  }
  
  /* 移除 hover 效果，使用 active */
  .q-card:hover {
    transform: none;
  }
  .q-card:active {
    transform: translateX(4px);
  }
}

/* ====== 减少动画偏好优化 ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ====== 限流/熔断倒计时 Toast ====== */
.rate-limit-toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center; gap: 10px;
  padding: 12px 24px;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 1px rgba(108,92,231,0.1);
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  animation: rlFadeIn .3s ease-out;
  max-width: 90vw;
}
@keyframes rlFadeIn { from{opacity:0;transform:translateX(-50%) translateY(-12px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
.rl-icon { font-size: 18px; flex-shrink: 0; }
.rl-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-count {
  min-width: 36px; text-align: center;
  color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums;
  background: #FFE5E5; border-radius: 999px; padding: 2px 8px; font-size: 13px;
}
.rl-spin { animation: spin .8s linear infinite; }

/* ========================================
   学术导航 & 资源中心 - Web版（对齐小程序UI）
   ======================================== */

/* 页面容器 */
.nav-page, .resource-page { min-height: 100vh; background: #f5f7fa; }

/* ====== Header（导航+资源共用） ====== */
.nav-header, .res-header {
  position: sticky; top: 48px; z-index: 200;
  background: #fff; border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.nav-header-inner, .res-header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
}
.nav-header-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-brand-icon, .res-brand-icon {
  font-size: 18px; width: 32px; height: 32px; line-height: 30px;
  text-align: center; border-radius: 8px; background: #1677ff;
  display: inline-block; flex-shrink: 0;
}
.nav-header-title, .res-title { font-size: 17px; font-weight: 700; color: #333; white-space: nowrap; }

.cat-trigger {
  display: none; /* PC端默认隐藏 */
  align-items: center; gap: 4px; font-size: 13px; padding: 6px 14px;
  border: none; border-radius: 18px; cursor: pointer; color: #1677ff;
  background: #f0f7ff; transition: all .2s; white-space: nowrap; margin-left: 8px;
}
.cat-trigger:hover { background: #e6f4ff; }
.cat-trigger.active .cat-trigger-arrow { transform: rotate(180deg); }
.cat-trigger-arrow { font-size: 11px; transition: transform .25s; display: inline-block; }

.nav-search-box, .res-search-box {
  flex: 1; display: flex; align-items: center;
  background: #f0f2f5; border-radius: 18px; padding: 0 14px; height: 36px;
  transition: box-shadow .2s;
}
.nav-search-box:focus-within, .res-search-box:focus-within { box-shadow: 0 0 0 2px rgba(22,119,255,.15); }
.nav-search-box input, .res-search-box input {
  width: 100%; outline: none; border: none; background: transparent;
  font-size: 13px; color: #333;
}
.search-clear { cursor: pointer; color: #999; font-size: 15px; flex-shrink: 0; padding: 0 4px; }

/* ====== 遮罩 ====== */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 905; background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}

/* ====== 主布局：Sidebar + Content ====== */
.nav-main-container, .res-main-container {
  max-width: 1200px; margin: 0 auto;
  display: flex; position: relative;
}

/* Sidebar */
.nav-sidebar, .res-sidebar {
  width: 220px; flex-shrink: 0;
  background: #fff; border-right: 1px solid #eee;
  overflow-y: auto; height: calc(100vh - 105px); position: sticky; top: 104px;
  padding: 16px 0; transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s;
  scrollbar-width: thin;
}
.nav-sidebar::-webkit-scrollbar, .res-sidebar::-webkit-scrollbar { width: 4px; }
.nav-sidebar::-webkit-scrollbar-thumb, .res-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.sidebar-header-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 16px 10px; margin-bottom: 4px;
}
.sidebar-title { font-size: 15px; font-weight: 700; color: #222; }
.clear-filter-link {
  font-size: 12.5px; color: #1677ff; cursor: pointer;
}
.clear-filter-link:hover { color: #0958d9; }

/* 筛选分区 */
.filter-section { margin-bottom: 6px; padding: 2px 8px; }
.filter-label {
  display: block; font-size: 12.5px; font-weight: 600; color: #888;
  margin-bottom: 8px; padding-left: 8px;
}

/* 一级分类按钮 */
.cat-first-btn, .tag-item-btn {
  display: block; width: 100%; text-align: left; padding: 10px 14px;
  border: none; border-radius: 10px; cursor: pointer; font-size: 13.5px;
  background: transparent; color: #555; transition: all .18s ease; margin-bottom: 3px;
  font-weight: 500;
}
.cat-first-btn:hover, .tag-item-btn:hover { background: #fafafa; }
.cat-first-btn.active, .tag-item-btn.active {
  background: #e6f4ff; color: #1677ff; font-weight: 600;
}

/* 二级标签组 */
.sec-tags-mb { padding: 4px 0 6px 28px; display: flex; flex-wrap: wrap; gap: 6px; }
.sec-tag-btn {
  display: inline-block; padding: 4px 14px; border: 1px solid transparent; border-radius: 16px;
  cursor: pointer; font-size: 12px; background: #f5f5f5; color: #777;
  transition: all .18s ease; white-space: nowrap; line-height: 1.5;
}
.sec-tag-btn:hover { background: #eee; }
.sec-tag-btn.active { border-color: #1677ff !important; color: #fff !important; background: #1677ff !important; }

/* ====== Content Area ====== */
.nav-content-area, .res-content-area {
  flex: 1; min-width: 0; padding: 20px 24px 40px; min-height: calc(100vh - 105px);
}

/* 活动筛选条 */
.filter-bar-inline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 16px; padding: 10px 14px; background: #fff;
  border-radius: 10px; border: 1px solid #f0f0f0;
}
.filter-tag-inline {
  padding: 4px 10px; border-radius: 14px; font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  background: #e6f4ff; color: #1677ff; font-weight: 500;
}
.filter-tag-inline.orange { background: #fff7e6; color: #fa8c16; }
.filter-close { cursor: pointer; font-size: 14px; opacity:.55; line-height: 1; }
.filter-close:hover { opacity:1; }
.result-count-text { font-size: 12.5px; color: #aaa; margin-left: auto; }

/* ====== 卡片网格 ====== */
.card-grid-nav, .card-grid-res {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}

/* 导航卡片 - 对齐小程序圆角和阴影 */
.nav-card {
  background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); transition: all .25s cubic-bezier(.4,0,.2,1);
  cursor: pointer; display: flex; flex-direction: column; gap: 14px;
  border: 1px solid rgba(0,0,0,.03);
}
.nav-card:hover {
  transform: translateY(-4px); box-shadow: 0 8px 28px rgba(22,119,255,.12);
  border-color: rgba(22,119,255,.08);
}
.nav-card-top { display: flex; align-items: flex-start; gap: 14px; }
.nav-site-logo { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; background: #f8f9fa; flex-shrink: 0; }
.avatar-circle {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, #1677ff, #69b1ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.nav-card-info { flex: 1; min-width: 0; }
.nav-card-info strong {
  font-size: 15px; font-weight: 600; color: #222; line-height: 1.4;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-card-desc {
  font-size: 12.5px; color: #999; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px;
}
.visit-link-btn {
  margin-top: 4px; padding: 9px 0; border: none; border-radius: 22px;
  background: linear-gradient(135deg, #1677ff, #4096ff); color: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .2s; letter-spacing: .5px;
}
.visit-link-btn:hover { background: linear-gradient(135deg, #0958d9, #1677ff); box-shadow: 0 4px 12px rgba(22,119,255,.3); }
.visit-link-btn:active { transform: scale(.97); }

/* ====== 资源卡片 ====== */
.res-card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); transition: all .25s cubic-bezier(.4,0,.2,1);
  cursor: pointer; display: flex; flex-direction: column; gap: 12px;
  border: 1px solid rgba(0,0,0,.03);
}
.res-card:hover:not(.card-invalid) {
  transform: translateY(-4px); box-shadow: 0 8px 28px rgba(22,119,255,.12);
  border-color: rgba(22,119,255,.08);
}
.res-card-top { display: flex; align-items: flex-start; gap: 12px; }
.res-logo-sm { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #f8f9fa; flex-shrink: 0; }
.avatar-circle-sm {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #1677ff, #69b1ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.res-info-col { flex: 1; min-width: 0; }
.res-info-col strong {
  font-size: 14.5px; font-weight: 600; color: #222; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.res-tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.res-tag { font-size: 11px; padding: 3px 10px; border-radius: 6px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.res-tag.cat-tag { background: #e6f4ff; color: #1677ff; }
.res-tag.type-tag { background: #e8fbef; color: #52c41a; }
.res-tag.invalid-tag { background: #fff1f0; color: #cf1322; }

/* 无效资源弱化 + 角标 */
.card-invalid { opacity: .5; pointer-events: none; }
.card-invalid::after {
  content: '无效'; position: absolute; top: 10px; right: -26px;
  background: #cf1322; color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 34px; transform: rotate(45deg); letter-spacing: 1px;
}

/* ====== 分页 ====== */
.pagination-bar {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 24px 0 8px; margin-top: 8px;
}
.page-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e8e8e8;
  background: #fff; color: #1677ff; font-size: 17px; font-weight: bold;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .18s;
}
.page-btn:hover:not(.disabled) { background: #1677ff; color: #fff; border-color: #1677ff; }
.page-btn.disabled { color: #ccc; cursor: not-allowed; opacity: .4; border-color: #f0f0f0; }
.page-info { font-size: 14px; color: #666; font-weight: 500; }

/* ====== Footer ====== */
.page-footer {
  text-align: center; padding: 32px 20px 24px;
  color: #bbb; font-size: 12px; line-height: 1.8;
}
.page-footer span { display: block; }

/* ====== 空状态 / 加载 ====== */
.loading-state, .empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; color: #bbb; font-size: 14px;
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 12px; opacity: .5; }
.empty-state p { margin: 4px 0; }
.empty-hint { font-size: 12.5px; color: #ccc; margin-top: 4px !important; }
.loading-spinner {
  width: 36px; height: 36px; border: 3px solid #eee; border-top-color: #1677ff;
  border-radius: 50%; animation: spin .7s linear infinite; margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================
   响应式
   ======================================== */

/* 中等屏幕：3列卡片 */
@media (min-width: 901px) and (max-width: 1180px) {
  .card-grid-nav, .card-grid-res { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* 大屏：4列/3列 */
@media (min-width: 1181px) {
  .card-grid-nav { grid-template-columns: repeat(3, 1fr); }
  .card-grid-res { grid-template-columns: repeat(2, 1fr); }
}

/* 移动端 */
@media (max-width: 900px) {
  /* Header适配 */
  .nav-header, .res-header { top: 46px; }
  .nav-header-inner, .res-header-inner { padding: 8px 14px; gap: 8px; }
  .nav-brand-icon, .res-brand-icon { width: 28px; height: 28px; font-size: 16px; line-height: 27px; }
  .nav-header-title, .res-title { font-size: 15px; }

  /* 显示筛选按钮 */
  .cat-trigger { display: inline-flex !important; }
  .nav-search-box, .res-search-box { height: 32px; padding: 0 12px; }
  .nav-search-box input, .res-search-box input { font-size: 12.5px; }

  /* Sidebar 变成滑出式覆盖层 */
  .nav-sidebar, .res-sidebar {
    position: fixed; top: 78px; left: 0; bottom: 0; z-index: 910;
    width: 280px; max-width: 80vw;
    transform: translateX(-100%); box-shadow: none;
    height: calc(100vh - 78px); border-right: none;
    border-top: 1px solid #eee; border-radius: 0 14px 0 0;
  }
  .nav-sidebar.sidebar-show, .res-sidebar.sidebar-show {
    transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,.18);
  }

  /* Content 全宽 */
  .nav-content-area, .res-content-area { padding: 14px 12px 30px; }

  /* 卡片2列 */
  .card-grid-nav, .card-grid-res { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .nav-card { padding: 14px; border-radius: 12px; gap: 10px; }
  .nav-site-logo, .avatar-circle { width: 42px; height: 42px; border-radius: 10px; font-size: 16px; }
  .nav-card-info strong { font-size: 13px; }
  .nav-card-desc { font-size: 11.5px; -webkit-line-clamp: 1; }
  .visit-link-btn { padding: 7px 0; font-size: 12px; border-radius: 18px; }

  .res-card { padding: 14px; border-radius: 12px; gap: 10px; }
  .res-logo-sm, .avatar-circle-sm { width: 38px; height: 38px; border-radius: 8px; font-size: 14px; }
  .res-info-col strong { font-size: 13px; }
  .visit-link-btn { padding: 6px 0; font-size: 12px; border-radius: 16px; }

  .page-footer { font-size: 11px; padding: 20px 12px 16px; }
  .pagination-bar { padding: 16px 0; gap: 14px; }
  .page-btn { width: 32px; height: 32px; font-size: 15px; }
}
