/* ============================================================
   行者的技术空间 · 全站统一样式表
   原则：通用风格集中于此；页面独有风格才写在页面 <style>。
   正文宽度全部由 .main + 变体类统一控制，页面内部不再各自 max-width。
   ============================================================ */

/* ---------- 0. 设计变量（主题唯一来源，改这里即全站生效） ---------- */
:root {
    --primary: #07c160;
    --primary-strong: #06ad56;
    --primary-soft: #e9f9f0;
    --danger: #e53935;
    --bg: #f5f6f8;
    --card: #ffffff;
    --border: #e6e8eb;
    --border-2: #d0d4d9;
    --text: #1f1f1f;
    --text-2: #444;
    --muted: #999;
    --radius: 10px;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, .08);
}

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

body {
    font-family: -apple-system, "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: block;
}

/* ---------- 1. 顶部导航栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 900; width: 100%;
    background: var(--card); border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .04);
}
.topbar-inner {
    width: 100%; height: 56px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); flex: 0 0 auto; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
.brand-name { font-size: 16px; font-weight: 700; white-space: nowrap; }

.nav { flex: 1 1 auto; display: flex; justify-content: center; align-items: center; gap: 4px; overflow-x: auto; }
.nav-item { padding: 8px 14px; border-radius: 8px; color: var(--text-2); font-size: 14px; text-decoration: none; white-space: nowrap; transition: .15s; }
.nav-item:hover { background: #f0f1f3; color: var(--primary); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }

.topbar-right { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.msg-bell { position: relative; display: inline-flex; align-items: center; color: #555; }
.msg-bell:hover { color: var(--primary); }
.msg-badge { position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }

.user-menu { position: relative; }
.user-login { color: var(--primary); text-decoration: none; font-size: 14px; }
.user-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border: none; background: none; cursor: pointer; border-radius: 8px; }
.user-trigger:hover { background: #f0f1f3; }
.avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.user-name { font-size: 14px; color: #333; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { color: var(--muted); font-size: 12px; }
.user-dropdown { position: absolute; top: 46px; right: 0; min-width: 168px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 6px 0; display: none; }
.user-dropdown.open { display: block; }
.user-dropdown-head { padding: 8px 14px 10px; border-bottom: 1px solid #f0f0f0; display: flex; flex-direction: column; }
.user-dropdown-head span { color: var(--muted); font-size: 12px; }
.user-dropdown a { display: block; padding: 9px 14px; color: #333; text-decoration: none; font-size: 14px; }
.user-dropdown a:hover { background: var(--bg); color: var(--primary); }

/* ---------- 2. 正文统一控件（宽度唯一口径） ---------- */
.main {
    width: 100%;
    max-width: 1200px;          /* 默认档：列表 / 后台 / 编辑 等宽内容 */
    margin: 0 auto;
    padding: 24px 16px 40px;
    min-height: calc(100vh - 56px);
}
.main.wide { max-width: 1440px; }        /* 编辑档：文章编辑，页面超宽 */
.main.reading { max-width: 920px; }      /* 阅读档：文章列表、详情，页面较宽 */
.main.midium { max-width: 760px; }       /* 查看档：个人中心、收银台等，页面宽度适中 */
.main.narrow {                           /* 登录、注册档：页面窄栏垂直居中 */
    max-width: 460px;
    display: flex; flex-direction: column; justify-content: center;
}
.main.home-page { max-width: 1280px; padding: 32px 24px 24px; }

