/* ===== 前台样式 ===== */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f5f7fa; color: #2c3e50; }
a { color: #3b6df0; text-decoration: none; }
a:hover { opacity: .85; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 16px; }

/* ===== 顶部导航条 ===== */
.top-nav { display: flex; align-items: center; gap: 2px; padding: 0 20px; background: #fff; border-bottom: 1px solid #e7ebf2; position: sticky; top: 0; z-index: 100; }
.top-nav a { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: #4a5568; font-size: 15px; font-weight: 500; transition: .12s; border-bottom: 2px solid transparent; }
.top-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.top-nav a:hover { color: #3b6df0; }
.top-nav a.active { color: #3b6df0; font-weight: 600; border-bottom-color: #3b6df0; }

/* ===== 整体布局：左侧边栏 + 右侧内容 ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar { width: 236px; flex-shrink: 0; background: #fff; border-right: 1px solid #e7ebf2; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; }
.sidebar-top { text-align: center; padding: 6px 0 18px; border-bottom: 1px solid #eef1f6; }
.logo { font-size: 30px; font-weight: 800; color: #3b6df0; letter-spacing: .5px; line-height: 1.1; }
.logo-sub { font-size: 12px; color: #3358c9; margin-top: 4px; font-weight: 500; }

.sidebar-bottom { border-top: 1px solid #eef1f6; padding-top: 14px; display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.side-login { display: block; text-align: center; padding: 10px; border-radius: 10px; background: #3b6df0; color: #fff; font-weight: 600; }
.side-login:hover { opacity: .9; }
.side-contact { padding: 0 4px; }
.soc-tip { font-size: 12px; color: #d97706; font-weight: 600; display: block; margin-bottom: 8px; text-align: center; }
.soc-group { display: flex; align-items: center; gap: 6px; }
.soc-btn { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #5a6472; transition: .12s; position: relative; cursor: pointer; }
.soc-btn .soc-txt { font-size: 10px; font-weight: 800; }
.soc-btn:hover { background: #f0f4ff; color: #3b6df0; }
.soc-btn svg { width: 17px; height: 17px; }
.soc-qr { position: absolute; left: calc(100% + 10px); bottom: 0; width: 118px; height: 118px; border-radius: 8px; border: 1px solid #e7ebf2; box-shadow: 0 10px 24px rgba(0,0,0,.18); object-fit: cover; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s; z-index: 60; background: #fff; }
.soc-btn:hover .soc-qr { opacity: 1; visibility: visible; transform: translateY(0); }

/* 用户名下拉（侧栏底部） */
.nav-user { position: relative; }
.nav-user-name { display: flex; align-items: center; justify-content: center; gap: 4px; color: #3b5480; font-weight: 600; cursor: pointer; padding: 9px; border-radius: 10px; background: #eaf1ff; border: 1px solid #d7e3fb; }
.nav-user-name:hover { background: #f0f3f8; }
.caret { font-size: 10px; color: #98a2b3; }
.nav-user-menu { display: none; position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 150px; background: #fff; border: 1px solid #e3e7ef; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.08); z-index: 99; padding: 6px; }
.nav-user:hover .nav-user-menu { display: block; }
.nav-user-menu a { display: block; padding: 8px 14px; border-radius: 6px; color: #2c3e50; font-size: 14px; white-space: nowrap; text-align: center; }
.nav-user-menu a:hover { background: #eaf1ff; color: #3b6df0; }

.side-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-area { flex: 1; padding: 26px 30px 50px; width: 100%; max-width: 1440px; margin: 0 auto; }

/* ---- 页脚 ---- */
.site-footer { background: #fbfcfe; border-top: 1px solid #edf0f6; color: #8a94a6; font-size: 13px; margin-top: 40px; }
.footer-bottom { padding: 16px 0 20px; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 14px; color: #667080; flex-wrap: wrap; }
.footer-bottom .beian { color: #667080; text-decoration: none; }
.footer-bottom .beian:hover { color: #3b6df0; text-decoration: underline; }
.footer-bottom .sep { color: #b8c1cd; }

/* ---- 卡片 ---- */
.card { background: #fff; border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; box-shadow: 0 1px 5px rgba(30,60,120,.05); }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.card h3 { margin: 0 0 14px; font-size: 16px; }

/* ---- 筛选栏 ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter-bar select, .filter-bar input { padding: 8px 11px; border: 1px solid #d5dbe5; border-radius: 8px; font-size: 14px; background: #fff; }
.filter-bar .btn { background: #3b6df0; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.filter-bar a.btn { display: inline-block; background: #eef1f6; color: #4a5568; }

/* ---- 套卷列表 ---- */
.paper-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid #f0f2f6; flex-wrap: wrap; }
.paper-row:last-child { border-bottom: none; }
.paper-name { flex: 1; font-size: 15px; font-weight: 600; }
.paper-meta { color: #8a94a6; font-size: 13px; }
.badge { padding: 2px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.badge.todo { background: #eef1f5; color: #7a8494; }
.badge.part { background: #fff3d6; color: #b07d10; }
.badge.done { background: #e4f6eb; color: #1e8e4e; }
.btn-sm { background: #3b6df0; color: #fff; border: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-sm.ghost { background: #fff; color: #3b6df0; border: 1px solid #3b6df0; }

/* ---- 状态/徽章 ---- */
.tag { padding: 2px 8px; border-radius: 5px; font-size: 12px; }
.tag.green { background: #e4f6eb; color: #1e8e4e; }
.tag.red { background: #fdecec; color: #c0392b; }
.tag.gray { background: #eef1f5; color: #777; }
.dim { color: #98a2b3; font-size: 13px; }
.rate { color: #3b6df0; font-weight: 600; }

/* ---- 题目渲染 ---- */
.q-card { background: #fff; border: 1px solid #e7ebf2; border-radius: 12px; padding: 20px 22px; margin-bottom: 14px; }
.q-index { font-weight: 700; color: #3b6df0; }
.q-type-tag { background: #eaf1ff; color: #3b6df0; padding: 1px 8px; border-radius: 5px; font-size: 12px; }
.q-content { margin: 12px 0; line-height: 1.7; white-space: pre-wrap; }
.q-content pre, .code-block { background: #f8fafc; border: 1px solid #e6eaf1; border-radius: 8px; padding: 12px 14px; overflow-x: auto; line-height: 1.5; font-family: Consolas, Menlo, 'Courier New', monospace; font-size: 13px; }
.code-block pre { margin: 0; white-space: pre; background: transparent; border: none; padding: 0; }
.q-options { margin: 10px 0 0; }
.q-options.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* 长代码选项：单列竖排，等宽字体，必要时换行 */
.q-options.grid.wide { grid-template-columns: 1fr; }
.q-options.grid.wide .opt-text { font-family: 'Consolas','Courier New',monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.q-option { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid #e3e7ef; border-radius: 8px; cursor: pointer; line-height: 1.5; font-size: 14px; transition: .12s; }
.q-option:hover { background: #f4f7ff; border-color: #b8c8f0; }
.q-option.selected { border-color: #3b6df0; background: #eaf1ff; box-shadow: 0 0 0 1px #3b6df0 inset; }
.q-option input { margin-top: 3px; }
.opt-letter { font-weight: 700; color: #3b6df0; min-width: 18px; }
.opt-text { flex: 1; }

/* ---- 代码高亮（IDE 风格浅色） ---- */
.tok-kw { color: #0000ff; font-weight: 600; }
.tok-string { color: #a31515; }
.tok-num { color: #098658; }
.tok-comment { color: #008000; font-style: italic; }
.tok-macro { color: #795e26; }
.q-answer { margin-top: 10px; padding: 10px 12px; border-radius: 8px; }
.q-answer.correct { background: #e4f6eb; color: #1e8e4e; }
.q-answer.wrong { background: #fdecec; color: #c0392b; }
.q-analysis { margin-top: 10px; background: #f4f7ff; border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; }

/* ---- 按钮区 ---- */
.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-lg { padding: 11px 26px; border-radius: 9px; font-size: 15px; cursor: pointer; border: none; }
.btn-lg.primary { background: #3b6df0; color: #fff; }
.btn-lg.ghost { background: #fff; color: #3b6df0; border: 1px solid #3b6df0; }

/* ---- 登录 ---- */
.auth-card { max-width: 400px; margin: 60px auto; }
.auth-card input { width: 100%; padding: 12px 14px; border: 1px solid #d5dbe5; border-radius: 9px; font-size: 14px; margin-bottom: 12px; }
.auth-card .btn-lg { width: 100%; }
.msg { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.msg.err { background: #fdecec; color: #c0392b; }
.msg.ok { background: #e4f6eb; color: #1e8e4e; }

/* ---- 文章 ---- */
.article-item { padding: 16px 4px; border-bottom: 1px solid #f0f2f6; }
.article-item h3 { margin: 0 0 6px; }
.article-item .meta { color: #98a2b3; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 文章分组导航 */
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.cat-chip { padding: 6px 14px; border: 1px solid #e3e7ef; border-radius: 16px; color: #4a5568; font-size: 13px; text-decoration: none; transition: .12s; background: #fff; }
.cat-chip:hover { border-color: #3b6df0; color: #3b6df0; }
.cat-chip.active { background: #3b6df0; color: #fff; border-color: #3b6df0; }
.cat-chip.sub { color: #8a94a6; }
.article-item .tag { display: inline-block; background: #eaf1ff; color: #3b6df0; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.article-body { line-height: 1.8; }
.article-body h1, .article-body h2 { margin: 18px 0 8px; }
.article-body pre { background: #f6f8fb; padding: 12px; border-radius: 8px; overflow-x: auto; }
.article-body code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; }
/* 题目题面/选项内的行内代码（zip 校对数据用 <code> 包裹代码结果） */
.q-content code, .q-options code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-family: Consolas, Menlo, 'Courier New', monospace; font-size: 13px; color: #c7254e; }
/* 选项内代码块（<pre><code>，如输出样例） */
.q-options pre { background: #f8fafc; border: 1px solid #e6eaf1; border-radius: 8px; padding: 8px 10px; overflow-x: auto; line-height: 1.5; font-family: Consolas, Menlo, 'Courier New', monospace; font-size: 13px; white-space: pre; margin: 4px 0; }
.q-options pre code { background: transparent; padding: 0; color: inherit; }
.article-body table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.article-body th, .article-body td { border: 1px solid #d5dbe5; padding: 8px 12px; text-align: left; }
.article-body thead th { background: #f2f5fa; font-weight: 600; white-space: nowrap; }
.article-body tbody tr:nth-child(even) { background: #fafbfd; }

/* ---- 记录 ---- */
.rec-row { display: flex; gap: 14px; padding: 12px 4px; border-bottom: 1px solid #f0f2f6; align-items: center; flex-wrap: wrap; }

/* ---- 刷题快捷入口（按知识点 / 随机组卷） ---- */
.quick-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 20px; }
@media (max-width: 760px) { .quick-cards { grid-template-columns: 1fr; } }
.quick-card { background: #fff; border: 1px solid #eef1f6; border-radius: 12px; padding: 20px 22px; box-shadow: 0 1px 5px rgba(30,60,120,.05); transition: border-color .12s, box-shadow .12s; }
.quick-card:hover { border-color: #dbe3f0; box-shadow: 0 3px 10px rgba(30,60,120,.08); }
.qc-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #2c3e50; margin-bottom: 14px; }
.qc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-blue { background: #3b6df0; }
.dot-orange { background: #f5a623; }
.qc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qc-select { flex: 1; min-width: 120px; padding: 9px 12px; border: 1px solid #d5dbe5; border-radius: 8px; font-size: 14px; color: #2c3e50; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer; outline: none; transition: border-color .12s, box-shadow .12s; }
.qc-select:focus { border-color: #3b6df0; box-shadow: 0 0 0 3px rgba(59,109,240,.12); }
.qc-select:hover { border-color: #b9c4d6; }
.quick-card .btn-sm { white-space: nowrap; transition: box-shadow .12s; }
.quick-card .btn-sm:hover { box-shadow: 0 4px 12px rgba(59,109,240,.25); }

/* ---- 响应式：窄屏侧栏转顶部横条 ---- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid #e7ebf2; flex-direction: row; align-items: center; padding: 10px 14px; }
  .sidebar-top { text-align: left; padding: 0; margin-right: 14px; border-bottom: none; }
  .logo { font-size: 22px; }
  .logo-sub { display: none; }
  .top-nav { padding: 0 8px; gap: 0; overflow-x: auto; }
  .top-nav a { padding: 10px 12px; font-size: 14px; }
  .top-nav a svg { width: 16px; height: 16px; }
  .sidebar-bottom { border-top: none; padding: 0; flex-direction: row; align-items: center; gap: 8px; margin-top: 0; }
  .side-login { padding: 8px 16px; }
  .side-contact { display: none; }
  .nav-user-menu { bottom: auto; top: calc(100% + 6px); }
  .main-area { padding: 18px 14px 40px; }
}

/* ===== 左下角答疑反馈：微信二维码贴出小图，hover 放大 ===== */
.soc-group { gap: 6px; }
.soc-group .soc-btn:not(.wechat) { width: 30px; height: 30px; border-radius: 8px; background: #f0f3f8; display: flex; align-items: center; justify-content: center; color: #4a5568; }
.soc-group .soc-btn:not(.wechat):hover { background: #e4eaf3; }
.soc-group .soc-btn:not(.wechat) svg { width: 17px; height: 17px; }
.soc-btn.wechat { position: relative; background: none; width: auto; padding: 0; }
.soc-btn.wechat .soc-qr { position: static; opacity: 1; visibility: visible; transform: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid #e7ebf2; box-shadow: 0 1px 4px rgba(0,0,0,.08); object-fit: cover; cursor: pointer; z-index: 60; transition: transform .18s ease; }
.soc-btn.wechat .soc-qr:hover { transform: scale(4); transform-origin: bottom left; box-shadow: 0 12px 28px rgba(0,0,0,.2); }
/* ===== 侧边栏顶部：联系我们（微信常驻，hover 放大） ===== */
.side-contact-top { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 0 14px; border-bottom: 1px solid #eef1f6; }
.contact-tip { font-size: 13px; color: #d97706; font-weight: 600; white-space: nowrap; }
.contact-qr { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid #e7ebf2; box-shadow: 0 2px 8px rgba(0,0,0,.08); cursor: pointer; position: relative; transition: transform .18s ease; z-index: 60; }
/* ===== 侧边栏顶部联系我们（覆盖）：微信 + 2x2 图标对齐 ===== */
.side-contact-top { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 12px 0 14px; border-bottom: 1px solid #eef1f6; }
.contact-tip { font-size: 13px; color: #3b6df0; font-weight: 600; white-space: nowrap; }
.contact-row { display: flex; align-items: center; gap: 12px; }
.contact-qr { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid #e7ebf2; box-shadow: 0 2px 8px rgba(0,0,0,.08); cursor: pointer; position: relative; transition: transform .18s ease; z-index: 60; }
.contact-grid { display: grid; grid-template-columns: repeat(2, 40px); grid-template-rows: repeat(2, 40px); gap: 6px; }
.contact-grid .soc-btn { width: 40px; height: 40px; border-radius: 8px; background: #f0f3f8; display: flex; align-items: center; justify-content: center; color: #4a5568; }
.contact-grid .soc-btn:hover { background: #e4eaf3; color: #3b6df0; }
.contact-grid .soc-btn svg { width: 18px; height: 18px; }
.contact-grid .soc-btn .soc-txt { font-size: 11px; font-weight: 800; }
/* ===== 联系我们条（位于底部）：分隔线改顶部，与登录状态分隔 ===== */
.side-contact-top { border-bottom: none; border-top: 1px solid #eef1f6; padding-top: 12px; margin-top: 4px; }
/* ===== 顶部一行：depth 标 + 导航(均分) + 登录 + 联系我们 ===== */
.top-nav { gap: 6px; padding: 0 20px; flex-wrap: nowrap; }
.top-nav > .logo { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px; padding: 8px 10px 8px 0; margin-right: 6px; border-bottom: none; text-decoration: none; }
.top-nav > .logo .logo-word { font-size: 27px; font-weight: 700; line-height: 1.02; color: #111; letter-spacing: .2px; font-family: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif; }
.top-nav > .logo .logo-sub { font-size: 10px; color: #9aa5b5; line-height: 1.1; white-space: nowrap; font-family: Georgia, 'Times New Roman', 'Songti SC', serif; }
.top-links { display: flex; flex: 1; justify-content: center; gap: 4px; }
.top-links a { white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 14px; margin-left: 14px; }
.top-contact { display: flex; align-items: center; gap: 8px; }
.top-contact .contact-tip { font-size: 12px; color: #3b6df0; font-weight: 600; white-space: nowrap; }
.top-wx { position: relative; display: inline-flex; }
.top-contact .contact-qr { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; border: 1px solid #e7ebf2; box-shadow: 0 1px 4px rgba(0,0,0,.08); cursor: pointer; transition: transform .18s ease; z-index: 60; }
.top-contact .contact-qr-zoom { position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%); width: 132px; height: 132px; border-radius: 10px; border: 1px solid #e7ebf2; box-shadow: 0 12px 28px rgba(0,0,0,.22); object-fit: cover; background: #fff; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease, visibility .15s; z-index: 61; }
.top-wx:hover .contact-qr-zoom { opacity: 1; visibility: visible; }
.top-contact .contact-grid { display: grid; grid-template-columns: repeat(2, 34px); grid-template-rows: repeat(2, 34px); gap: 4px; }
.top-contact .contact-grid .soc-btn { width: 34px; height: 34px; border-radius: 8px; background: #f0f3f8; display: flex; align-items: center; justify-content: center; color: #4a5568; }
.top-contact .contact-grid .soc-btn:hover { background: #e4eaf3; color: #3b6df0; }
.top-contact .contact-grid .soc-btn svg { width: 17px; height: 17px; }
.top-contact .contact-grid .soc-txt { font-size: 11px; font-weight: 800; }
.top-right .side-login { padding: 8px 18px; border-radius: 10px; background: #3b6df0; color: #fff; font-weight: 600; }
.top-right .nav-user-name { background: #eaf1ff; border: 1px solid #d7e3fb; padding: 8px 14px; }
.top-right .nav-user-menu { top: calc(100% + 8px); bottom: auto; right: 0; left: auto; }
@media (max-width: 900px) {
  .top-nav { gap: 2px; padding: 0 8px; overflow-x: auto; }
  .top-nav > .logo { padding: 6px 4px; }
  .top-nav > .logo .logo-word { font-size: 20px; }
  .top-nav > .logo .logo-sub { display: none; }
  .top-links a { padding: 10px 8px; font-size: 14px; }
  .top-contact .contact-tip { display: none; }
  .top-contact .contact-qr { width: 45px; height: 45px; }
  .top-contact .contact-grid { grid-template-columns: repeat(2, 28px); grid-template-rows: repeat(2, 28px); }
  .top-right { gap: 8px; margin-left: 6px; }
}
/* ===== 右侧题号导航栏 ===== */
/* 答题页：题目区 + 右侧题号导航（紧贴题目，sticky 跟随滚动，洛谷式） */
.exam-layout{display:flex;align-items:flex-start;gap:18px;width:100%}
.exam-layout #qwrap{flex:1;min-width:0}
#qnavigator{position:sticky;top:84px;flex-shrink:0;z-index:90;display:flex;flex-direction:column;align-items:center;gap:6px;max-height:80vh;overflow-y:auto;padding:10px 8px;background:rgba(255,255,255,.95);border:1px solid #e7ecf3;border-radius:10px;box-shadow:0 4px 16px rgba(20,40,80,.08);scrollbar-width:thin}
.qnav-group-label{font-size:12px;color:#98a2b3;letter-spacing:2px;margin:3px 0 2px;text-align:center;font-weight:600}
.qnav-item{width:30px;height:30px;line-height:28px;text-align:center;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;background:#f1f4f9;color:#5a6577;border:1px solid transparent;user-select:none;transition:background .15s,color .15s,transform .1s;flex-shrink:0}
.qnav-item:hover{background:#e3eafb;color:#2d3a4f;transform:scale(1.08)}
.qnav-item.done{background:#3b6df0;color:#fff;border-color:#2f5adb}
.qnav-item.wrong{background:#e74c3c;color:#fff;border-color:#c93a2b}
.qnav-item.correct{background:#27ae60;color:#fff;border-color:#1f9850}
.qnav-item.current{outline:2px solid #2d5fd6;outline-offset:1px}
.group-divider{margin:14px 0 6px;padding:7px 12px;background:#eef3fc;color:#2d5fd6;border-left:4px solid #3b6df0;font-weight:700;font-size:14px;border-radius:6px}
.q-card{scroll-margin-top:84px}
/* 移动端：题号栏收窄防遮挡 */
@media (max-width:900px){.exam-layout{gap:8px}#qnavigator{top:76px;padding:8px 6px}.qnav-item{width:27px;height:27px;line-height:25px;font-size:13px}}
@media (max-width:640px){#qnavigator{display:none}}
/* ===== 全站小屏/手机适配 ===== */
@media (max-width: 760px) {
  .container { padding: 0 12px; }
  .card { padding: 16px 14px; border-radius: 10px; }
  .q-card { padding: 14px 12px; }
  .card h2 { font-size: 17px; }
  .main-area { padding: 16px 10px 34px; }
  .paper-name { font-size: 14px; }
  .paper-row { gap: 8px; }
  .filter-bar select, .filter-bar input { width: 100%; }
  .filter-bar .btn { width: 100%; }
  .filter-bar .inline select, .filter-bar .inline input { flex: 1 1 100%; }
  .qc-row { gap: 8px; }
}

@media (max-width: 640px) {
  /* 选择题两列 → 单列 */
  .q-options.grid { grid-template-columns: 1fr; }
  /* 文章 Markdown 表格：整表横向滚动（保留单元格换行） */
  .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article-body pre { max-width: 100%; }
  /* 记录行：名称占一行，时间换到下一行 */
  .rec-row { gap: 8px; }
  .rec-row .dim:nth-last-child(2) { flex-basis: 100%; }
  /* 随机组卷/知识点表单：列式堆叠 */
  .qc-row { flex-direction: column; align-items: stretch; }
  .qc-row .qc-select, .qc-row input.qc-select { width: 100%; min-width: 0; flex: none; }
  .qc-row .btn-sm { width: 100%; }
  .quick-card { padding: 16px 14px; }
  /* 按钮区全宽 */
  .actions { flex-direction: column; }
  .actions .btn-lg { width: 100%; }
  .btn-lg { width: 100%; }
  /* 顶部导航更紧凑 */
  .top-links a { font-size: 13px; padding: 10px 6px; }
  .top-nav > .logo { font-size: 18px; }
  /* 登录页 */
  .auth-card { margin: 30px auto; }
  .auth-card h2 { font-size: 22px; }
  /* 文章标题/卡片文字 */
  .article-item .article-title { font-size: 15px; }
  .crumb { font-size: 13px; }
}

/* ================= 全站移动端适配（系统重构 2026-10-15） =================
   断点：≤992 平板 / ≤768 窄平板 / ≤640 手机 / ≤480 小屏
   原则：页面框架无整体横向滚动；长代码/宽表格仅局部横向滚动 */
img, video, iframe { max-width: 100%; height: auto; }
.q-content, .q-analysis, .article-body, .rg-detail, .rec-detail { overflow-wrap: break-word; word-break: break-word; }

@media (max-width: 992px) {
  .home-grid { grid-template-columns: 1fr; }
  .sr-grid { grid-template-columns: 1fr; }
  .study-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-area { padding: 18px 14px 40px; }
  .container { padding: 0 12px; }
  .card, .quick-card, .q-card { padding: 16px 14px; border-radius: 10px; }
  .filter-bar select, .filter-bar input { width: 100%; }
  .filter-bar .btn { width: 100%; }
  .filter-bar .inline { flex-direction: column; align-items: stretch; }
  .filter-bar .inline select, .filter-bar .inline input { width: 100%; }
  .paper-row, .rec-row, .level-row, .rg-row { gap: 10px; }
  .quick-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* 顶部导航：logo+登录一行，导航菜单在下方一行横向可滚（移动端主流；页面主体不滚动） */
  .top-nav { flex-wrap: wrap; align-items: center; padding: 6px 10px 0; row-gap: 0; }
  .top-nav > .logo { order: 1; padding: 4px 8px 4px 0; margin-right: 0; }
  .top-nav > .logo .logo-word { font-size: 20px; }
  .top-right { order: 2; margin-left: auto; }
  .top-links { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; padding: 2px 0; -webkit-overflow-scrolling: touch; }
  .top-links a { padding: 8px 10px; font-size: 14px; flex-shrink: 0; }
  .top-contact .contact-qr { width: 36px; height: 36px; }
  .top-right .side-login { padding: 6px 14px; }

  /* 首页：卡片纵向、标题不截断、搜索/报名表全宽按钮 */
  .tiku-cards { flex-direction: column; gap: 12px; }
  .article-item .article-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .article-item .article-title { white-space: normal; }
  .study-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .search-form { flex-wrap: wrap; }
  .search-form input { flex: 1 1 100%; }
  .search-form .btn { width: 100%; padding: 11px 0; }
  .review-card .signup-form { flex-direction: column; align-items: stretch; }
  .review-card .signup-form .btn { width: 100%; padding: 10px 0; }

  /* 题库：等级行可换行、卡片网格缩列 */
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
  .level-row { flex-wrap: wrap; gap: 8px; padding: 13px 14px; }
  .level-row .lv-meta { flex-basis: 100%; }
  .level-row .lv-arrow { font-size: 18px; }

  /* 答题：选项单列、字号/间距收小 */
  .q-options.grid { grid-template-columns: 1fr; }
  .q-option { padding: 9px 10px; font-size: 13.5px; }
  .q-content { font-size: 14px; }

  /* 记录 / 错题 / 导图：表单列式、等级堆叠 */
  .rg-form { flex-direction: column; align-items: stretch; }
  .rg-form select { width: 100%; max-width: none; }
  .rg-form .btn { width: 100%; }
  .map-stage { flex-direction: column; gap: 6px; }
  .map-kps { width: 100%; }
  .wb-ans { gap: 10px; font-size: 13px; }

  /* 按钮 / 操作区：全宽纵向 */
  .actions { flex-direction: column; }
  .actions .btn-lg { width: 100%; }
  .btn-lg { width: 100%; }

  /* 文章表格 / 代码：局部横向滚动（页面不整体滚动） */
  .article-body table, .art-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article-body pre, .code-block, .q-content pre { max-width: 100%; }

  /* 登录 */
  .auth-card { margin: 24px auto; }
}

@media (max-width: 480px) {
  .main-area { padding: 14px 8px 34px; }
  .container { padding: 0 8px; }
  .card h2 { font-size: 16px; }
  .paper-name { font-size: 14px; }
  .level-row { padding: 11px 12px; }
  .top-nav > .logo .logo-word { font-size: 18px; }
}