/* ---------- 首页 ---------- */
.home-shell { min-height: calc(100vh - 112px); display: flex; flex-direction: column; }
.home-hero { display: grid; grid-template-columns: minmax(0, 4fr) minmax(220px, 1fr); gap: 20px; flex: 1; }
.hero-copy {
    position: relative; overflow: hidden; min-height: 460px; padding: clamp(36px, 5vw, 64px);
    display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(135deg, #fff 0%, #fff 55%, #f3fbf6 100%);
    border: 1px solid var(--border); border-radius: 20px;
    box-shadow: 0 18px 50px rgba(24, 64, 40, .06);
}
.hero-copy::before {
    content: ""; position: absolute; width: 420px; height: 420px; right: -160px; top: -190px;
    border-radius: 50%; background: radial-gradient(circle, rgba(7, 193, 96, .14), rgba(7, 193, 96, 0) 68%);
    pointer-events: none;
}
.hero-copy::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(7, 193, 96, .035) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(7, 193, 96, .035) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(120deg, transparent 20%, #000 100%);
}
.hero-copy > * { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--primary-strong); font-size: 13px; font-weight: 600; letter-spacing: 1px; }
.hero-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--primary); }
.hero-copy h1 { margin-top: 18px; color: #17231c; font-size: clamp(40px, 5vw, 64px); line-height: 1.12; letter-spacing: -2px; font-weight: 750; }
.hero-copy h1 span { color: var(--primary-strong); }
.hero-description { max-width: 620px; margin-top: 22px; color: var(--text-2); font-size: 16px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-actions .btn { min-height: 44px; padding: 10px 20px; border-radius: 10px; font-weight: 600; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 34px; color: var(--muted); font-size: 12px; }
.hero-meta i { width: 3px; height: 3px; border-radius: 50%; background: #b7c5bc; }
.hero-stats {
    position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 26px 22px;
    background: #fff; border: 1px solid var(--border); border-radius: 20px;
    box-shadow: 0 18px 50px rgba(24, 64, 40, .05);
}
.hero-stats::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--primary), #83dcac); }
.stats-heading { display: flex; flex-direction: column; gap: 5px; padding-bottom: 18px; border-bottom: 1px solid #edf0ed; }
.stats-heading strong { color: #26382d; font-size: 16px; }
.stats-heading span { color: var(--muted); font-size: 11px; }
.stat-list { display: grid; flex: 1; }
.stat-item { display: flex; flex-direction: column; justify-content: center; padding: 18px 0; border-bottom: 1px solid #edf0ed; }
.stat-item:last-child { border-bottom: 0; }
.stat-label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.stat-value { margin-top: 4px; color: var(--primary-strong); font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
.stats-footnote { padding-top: 14px; border-top: 1px solid #edf0ed; color: var(--muted); font-size: 11px; text-align: center; }
.home-reserved {
    min-height: 220px; margin-top: 20px; padding: 40px 24px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: rgba(255, 255, 255, .55); border: 1px dashed #ccd8d0; border-radius: 18px;
}
.reserved-mark { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 14px; border: 1px solid #cfe4d6; border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); font-size: 18px; font-weight: 600; }
.home-reserved h2 { color: #3a4a40; font-size: 17px; }
.home-reserved p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.home-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.home-footer a { color: inherit; text-decoration: none; }
.home-footer a:hover { color: var(--primary-strong); }

.request-info-box { top: 72px; }           /* profile 请求框下移避开吸顶导航 */

/* ---------- 3. 卡片 ---------- */
.card { background: var(--card); border-radius: 12px; padding: 28px; box-shadow: var(--shadow-card); margin: 0 auto; }
.card.wide { max-width: 100%; }

/* ---------- 4. 基础排版 ---------- */
h2 { margin-bottom: 20px; font-size: 20px; }
h3 { margin: 20px 0 12px; font-size: 16px; color: #333; }
/* 页面标题*/
.quote-title {
  position: relative;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.4;
  padding-bottom: 0.8em;
}
/* 作者出处灰度缩小，右下角 */
.quote-source {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted); /* #999 灰度 */
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ---------- 5. 表单 ---------- */
input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border-2); border-radius: 8px; font-size: 14px; }
label { display: block; margin-bottom: 12px; font-size: 14px; color: #666; }
select { font-size: 14px; }

/* ---------- 6. 按钮体系 ---------- */
.btn-primary { display: block; width: 100%; padding: 12px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 15px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; line-height: 1.4; cursor: pointer; text-decoration: none; background: #f0f2f5; color: #333; transition: .15s; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.btn-primary { width: auto; border-color: var(--primary); background: var(--primary); color: #fff; }
.btn.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); filter: none; }
.btn.btn-save { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.btn-save:hover { background: var(--primary-strong); border-color: var(--primary-strong); filter: none; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #fff; filter: none; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c6c4; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); filter: none; }
.btn-sm { padding: 5px 10px; border-radius: 6px; font-size: 12px; }
.btn-outline.is-favorite { border-color: #e2bd72; background: #fff7e6; color: #8a5b00; }
.btn-outline.is-favorite:hover { border-color: #d99a1b; background: #fffaf0; color: #8a5b00; }
a.disabled { pointer-events: none; opacity: .55; }

.btn-link { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; margin-top: 12px; }
.btn-link.danger:hover { color: #e64340; }

.provider-grid { display: flex; gap: 12px; }
#provider-list { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 8px; margin: 0 auto; padding: 4px 0; min-width: 0; }
.btn-provider { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; padding: 7px 12px; margin: 0; border-radius: 6px; border: 1px solid #ccc; background: #fff; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn-mock { border-color: #9b9b9b; color: #848484; }
.btn-wechat { border-color: var(--primary); color: var(--primary); }
.btn-qq { border-color: #12b7f5; color: #12b7f5; }
.btn-github { border-color: #333; color: #333; }
.btn-google { border-color: #4285f4; color: #4285f4; }
@media (max-width: 360px) { #provider-list { flex-wrap: wrap; justify-content: center; } }

/* ---------- 7. Tab / 通用提示 ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab { flex: 1; padding: 10px; border: none; background: #f0f1f3; border-radius: 8px; cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; margin-top: 8px; }
.info-grid div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.info-grid span { color: var(--muted); }
.identity-list li { padding: 6px 0; font-size: 14px; color: #666; list-style: none; }

.qr-modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 1000; align-items: center; justify-content: center; }
.qr-modal.show { display: flex; }
.qr-modal-box { position: relative; background: #fff; border-radius: 12px; padding: 24px 24px 20px; width: 320px; max-width: 90vw; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); animation: qrPop .25s ease; }
@keyframes qrPop { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.qr-modal-box h3 { margin: 0 0 4px; font-size: 16px; color: #333; }
.qr-modal-box .qr-tip { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.qr-modal-box img { width: 220px; height: 220px; border: 1px solid #eee; border-radius: 8px; background: #fafafa; }
.qr-modal-close { position: absolute; top: 8px; right: 12px; border: none; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.qr-modal-close:hover { color: #333; }
.qr-modal-status { margin-top: 12px; font-size: 13px; color: var(--primary); min-height: 18px; }
.qr-box { text-align: center; }
.qr-box img { width: 200px; height: 200px; border: 1px solid #eee; }

.form-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; min-height: 18px; }
.form-error.shake { animation: shake 0.4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0);} 20%{transform:translateX(-6px);} 40%{transform:translateX(6px);} 60%{transform:translateX(-4px);} 80%{transform:translateX(4px);} }
.form-ok { color: #1a7f37; font-size: .9em; margin: .4em 0 0; }

.verify-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.verify-label { width: 3.5em; color: #888; }
.verify-value { font-weight: bold; }
.verify-value:not(:empty) { margin-right: 4px; }

/* ---------- 8. 文章模块 ---------- */
.article-list-layout, .article-detail-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.article-list-content, .article-detail-main { min-width: 0; }
.article-sidebar { position: sticky; top: 76px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.article-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.article-sidebar h2 { margin: 0; font-size: 1rem; color: var(--text); }
.article-sidebar-section + .article-sidebar-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.article-sidebar-section:empty { display: none; }
.article-sidebar-section:empty + .article-sidebar-section { margin-top: 0; padding-top: 0; border-top: 0; }
.sidebar-tip { margin: 8px 0 14px; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.sidebar-text-btn { padding: 0; border: none; background: none; color: var(--primary); font-size: .8rem; cursor: pointer; }
.sidebar-text-btn:disabled { color: var(--muted); cursor: not-allowed; }
.sidebar-empty { margin: 0; padding: 12px 0; color: var(--muted); font-size: .85rem; text-align: center; }
.tag-filters { display: flex; flex-direction: column; gap: 6px; }
.tag-filter-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; background: #f7f8fa; color: var(--text-2); font-size: .85rem; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.tag-filter-item:hover { border-color: var(--primary); color: var(--primary-strong); }
.tag-filter-item.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.tag-filter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-filter-count { flex: 0 0 auto; margin-left: auto; padding: 1px 7px; border-radius: 10px; background: rgba(0,0,0,.06); color: var(--muted); font-size: .75rem; }
.tag-filter-item.active .tag-filter-count { background: rgba(0,0,0,.08); color: var(--primary-strong); }
.article-search-field { flex: 2 1 260px !important; }
.article-page-size-field { flex: 0 1 130px !important; }
.filter-select { padding: 6px 12px; border: 1px solid var(--border-2); border-radius: 6px; font-size: .875rem; background: #fff; }
.article-cards { gap: 14px; }
.article-card { display: block; padding: 20px 24px; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; background: var(--card); transition: box-shadow .2s, border-color .2s; }
.article-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); border-color: var(--primary); }
.article-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.article-card-title { margin: 0 0 6px; font-size: 1.1rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.article-card-summary { margin: 0 0 10px; font-size: .9rem; color: #666; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-meta { display: flex; align-items: center; gap: 12px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.meta-author { color: var(--primary); font-weight: 500; }

.article-detail-page { padding: 32px 0; }
.article-body .article-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.article-meta { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--muted); margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.article-content { line-height: 1.8; font-size: 1rem; color: #222; }
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 { margin: 1.5em 0 .6em; font-weight: 600; line-height: 1.3; scroll-margin-top: 84px; }
.article-content h1 { font-size: 1.6rem; }
.article-content h2 { font-size: 1.35rem; }
.article-content h3 { font-size: 1.15rem; }
.article-content p { margin: .8em 0; }
.article-content pre { background: #f6f8fa; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: .875rem; line-height: 1.6; }
.article-content code { background: #f0f2f5; padding: 2px 6px; border-radius: 4px; font-size: .875em; }
.article-content pre code { background: none; padding: 0; }
.article-content blockquote { border-left: 4px solid var(--primary); padding: 2px 4px; margin: 0.5em 0; background: #f8f9fb; color: #555; }
.article-content blockquote > :first-child { margin-top: 0; }
.article-content blockquote > :last-child  { margin-bottom: 0; }
.article-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.article-content th, .article-content td { border: 1px solid var(--border-2); padding: 8px 12px; text-align: left; }
.article-content th { background: #f5f7fa; font-weight: 600; }
.article-content ul, .article-content ol { padding-left: 1.5em; margin: .8em 0; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.article-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.article-detail-sidebar .article-actions { flex-direction: column; }
.article-detail-sidebar .article-actions .btn { width: 100%; text-align: center; }
.article-toc { max-height: calc(100vh - 220px); margin-top: 10px; overflow-y: auto; }
.article-toc ul { margin: 0; padding: 0 0 0 14px; list-style: none; }
.article-toc > ul { padding-left: 0; }
.article-toc ul:empty { display: none; }
.article-toc a { display: block; padding: 5px 8px; border-left: 2px solid transparent; color: var(--text-2); font-size: .82rem; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.article-toc a:hover { color: var(--primary-strong); background: #f7f8fa; }
.article-toc a.active { border-left-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }

.comments-section { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.comments-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.comments-heading h2 { margin: 0; font-size: 1.25rem; }
.comment-count { min-width: 24px; padding: 2px 8px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); font-size: .8rem; text-align: center; }
.comment-form { margin-bottom: 24px; }
.comment-form textarea,
.comment-report-box textarea { width: 100%; padding: 12px; border: 1px solid var(--border-2); border-radius: 8px; font: inherit; line-height: 1.6; resize: vertical; outline: none; transition: border-color .2s; }
.comment-form textarea:focus,
.comment-report-box textarea:focus { border-color: var(--primary); }
.comment-form textarea:disabled { background: #f7f8fa; color: var(--muted); cursor: not-allowed; }
.comment-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.comment-login-hint { color: var(--muted); font-size: .85rem; }
.comment-login-hint a { color: var(--primary); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.comment-item:first-child { padding-top: 4px; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-author { color: var(--primary); font-size: .9rem; font-weight: 600; }
.comment-time { color: var(--muted); font-size: .78rem; }
.comment-content { margin: 0; color: #333; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: 14px; margin-top: 8px; }
.comment-action-btn { padding: 0; border: none; background: none; color: var(--muted); font-size: .8rem; cursor: pointer; }
.comment-action-btn:hover { color: var(--primary); text-decoration: underline; }
.comment-action-btn.danger:hover { color: var(--danger); }
.comment-pagination { align-items: center; }
.comment-pagination .page-btn { width: auto; padding: 0 10px; }
.comment-pagination .page-btn:disabled { opacity: .45; cursor: not-allowed; }
.page-info { min-width: 56px; color: var(--muted); font-size: .85rem; text-align: center; }
.comment-report-box { width: 420px; text-align: left; }
.comment-report-box h3 { margin: 0 0 8px; }
.comment-report-box .qr-tip { margin-bottom: 12px; text-align: left; }
.comment-report-box label { margin-bottom: 6px; }
.report-comment-preview { max-height: 120px; margin-bottom: 14px; padding: 10px 12px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: #f7f8fa; color: #555; font-size: .85rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.report-submit-btn { width: 100%; margin-top: 4px; }

@media (max-width: 900px) {
  .article-list-layout, .article-detail-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .tag-filters { flex-direction: row; flex-wrap: wrap; }
  .tag-filter-item { width: auto; }
  .article-toc { max-height: none; }
  .article-detail-sidebar .article-actions { flex-direction: row; }
  .article-detail-sidebar .article-actions .btn { width: auto; }
}

.article-edit-page { padding: 20px 0; }              /* 宽度由 .main 默认档控制，去掉内层 max-width */
.edit-header { margin-bottom: 12px; }
.edit-title-input { width: 100%; font-size: 1.4rem; font-weight: 600; padding: 12px 16px; border: 1px solid var(--border-2); border-radius: 8px; outline: none; transition: border-color .2s; }
.edit-title-input:focus { border-color: var(--primary); }
.edit-toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.edit-tags-input { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--border-2); border-radius: 6px; font-size: .875rem; }
.edit-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 500px; }
@media (max-width: 768px) { .edit-body { grid-template-columns: 1fr; } }
.edit-pane { display: flex; flex-direction: column; }
.pane-label { font-size: .8rem; color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.md-editor { flex: 1; width: 100%; min-height: 400px; padding: 16px; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: .9rem; line-height: 1.6; border: 1px solid var(--border-2); border-radius: 8px; resize: vertical; outline: none; tab-size: 4; }
.md-editor:focus { border-color: var(--primary); }
.preview-pane { flex: 1; min-height: 400px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; overflow-y: auto; background: #fafbfc; }
.edit-footer { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.save-msg { font-size: .85rem; }
.msg-success { color: #22a864; }
.msg-error { color: var(--danger); }

.tag-pill { display: inline-block; padding: 2px 8px; font-size: .75rem; background: var(--primary-soft); color: var(--primary-strong); border-radius: 4px; }

.pagination { margin-top: 24px; display: flex; justify-content: center; gap: 6px; }
.page-btn { width: 32px; height: 32px; border: 1px solid var(--border-2); border-radius: 6px; background: #fff; cursor: pointer; font-size: .85rem; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:hover:not(.active) { border-color: var(--primary); }
.loading-text, .empty-text, .error-text, .placeholder-text { text-align: center; padding: 32px; color: var(--muted); }
.error-text { color: var(--danger); }

/* ---------- 9. 权限管理后台（静态骨架样式） ---------- */
.admin-card { max-width: 100%; }
.admin-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.admin-kw { flex: 1; min-width: 180px; }
.field { padding: 6px 10px; border: 1px solid var(--border-2); border-radius: 6px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); color: #666; font-weight: 600; }
.admin-table td { padding: 8px 6px; border-bottom: 1px solid #f0f2f4; }
.role-badge { display: inline-block; background: var(--primary-soft); color: var(--primary-strong); border-radius: 10px; padding: 1px 8px; margin: 1px; font-size: 12px; }

/* ---------- 10. 无权访问提示页 ---------- */
.np-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 24px; }
.np-card { max-width: 420px; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.06); padding: 36px 30px; text-align: center; }
.np-icon { font-size: 40px; line-height: 1; margin-bottom: 14px; }
.np-title { margin: 0 0 10px; font-size: 20px; color: var(--text); }
.np-desc { margin: 0 0 18px; color: #666; font-size: 14px; line-height: 1.7; }
.np-perm { background: #f7f8fa; border-radius: 10px; padding: 12px 14px; margin-bottom: 22px; text-align: left; }
.np-perm-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.np-perm-list { display: flex; flex-wrap: wrap; gap: 6px; }
.np-perm-tag { display: inline-block; background: #eef1f6; color: #5a6472; border-radius: 6px; padding: 3px 8px; font-size: 12px; font-family: monospace; }
.np-actions { display: flex; gap: 12px; justify-content: center; }

/* ---------- 11. 题库 / 试卷公共组件 ---------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { margin: 0 0 6px; font-size: 26px; line-height: 1.25; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.page-actions, .card-actions, .form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 16px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.filter-toolbar > label { flex: 1 1 150px; min-width: 0; margin: 0; color: var(--text-2); font-size: 12px; }
.filter-toolbar > .page-actions { flex: 0 0 auto; margin-left: auto; flex-wrap: nowrap; }
.filter-toolbar input, .filter-toolbar select { width: 100%; min-width: 0; margin: 5px 0 0; padding: 9px 10px; border: 1px solid var(--border-2); border-radius: 7px; background: #fff; }
.filter-toolbar .check-label { display: flex; align-items: center; gap: 7px; min-height: 38px; white-space: nowrap; }
.filter-toolbar .check-label input { width: auto; margin: 0; }
.result-meta { display: flex; justify-content: space-between; gap: 12px; margin: 0 2px 12px; color: var(--muted); font-size: 13px; }
.exam-list { display: grid; gap: 14px; }
.exam-card { min-width: 0; padding: 18px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.exam-card:hover { border-color: #c9ddd2; box-shadow: 0 4px 16px rgba(0,0,0,.05); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-title { margin: 0; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--primary-strong); }
.card-code { margin-top: 4px; color: var(--muted); font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.card-summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0f2f4; flex-wrap: wrap; }
.badge-row, .tag-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 5px; background: #eef1f6; color: #5a6472; font-size: 12px; line-height: 1.4; white-space: nowrap; }
.badge-type { background: #eaf2ff; color: #3267b2; }
.badge-status-published { background: var(--primary-soft); color: var(--primary-strong); }
.badge-status-draft { background: #fff4df; color: #9a6700; }
.badge-status-archived, .badge-review, .badge-wrong { background: #fdebec; color: #b42318; }
.badge-status-submitted { background: var(--primary-soft); color: var(--primary-strong); }
.badge-attempted { background: #eaf2ff; color: #3267b2; }
.badge-level { background: #f3edff; color: #6941c6; }
.tag-pill { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-text { color: var(--muted); font-size: 12px; }
.state-box { padding: 42px 20px; text-align: center; background: var(--card); border: 1px dashed var(--border-2); border-radius: var(--radius); color: var(--muted); }
.state-box h3 { margin: 0 0 8px; color: var(--text-2); }
.state-box p { margin-bottom: 16px; line-height: 1.6; }
.state-box.error-state { color: var(--danger); border-color: #f3c6c4; }
.loading-state::before { content: ''; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border: 3px solid #e6e8eb; border-top-color: var(--primary); border-radius: 50%; animation: examSpin .8s linear infinite; }
@keyframes examSpin { to { transform: rotate(360deg); } }
.pagination { flex-wrap: wrap; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

.question-detail, .paper-detail { padding: 22px 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.question-stem { margin: 18px 0; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-block { margin: 16px 0; padding: 16px; overflow-x: auto; border-radius: 8px; background: #f6f8fa; color: #24292f; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; white-space: pre; }
.question-images { display: grid; gap: 12px; margin: 16px 0; }
.question-images img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }
.option-list { display: grid; gap: 8px; margin: 16px 0; padding: 0; list-style: none; counter-reset: option; }
.option-list li { position: relative; min-width: 0; padding: 11px 14px 11px 48px; border: 1px solid var(--border); border-radius: 8px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; counter-increment: option; }
.option-list li::before { content: counter(option, upper-alpha); position: absolute; left: 14px; top: 11px; color: var(--primary-strong); font-weight: 700; }
.answer-panel { margin-top: 24px; padding: 18px; border-left: 4px solid var(--primary); border-radius: 6px; background: #f7fbf9; }
.answer-panel h3 { margin-top: 0; }
.answer-panel p { margin: 8px 0; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.internal-note { margin-top: 16px; padding: 12px 14px; border-radius: 7px; background: #fff8e8; color: #7a5b16; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.section-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.section-nav a { padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text-2); text-decoration: none; font-size: 13px; }
.section-nav a:hover { border-color: var(--primary); color: var(--primary-strong); }
.paper-section { margin-top: 26px; scroll-margin-top: 76px; }
.paper-section > h2 { padding-bottom: 10px; border-bottom: 2px solid var(--primary-soft); }
.paper-question { padding: 16px 0; border-bottom: 1px solid var(--border); }
.paper-question:last-child { border-bottom: 0; }
.paper-question-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.paper-question-stem { line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.development-notice { margin: 16px 0; padding: 12px 14px; border: 1px solid #f0d79b; border-radius: 8px; background: #fff9e9; color: #7a5b16; line-height: 1.6; }
.lock-notice { margin: 16px 0; padding: 12px 14px; border: 1px solid #f3c6c4; border-radius: 8px; background: #fff5f5; color: #b42318; line-height: 1.6; }

/* 紧凑试卷卡片与右侧操作区 */
.paper-card-compact { padding: 12px 14px; }
.paper-card-compact .card-heading { align-items: center; margin-bottom: 6px; }
.paper-card-compact .card-title { font-size: 15px; }
.paper-card-compact .card-code { font-size: 11px; }
.paper-card-compact .card-summary { -webkit-line-clamp: 1; margin: 4px 0; font-size: 13px; }
.paper-card-compact .card-footer { align-items: center; margin-top: 8px; padding-top: 8px; }
.paper-card-actions { flex: 0 0 auto; flex-wrap: nowrap; margin-left: auto; }

/* 我的考卷 */
.paper-attempt-card .card-heading { align-items: center; }
.paper-attempt-card .card-summary { -webkit-line-clamp: 2; }
.paper-attempt-card .card-footer .badge-row { min-width: 0; }
.paper-attempt-card .card-footer .meta-text { overflow-wrap: anywhere; }

/* 练习 / 考试 / 查看 */
.practice-meta, .mode-notice { margin: 14px 0; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text-2); font-size: 13px; line-height: 1.6; }
.answer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.question-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.answer-controls { margin: 18px 0; }
.answer-options { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.answer-options legend { margin-bottom: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.option-choice { display: flex; justify-content: flex-start; align-items: flex-start; gap: 9px; margin: 0; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; line-height: 1.6; text-align: left; cursor: pointer; }
.option-choice:hover { border-color: var(--primary); }
.option-choice input[type="radio"] { flex: 0 0 auto; width: 16px; height: 16px; margin: 3px 0 0; padding: 0; border: 0; }
.option-choice .option-letter { flex: 0 0 22px; min-width: 22px; color: var(--primary-strong); font-weight: 700; text-align: left; }
.option-choice .option-text { flex: 1 1 auto; min-width: 0; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.option-choice.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.option-choice.is-correct { border-color: #86c9a7; background: #ecf8f1; }
.option-choice.is-wrong { border-color: #f0a9a4; background: #fff1f0; }
.option-choice:has(input:disabled) { cursor: default; }
.answer-field { display: grid; gap: 8px; color: var(--text-2); font-size: 13px; }
.field-label { font-weight: 600; }
.answer-textarea { width: 100%; min-height: 190px; padding: 12px 14px; resize: vertical; border: 1px solid var(--border-2); border-radius: 8px; background: #fff; color: var(--text); font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
.answer-code { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 6px; background: #f6f8fa; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.result-score { color: var(--text-2); font-weight: 600; }
.answer-panel.result-correct { border-left-color: var(--primary); background: #f0faf4; }
.answer-panel.result-wrong { border-left-color: var(--danger); background: #fff5f4; }
.answer-panel.result-pending { border-left-color: #d99a1b; background: #fffaf0; }

.attempt-toolbar { position: sticky; top: 64px; z-index: 12; display: flex; align-items: center; gap: 14px; margin: 16px 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: 0 4px 16px rgba(0,0,0,.05); }
.exam-timer { min-width: 118px; color: var(--primary-strong); font-weight: 700; }
.exam-timer.timer-danger { color: var(--danger); }
.exam-progress { flex: 1; color: var(--text-2); font-size: 13px; }
.attempt-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.attempt-layout .paper-detail { padding: 0; border: 0; background: transparent; }
.attempt-sidebar { position: sticky; top: 132px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.question-nav-group + .question-nav-group { margin-top: 16px; }
.question-nav-group h3 { margin: 0 0 8px; color: var(--text-2); font-size: 13px; }
.question-nav-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.question-status-legend { display: flex; flex-wrap: wrap; gap: 6px 9px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend-marker { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--border-2); border-radius: 4px; background: #fff; font-size: 10px; font-weight: 700; }
.question-nav-btn { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid var(--border-2); border-radius: 6px; background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer; }
.question-nav-state { position: absolute; top: 1px; right: 3px; font-size: 9px; line-height: 1; font-weight: 700; pointer-events: none; }
.question-nav-doubt { position: absolute; right: 1px; bottom: 1px; display: none; place-items: center; width: 12px; height: 12px; border-radius: 50%; background: #d99a1b; color: #fff; font-size: 9px; line-height: 1; font-weight: 700; pointer-events: none; }
.question-nav-btn.is-doubtful .question-nav-doubt { display: grid; }
.question-nav-btn:hover, .question-nav-btn.is-current { border-color: var(--primary); color: var(--primary-strong); }
.question-nav-btn.is-answered { border-color: #9dc9b2; background: var(--primary-soft); color: var(--primary-strong); }
.question-nav-btn.is-saving { border-color: #e2bd72; background: #fff7e6; color: #8a5b00; }
.question-nav-btn.is-save-error { border-color: #e88e87; background: #fff0ef; color: var(--danger); }
.question-nav-btn.is-correct { border-color: var(--primary); background: var(--primary); color: #fff; }
.question-nav-btn.is-wrong { border-color: #e88e87; background: #fff0ef; color: var(--danger); }
.question-nav-btn.is-pending { border-color: #e2bd72; background: #fff7e6; color: #8a5b00; }
.question-nav-btn.is-current { box-shadow: 0 0 0 2px var(--primary-soft); }
.legend-marker.is-unanswered { color: var(--muted); }
.legend-marker.is-answered { border-color: #9dc9b2; background: var(--primary-soft); color: var(--primary-strong); }
.legend-marker.is-saving, .legend-marker.is-pending { border-color: #e2bd72; background: #fff7e6; color: #8a5b00; }
.legend-marker.is-doubtful { border-color: #e2bd72; background: #fff7e6; color: #8a5b00; }
.legend-marker.is-save-error, .legend-marker.is-wrong { border-color: #e88e87; background: #fff0ef; color: var(--danger); }
.legend-marker.is-correct { border-color: var(--primary); background: var(--primary); color: #fff; }
.attempt-question { scroll-margin-top: 148px; margin-bottom: 14px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.attempt-question .paper-question-head { margin-bottom: 12px; }
.save-state { margin-left: auto; color: var(--muted); font-size: 12px; }
.save-state.save-ok { color: var(--primary-strong); }
.save-state.save-error { color: var(--danger); }
.save-state.save-pending { color: #9a6700; }
.doubtful-toggle { margin-left: 4px; }
.doubtful-toggle.is-doubtful { border-color: #d99a1b; background: #fff7e6; color: #8a5b00; }
.doubtful-toggle.is-doubtful:hover { border-color: #d99a1b; background: #fffaf0; color: #8a5b00; }
.attempt-item-result { margin-top: 20px; }
.review-answer { margin-top: 20px; }
.score-overview { margin: 18px 0; padding: 20px 22px; border: 1px solid #b9ddc8; border-radius: 12px; background: linear-gradient(135deg, #f2fbf5, #fff); }
.score-overview h2 { margin: 0 0 8px; font-size: 20px; }
.score-main { color: var(--primary-strong); font-size: 26px; font-weight: 700; }
.score-overview p { margin: 8px 0 0; color: var(--text-2); line-height: 1.6; }
.score-stats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--text-2); font-size: 13px; }

.form-card { padding: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-grid label { margin-bottom: 14px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; margin: 6px 0 0; padding: 10px 11px; border: 1px solid var(--border-2); border-radius: 7px; font: inherit; background: #fff; }
.form-grid textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.form-grid input[readonly] { background: #f5f6f8; color: var(--muted); }
.form-grid .check-label { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.form-grid .check-label input { width: auto; margin: 0; }
.field-error { min-height: 18px; margin: 4px 0 0; color: var(--danger); font-size: 12px; }
.form-error-summary { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #f3c6c4; border-radius: 7px; background: #fff5f5; color: #b42318; font-size: 13px; line-height: 1.6; }
.options-editor { display: grid; gap: 8px; margin-top: 8px; }
.option-edit-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.option-letter { color: var(--primary-strong); font-weight: 700; text-align: center; }
.option-edit-row input { margin: 0; }
.sticky-form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 22%); }

.composer-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.question-picker { position: sticky; top: 76px; padding: 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.question-picker h2 { margin-bottom: 12px; font-size: 17px; }
.picker-results { display: grid; gap: 8px; max-height: 560px; overflow-y: auto; }
.picker-item { padding: 11px; border: 1px solid var(--border); border-radius: 7px; }
.picker-item p { margin: 7px 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer-sections { display: grid; gap: 14px; }
.composer-section { padding: 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.section-heading label { margin: 0; }
.section-heading input { margin: 5px 0 0; }
.composer-question { display: grid; grid-template-columns: auto minmax(0, 1fr) 90px auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.composer-question-main { min-width: 0; }
.composer-question-main p { margin-top: 4px; color: var(--text-2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer-question input { margin: 0; }
.composer-question select { width: auto; max-width: 100%; margin-top: 7px; padding: 4px 6px; border: 1px solid var(--border-2); border-radius: 5px; background: #fff; }
.move-buttons { display: flex; gap: 4px; }
.icon-btn { width: 32px; height: 32px; padding: 0; border: 1px solid var(--border-2); border-radius: 6px; background: #fff; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary-strong); }
.total-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 1200; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 8px; background: #24292f; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; line-height: 1.5; }
.toast.error { background: #b42318; }
.toast.success { background: #067647; }

:where(button, a, input, select, textarea):focus-visible { outline: 3px solid rgba(7,193,96,.28); outline-offset: 2px; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }

@media (max-width: 980px) {
  .home-hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 420px; }
  .stat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-item { padding: 20px 16px; }
  .stat-item:nth-child(odd) { border-right: 1px solid #edf0ed; }
  .stat-item:nth-last-child(-n+2) { border-bottom: 0; }
  .composer-layout { grid-template-columns: 1fr; }
  .question-picker { position: static; }
  .picker-results { max-height: 320px; }
  .attempt-layout { grid-template-columns: 1fr; }
  .attempt-sidebar { position: static; display: flex; gap: 16px; max-height: none; overflow-x: auto; }
  .question-status-legend { flex: 0 0 150px; align-content: center; margin: 0; padding: 0 12px 0 0; border-right: 1px solid var(--border); border-bottom: 0; }
  .question-nav-group { min-width: 150px; }
  .question-nav-grid { grid-template-columns: repeat(5, 30px); }
  .attempt-toolbar { top: 56px; flex-wrap: wrap; }
  .paper-card-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 680px) {
  .main { padding: 18px 12px 32px; }
  .main.home-page { padding: 18px 12px; }
  .home-shell { min-height: calc(100vh - 92px); }
  .hero-copy { min-height: 0; padding: 30px 22px; border-radius: 16px; }
  .hero-copy h1 { font-size: 38px; letter-spacing: -1.2px; }
  .hero-description { font-size: 14px; line-height: 1.8; }
  .hero-actions .btn { flex: 1; padding: 10px 12px; }
  .hero-meta { gap: 8px; }
  .hero-stats { padding: 22px 18px; border-radius: 16px; }
  .stat-value { font-size: 28px; }
  .home-reserved { min-height: 180px; margin-top: 16px; }
  .home-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
  .page-title { font-size: 22px; }
  .filter-toolbar > label { flex-basis: 100%; }
  .filter-toolbar > .page-actions { flex: 1 1 100%; margin-left: 0; }
  .filter-toolbar > .page-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full-width { grid-column: auto; }
  .card-heading, .card-footer { align-items: flex-start; }
  .question-detail, .paper-detail, .form-card, .composer-section { padding: 16px; }
  .answer-actions { align-items: stretch; flex-direction: column; }
  .question-nav { flex-wrap: wrap; }
  .question-nav .meta-text { order: -1; flex-basis: 100%; text-align: center; }
  .attempt-question { padding: 16px; scroll-margin-top: 132px; }
  .paper-card-actions .btn { flex: 1; }
  .paper-attempt-card .card-footer { align-items: stretch; flex-direction: column; }
  .paper-attempt-card .card-footer > .btn { width: 100%; }
  .section-heading { grid-template-columns: minmax(0, 1fr) 74px auto; }
  .composer-question { grid-template-columns: minmax(0, 1fr) 76px auto; }
  .composer-question > .badge { display: none; }
  .sticky-form-actions { justify-content: stretch; }
  .sticky-form-actions .btn { flex: 1; }
}
