/**
 * @Author zF.
 * @ProjectName liantibang
 * @Description 前台考试样式 - 布局、刷题、模拟考试与成绩回顾
 */

/* ==================== 前台顶部导航 ==================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 56px;
    padding: 0 24px;
    background: #fcfbf7;
    border-bottom: 1px solid #e6e1d6;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

.brand:hover {
    color: #34694e;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #34694e;
    flex-shrink: 0;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.topnav > a {
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    transition: background-color .15s, color .15s;
}

.topnav > a:hover {
    background: #f3f4f6;
    color: #111827;
}

.topnav > a.active {
    background: #ecf2ec;
    color: #2a5740;
    font-weight: 600;
}

.topnav form.inline {
    display: inline-flex;
}

.topnav-brand-sub {
    display: block;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.topbar .admin-avatar-logo.is-avatar,
.topbar .admin-avatar .is-avatar {
    filter: none;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ==================== 前台头像下拉（书卷主题适配，覆写后台同款组件） ==================== */
.topbar .admin-dropdown-toggle {
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: #f6f2e8;
    border-color: #e6e1d6;
}

.topbar .admin-dropdown-toggle:hover {
    background: #efeadd;
    border-color: #d8d2c2;
    box-shadow: 0 2px 10px rgba(52, 105, 78, 0.14);
}

.topbar .admin-avatar {
    width: 28px;
    height: 28px;
    background: #34694e;
}

.topbar .admin-avatar-logo {
    width: 16px;
    height: 16px;
}

.topbar .admin-name {
    color: #374151;
}

.topbar .nav-dropdown-icon {
    color: #a89f8d;
}

.topbar .admin-dropdown-menu {
    width: 160px;
    padding: 6px;
    background: #fffdf8;
    border-color: #e6e1d6;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(52, 105, 78, 0.15);
}

.topbar .dropdown-item {
    padding: 8px 10px;
    border-radius: 8px;
    color: #374151;
    font-size: 13px;
}

.topbar .dropdown-item i {
    font-size: 15px;
}

.topbar .dropdown-item:hover {
    color: #2a5740;
    background: #ecf2ec;
}

.topbar .dropdown-item-danger:hover {
    color: #dc2626;
    background: #fbeae9;
}

.topbar .dropdown-divider {
    height: 1px;
    margin: 4px 3px;
    background: #eee9dd;
}

.show-mobile-only {
    display: none;
}

/* ==================== 前台主区与容器 ==================== */
.user-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    min-height: calc(100vh - 56px);
}

.user-container {
    width: 100%;
}

.user-container-narrow {
    max-width: 760px;
    margin: 0 auto;
}

.site-footer {
    padding: 18px 20px 22px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

/* ==================== 移动端底部导航 ==================== */
.mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 7px;
    font-size: 11px;
    color: #9ca3af;
}

.tabbar-item i {
    font-size: 21px;
    line-height: 1;
}

.tabbar-item.active {
    color: #2a5740;
    font-weight: 600;
}

/* ==================== 书卷教育主题（练题帮前台） ====================
   米白纸底、松绿主色、暖灰线条；前台限定，后台不受影响。 */
:root {
    --lb-paper: #f6f4ee;
    --lb-card: #fcfbf7;
    --lb-ink: #292524;
    --lb-muted: #8a8378;
    --lb-line: #e6e1d6;
    --lb-green: #34694e;
    --lb-green-deep: #2a5740;
    --lb-green-soft: #ecf2ec;
    --lb-green-line: #c9d9cc;
}

.user-page {
    background: var(--lb-paper);
    --primary-color: var(--lb-green);
}

/* ==================== 首页组件 ==================== */
.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 26px 28px;
    border-radius: 14px;
    background: var(--lb-card);
    border: 1px solid var(--lb-line);
    color: var(--lb-ink);
}

.welcome-panel h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--lb-ink);
}

.welcome-panel p {
    margin: 0;
    font-size: 13px;
    color: var(--lb-muted);
}

.welcome-panel .pf-btn {
    background: var(--lb-green);
    color: #fff;
    border-color: var(--lb-green);
    flex-shrink: 0;
}

.welcome-panel .pf-btn:hover {
    background: var(--lb-green-deep);
    border-color: var(--lb-green-deep);
    color: #fff;
}

.quick-entry-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.quick-entry-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    font: inherit;
}

.quick-entry-card:hover {
    border-color: var(--lb-green-line);
    box-shadow: 0 6px 16px rgba(52, 105, 78, .10);
    transform: translateY(-2px);
}

.quick-entry-icon {
    font-size: 24px;
    line-height: 1;
}

.quick-entry-blue { color: var(--lb-green); }
.quick-entry-green { color: var(--lb-green); }
.quick-entry-amber { color: #b45309; }
.quick-entry-violet { color: var(--lb-green); }

.quick-entry-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.quick-entry-sub {
    font-size: 12px;
    color: #9ca3af;
}

/* ==================== 分类网格 ==================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.category-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}

.category-card:hover {
    border-color: var(--lb-green-line);
    box-shadow: 0 6px 16px rgba(52, 105, 78, .08);
}

.category-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--lb-green-soft);
    color: var(--lb-green);
    font-size: 21px;
    flex-shrink: 0;
}

.category-meta {
    min-width: 0;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-count {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}

.category-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--lb-line);
    overflow: hidden;
}

.category-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-progress-row .category-progress-bar {
    flex: 1;
    min-width: 0;
}

.category-progress-percent {
    flex-shrink: 0;
    font-size: 12px;
    color: #6b7280;
}

.category-progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--lb-green);
    transition: width .5s ease;
}

.category-progress-text {
    font-size: 12px;
    color: #6b7280;
}

/* ==================== 个人资料页 ==================== */
/* 移动端 APP 风格头卡与功能入口（display 由 ≤768px 断点开启） */
.profile-app-head {
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    background: linear-gradient(135deg, #eaf2e7, #f7f4ea);
    border: 1px solid var(--lb-line);
    border-radius: 14px;
    margin-bottom: 14px;
}

.profile-app-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--lb-green);
    flex-shrink: 0;
}

.profile-app-avatar img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.profile-app-avatar img.is-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

/* 头卡右侧荣誉区：头衔胶囊在上、勋章图标行在下，靠右对齐 */
.profile-app-honors {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: auto;
    min-width: 0;
}

.profile-app-title {
    max-width: 100%;
}

.profile-app-medals {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-app-medals .badge-chip {
    min-height: 24px;
}

.honor-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex: 0 0 26px;
    background: #fff;
    border: 1px solid #dbe3ef;
    box-shadow: 0 1px 3px rgba(31, 46, 38, .08);
}

.honor-medal i {
    font-size: 14px;
    line-height: 1;
}

/* 稀有度作用于图标色（白底描边圆，对齐 style.css 的 badge-chip 配色） */
.honor-medal-normal i { color: #2563eb; }
.honor-medal-rare i { color: #4f46e5; }
.honor-medal-epic i { color: #7c3aed; }
.honor-medal-legendary i { color: #d97706; }

.honor-medal-more {
    width: auto;
    flex: 0 0 auto;
    padding: 0 8px;
    border-radius: 999px;
    color: #5b6b7c;
    font-size: 11px;
    font-weight: 700;
}

.profile-app-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.profile-app-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--lb-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-app-id {
    font-size: 12px;
    color: var(--lb-muted);
}

.profile-app-cells {
    background: #fff;
    border: 1px solid var(--lb-line);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}

.profile-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px dashed var(--lb-line);
    cursor: pointer;
    transition: background-color .15s;
}

.profile-cell:last-child {
    border-bottom: none;
}

.profile-cell:active {
    background: #f4f1e9;
}

.profile-cell-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #e7efe4;
    color: var(--lb-green);
    font-size: 19px;
    flex-shrink: 0;
}

.profile-cell-icon-warn {
    background: #f6ead9;
    color: #b5772a;
}

.profile-cell-icon-info {
    background: #eaf2ff;
    color: #3f65d8;
}

/* 关于页：居中品牌区 + 版本行 + 版权 */
.profile-about {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 16px 6px;
    text-align: center;
}

.profile-about-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--lb-green);
    margin-bottom: 12px;
}

.profile-about-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.profile-about-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--lb-ink);
}

.profile-about-slogan {
    margin-top: 4px;
    font-size: 12px;
    color: var(--lb-muted);
}

.profile-about-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--lb-line);
    font-size: 13px;
    color: #374151;
}

.profile-about-row span:last-child {
    color: var(--lb-muted);
}

/* 相邻信息行成组：仅组首行保留分隔虚线 */
.profile-about-row + .profile-about-row {
    border-top: none;
    margin-top: 0;
    padding-top: 6px;
}

.profile-about-copy {
    margin-top: 14px;
    font-size: 12px;
    color: var(--lb-muted);
}

.profile-cell-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-cell-body b {
    font-size: 15px;
    font-weight: 600;
    color: var(--lb-ink);
}

.profile-cell-body small {
    font-size: 12px;
    color: var(--lb-muted);
}

.profile-cell-arrow {
    margin-left: auto;
    font-size: 18px;
    color: #c9c1b2;
}

.profile-logout-form {
    margin-top: 16px;
}

.profile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #ead5d0;
    color: #b5483a;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s;
}

.profile-logout-btn:active {
    background: #fdf3f1;
}

/* PC 只读概览行 */
.profile-rows {
    padding: 2px 0;
}

.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 2px;
    border-bottom: 1px dashed var(--lb-line);
    font-size: 14px;
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row-label {
    color: var(--lb-muted);
    flex-shrink: 0;
}

.profile-row-value {
    color: var(--lb-ink);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.profile-row-value.is-empty {
    color: #c2bcae;
    font-weight: 400;
}

.profile-hint {
    font-size: 13px;
    line-height: 1.7;
    color: var(--lb-muted);
}

/* ==================== 空状态提示 ==================== */
.empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 46px 16px;
    color: #9ca3af;
    text-align: center;
}

.empty-hint i {
    font-size: 40px;
    line-height: 1;
    color: #d1d5db;
}

.empty-hint p {
    margin: 0;
    font-size: 13px;
}

/* ==================== 刷题中心入口 ==================== */
.entry-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.entry-duo-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.entry-duo-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.entry-duo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    font-size: 21px;
    flex-shrink: 0;
}

.entry-duo-amber .entry-duo-icon { background: #f6ead9; color: #b45309; }
.entry-duo-violet .entry-duo-icon { background: var(--lb-green-soft); color: var(--lb-green); }

.entry-duo-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.entry-duo-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}

/* ==================== 按钮变体补充 ==================== */
.pf-btn-warning {
    background: #d97706;
    color: #fff;
    border-color: #d97706;
}

.pf-btn-warning:hover {
    background: #b45309;
    border-color: #b45309;
    color: #fff;
}

/* ==================== 答题房间框架 ==================== */
.page-room .topbar {
    display: none;
}

.page-room .user-main {
    padding: 0;
    min-height: 0;
}

.page-room .site-footer {
    display: none;
}

.room-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f5f6f8;
}

.room-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.room-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: #f3f4f6;
    color: #373151;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.room-back:hover {
    background: #e5e7eb;
}

.room-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-counter {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    flex-shrink: 0;
}

.room-counter b,
.room-counter span {
    color: #2563eb;
}

.room-counter-center {
    font-size: 13px;
}

.room-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.room-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.room-progress-row .room-progress {
    flex: 1;
    min-width: 0;
}

.room-progress-percent {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--lb-muted);
}

.room-progress {
    height: 5px;
    border-radius: 999px;
    background: var(--lb-line);
    overflow: hidden;
}

.room-progress-bar {
    height: 100%;
}

.room-progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--lb-green);
    transition: width .3s ease;
}

.room-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.room-tool {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    border: none;
    background: none;
    color: #6b7280;
    font-size: 11px;
    cursor: pointer;
}

.room-tool i {
    font-size: 19px;
    line-height: 1;
}

.room-tool:hover,
.room-tool.active {
    color: #2563eb;
}

.room-tool.is-favorited {
    color: #f59e0b;
}

.room-tool:disabled {
    opacity: .45;
    cursor: default;
}

.room-next {
    min-width: 96px;
}

/* ==================== 题目面板 ==================== */
.question-panel {
    max-width: 760px;
    margin: 0 auto;
}

.q-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.q-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.q-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
}

.q-type {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

.q-mark-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 4px 9px;
    border: none;
    border-radius: 8px;
    background: none;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
}

.q-mark-btn i {
    font-size: 15px;
}

.q-mark-btn:hover {
    background: #fffbeb;
    color: #d97706;
}

.q-mark-btn.is-marked {
    color: #f59e0b;
}

.q-stem {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.7;
    color: #111827;
    margin-bottom: 18px;
    word-break: break-word;
    white-space: pre-wrap;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
    font-size: 15px;
    line-height: 1.55;
    color: #373151;
    word-break: break-word;
}

.q-option:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.q-option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.q-option-text {
    flex: 1;
}

.q-option.is-picked {
    border-color: #3b82f6;
    background: #eff6ff;
}

.q-option.is-picked .q-option-key {
    background: #3b82f6;
    color: #fff;
}

.q-option.is-right {
    border-color: #22c55e;
    background: #f0fdf4;
}

.q-option.is-right .q-option-key {
    background: #22c55e;
    color: #fff;
}

.q-option.is-wrong {
    border-color: #ef4444;
    background: #fef2f2;
}

.q-option.is-wrong .q-option-key {
    background: #ef4444;
    color: #fff;
}

.q-option.is-muted {
    opacity: .62;
}

.q-option .q-option-flag {
    display: none;
    align-self: center;
    font-size: 17px;
    flex-shrink: 0;
}

.q-option.is-right .q-option-flag {
    display: inline;
    color: #16a35a;
}

.q-option.is-wrong .q-option-flag {
    display: inline;
    color: #ef4444;
}

.q-option.is-disabled {
    cursor: default;
}

/* 填空与简答 */
.q-blank-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.q-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #111827;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 11px;
    outline: none;
    transition: border-color .15s;
    font: inherit;
}

.q-input:focus {
    border-color: #3b82f6;
}

.q-input:disabled {
    background: #f9fafb;
    color: #6b7280;
}

.q-essay-answer {
    display: none;
    padding: 14px 16px;
    border-radius: 11px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 14px;
    line-height: 1.7;
    color: #14532d;
    white-space: pre-wrap;
    word-break: break-word;
}

.q-essay-answer.show {
    display: block;
}

.q-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* 判分结果与解析 */
.q-result {
    display: none;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
}

.q-result.show {
    display: flex;
}

.q-result.is-right {
    background: #f0fdf4;
    color: #15803d;
}

.q-result.is-wrong {
    background: #fef2f2;
    color: #dc2626;
}

.q-result .q-result-text b {
    color: inherit;
    word-break: break-word;
}

.q-analysis {
    display: none;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 11px;
    background: #eff6ff;
    font-size: 14px;
    line-height: 1.7;
    color: #1e40af;
    white-space: pre-wrap;
    word-break: break-word;
}

.q-analysis.show {
    display: block;
}

.q-analysis-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.q-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 760px;
    margin: 14px auto 0;
}

.q-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #373151;
    font-size: 14px;
    cursor: pointer;
}

.q-nav-btn:hover {
    border-color: #93c5fd;
    color: #2563eb;
}

.q-nav-btn:disabled {
    opacity: .45;
    cursor: default;
}

/* ==================== 底部抽屉（答题卡等） ==================== */
.sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(17, 24, 39, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.sheet-mask.open {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    max-width: 760px;
    z-index: 90;
    background: #fff;
    border-radius: 18px 18px 0 0;
    transform: translateY(102%);
    transition: transform .25s ease;
    max-height: 72vh;
    display: flex;
    flex-direction: column;
}

.sheet.open {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px 10px;
    flex-shrink: 0;
}

.sheet-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 9px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 17px;
    cursor: pointer;
}

.sheet-body {
    padding: 4px 18px 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
}

.card-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #6b7280;
}

.card-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e5e7eb;
}

.dot-current { background: #3b82f6; }
.dot-done { background: #22c55e; }
.dot-mark { background: #f59e0b; }
.dot-wrong { background: #ef4444; }
.dot-undone { background: #e5e7eb; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.card-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.card-item:hover {
    border-color: #93c5fd;
}

.card-item.is-current {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #2563eb;
}

.card-item.is-done {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #16a35a;
}

.card-item.is-right {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #16a35a;
}

.card-item.is-wrong {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

/* 当前题永远保持蓝色（权重最高），答对/答错状态在切走后恢复展示 */
.card-item.is-current.is-done,
.card-item.is-current.is-right,
.card-item.is-current.is-wrong {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #2563eb;
}

/* 考试结果页答题卡：对错分布导航，点击定位到对应题目 */
.result-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 10px;
    margin: 14px 0 20px;
}

.result-sheet .card-item {
    text-decoration: none;
    font-weight: 600;
}

.card-item.is-marked::after {
    content: '';
    position: relative;
}

.card-item.is-marked {
    position: relative;
}

.card-item.is-marked::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
}

/* ==================== 考试房间 ==================== */
.exam-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.exam-timer i {
    font-size: 16px;
}

.exam-timer.warn {
    background: #ef4444;
    animation: exam-timer-blink 1s ease infinite;
}

@keyframes exam-timer-blink {
    50% { opacity: .72; }
}

/* ==================== 考试中心 ==================== */
.ongoing-icon {
    color: #d97706;
    margin-right: 4px;
}

.ongoing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    border: 1px dashed #fcd34d;
    border-radius: 11px;
    background: #fffbeb;
    margin-bottom: 10px;
}

.ongoing-item:last-child {
    margin-bottom: 0;
}

.ongoing-name {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.ongoing-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #b45309;
}

.paper-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.paper-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}

.paper-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .08);
}

.paper-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paper-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #dcfce7;
    color: #16a35a;
    font-size: 21px;
    flex-shrink: 0;
}

.paper-meta {
    min-width: 0;
}

.paper-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paper-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}

.paper-props {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12px;
    color: #6b7280;
}

.paper-props i {
    margin-right: 3px;
    color: #9ca3af;
}

.paper-stat {
    font-size: 12px;
    color: #9ca3af;
}

/* ==================== 成绩结果页 ==================== */
.result-hero {
    text-align: center;
}

.result-passed {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #f0fdf4, #fff);
}

.result-failed {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fef2f2, #fff);
}

.score-ring {
    width: 150px;
    height: 150px;
    margin: 4px auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-ring-inner {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
}

.score-value {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    color: #111827;
}

.score-unit {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.result-verdict {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-passed .result-verdict { color: #15803d; }
.result-failed .result-verdict { color: #dc2626; }

.result-line {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 26px;
    margin-bottom: 12px;
}

.result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.result-stat-value {
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.result-correct { color: #16a35a; }
.result-wrong { color: #ef4444; }

.result-stat-label {
    font-size: 12px;
    color: #9ca3af;
}

.result-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.result-actions {
    display: flex;
    justify-content: center;
}

/* ==================== 逐题回顾 ==================== */
.review-item {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fff;
}

.review-correct {
    border-color: #bbf7d0;
}

.review-wrong {
    border-color: #fecaca;
}

.review-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.review-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 7px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.review-type {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
}

.review-mark {
    font-size: 12px;
    color: #f59e0b;
}

.review-verdict {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
}

.verdict-correct { color: #16a35a; }
.verdict-wrong { color: #ef4444; }
.verdict-blank { color: #9ca3af; }

.review-stem {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.7;
    color: #111827;
    margin-bottom: 12px;
    word-break: break-word;
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.55;
    color: #373151;
    word-break: break-word;
}

.review-option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.review-option-text {
    flex: 1;
}

.review-option-flag {
    align-self: center;
    font-size: 16px;
}

.review-option.is-answer {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.review-option.is-answer .review-option-key {
    background: #22c55e;
    color: #fff;
}

.review-option.is-answer .review-option-flag {
    color: #16a35a;
}

.review-option.is-picked-right {
    border-color: #22c55e;
}

.review-option.is-picked-wrong {
    border-color: #fecaca;
    background: #fef2f2;
}

.review-option.is-picked-wrong .review-option-key {
    background: #ef4444;
    color: #fff;
}

.review-option.is-picked-wrong .review-option-flag {
    color: #ef4444;
}

.review-blank {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-blank-row {
    font-size: 13px;
    color: #373151;
    word-break: break-word;
}

.review-blank-empty {
    color: #9ca3af;
}

.answer-text {
    color: #16a35a;
}

.review-analysis {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eff6ff;
    font-size: 13px;
    line-height: 1.7;
    color: #1e40af;
    word-break: break-word;
}

.review-analysis > div {
    flex: 1;
}

.review-analysis-label {
    font-weight: 700;
    white-space: nowrap;
}

.review-analysis-label i {
    margin-right: 2px;
}

/* ==================== 错题与收藏列表 ==================== */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.list-toolbar-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.list-toolbar-title b {
    color: #2563eb;
}

.list-toolbar-icon {
    font-size: 19px;
}

.list-toolbar-amber { color: #d97706; }
.list-toolbar-violet { color: #5f56e5; }

.question-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-item {
    padding: 15px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.question-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.question-item-meta {
    flex: 1;
    font-size: 12px;
    color: #9ca3af;
    text-align: right;
}

.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 9px;
    background: #fef2f2;
    color: #ef4444;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-icon-danger:hover {
    background: #fee2e2;
}

.question-item-stem {
    font-size: 14px;
    line-height: 1.7;
    color: #111827;
    word-break: break-word;
}

.review-detail {
    margin-top: 10px;
}

.review-detail summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #2563eb;
    cursor: pointer;
    list-style: none;
}

.review-detail summary::-webkit-details-marker {
    display: none;
}

.review-detail-body {
    margin-top: 10px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .topbar {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        height: 56px;
        padding: 0 14px;
    }

    .topnav {
        flex-wrap: nowrap;
    }

    .user-main {
        padding: 14px 14px 86px;
    }

    .user-container-narrow {
        max-width: none;
    }

    .show-mobile-only {
        display: block;
    }

    .profile-app-head {
        display: flex;
    }

    .profile-edit-card {
        padding: 16px 14px;
    }

    /* 编辑表单提交按钮靠右（仅两个编辑卡内，退出登录等其余按钮不变） */
    .profile-edit-card form > .pf-btn-primary {
        display: flex;
        margin-left: auto;
    }

    /* 卡头移动端保持横排：标题左、按钮右（覆盖排行榜纵排的全局规则） */
    .user-page .section-box .profile-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    /* 详情态返回：标题左侧纯图标圆钮（APP 导航范式），编辑按钮保持贴右 */
    .profile-back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        margin: -8px 4px -8px -8px;
        border-radius: 50%;
        color: #4b5563;
        flex-shrink: 0;
        cursor: pointer;
        transition: background .15s ease;
    }

    .profile-back-btn i {
        font-size: 20px;
        line-height: 1;
    }

    .profile-back-btn:active {
        background: rgba(31, 46, 38, .07);
    }

    .profile-back-btn + h3 {
        margin-right: auto;
    }

    .topnav.show-mobile-only {
        display: flex;
    }

    .mobile-tabbar.show-mobile-only {
        display: flex;
    }

    .welcome-panel {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
    }

    .quick-entry-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .entry-duo {
        grid-template-columns: 1fr;
    }

    .paper-grid {
        grid-template-columns: 1fr;
    }

    .result-stats {
        gap: 16px;
        flex-wrap: wrap;
    }

    .list-toolbar {
        flex-wrap: wrap;
    }

    .ongoing-item {
        flex-wrap: wrap;
    }

    .room-shell {
        height: calc(100dvh - 62px);
    }

    .room-body {
        padding: 12px;
    }

    .q-card {
        padding: 16px;
    }

    .q-stem {
        font-size: 15px;
    }

    .q-nav {
        margin-top: 12px;
    }
}

@media (min-width: 769px) {
    .mobile-tabbar {
        display: none;
    }
}

/* ==================== 书卷主题：前台顶栏用户下拉（复用后台样式并等比缩放） ==================== */
.user-page .admin-dropdown-toggle {
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border-color: var(--lb-line);
}

.user-page .admin-avatar {
    width: 28px;
    height: 28px;
    background: var(--lb-green);
}

.user-page .admin-avatar-logo {
    width: 15px;
    height: 15px;
}

.user-page .admin-name {
    color: var(--lb-ink);
    font-size: 13px;
}

.user-page .nav-dropdown-icon {
    font-size: 15px;
}

/* ==================== 书卷主题：前台组件覆盖 ==================== */
.user-page .pf-btn-primary {
    background: var(--lb-green);
    border-color: var(--lb-green);
    color: #fff;
}

.user-page .pf-btn-primary:hover {
    background: var(--lb-green-deep);
    border-color: var(--lb-green-deep);
    color: #fff;
}

.user-page .stat-card {
    border-color: var(--lb-line);
    box-shadow: 0 1px 2px rgba(41, 37, 36, .03);
}

.user-page .stat-icon {
    background: var(--lb-green-soft);
    color: var(--lb-green);
}

.user-page .stat-value {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 26px;
    color: var(--lb-ink);
}

.user-page .stat-label {
    color: var(--lb-muted);
}

.user-page .section-box {
    border-color: var(--lb-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(41, 37, 36, .03);
}

.user-page .section-header h3,
.user-page .section-box > h3 {
    letter-spacing: .02em;
}

.user-page .category-name,
.user-page .quick-entry-title,
.user-page .entry-duo-title {
    color: var(--lb-ink);
}

.user-page .category-count,
.user-page .quick-entry-sub,
.user-page .entry-duo-sub,
.user-page .category-progress-text {
    color: var(--lb-muted);
}

.user-page .category-progress-percent {
    color: var(--lb-muted);
}

/* ==================== 前台排行榜 ==================== */
.rank-mine {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 18px 22px;
    background: var(--lb-paper, #fcfbf7);
    border: 1px solid var(--lb-line, #e6e1d6);
    border-radius: 12px;
}
.rank-mine-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lb-muted, #8a8577);
    font-size: 13px;
    font-weight: 600;
}
.rank-mine-label i { color: #d97706; }
.rank-mine-honors {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.rank-mine-stats { display: flex; gap: 26px; }
.rank-mine-stat { display: flex; flex-direction: column; align-items: center; }
.rank-mine-stat b {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 26px;
    line-height: 1.2;
    color: var(--lb-ink, #2f2c26);
}
.rank-mine-stat span { color: var(--lb-muted, #8a8577); font-size: 12px; }

.rank-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.rank-tab {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 20px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--lb-line, #e6e1d6);
    color: var(--lb-muted, #8a8577);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.rank-tab:hover { color: #2a5740; border-color: #34694e; }
.rank-tab.active { background: #34694e; border-color: #34694e; color: #fff; }
.rank-tab-desc { color: var(--lb-muted, #8a8577); font-size: 13px; }

.rank-list { display: flex; flex-direction: column; }
.rank-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    border-bottom: 1px solid #d4c8b2;
}
.rank-row:last-child { border-bottom: none; }
.rank-row.self {
    background: #f2f7f0;
    border-radius: 10px;
    outline: 1px solid #cfe0d2;
}
.rank-user { display: flex; flex-direction: column; min-width: 0; }
.rank-user-name { color: var(--lb-ink, #2f2c26); font-weight: 600; line-height: 1.4; }
.rank-user-sub { color: var(--lb-muted, #8a8577); font-size: 12px; line-height: 1.4; }
.rank-honors {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.rank-nums {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.rank-num { color: var(--lb-muted, #8a8577); font-size: 13px; white-space: nowrap; }
.rank-num b {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    color: var(--lb-ink, #2f2c26);
}
.rank-num.hot b { color: #b45309; }
.rank-empty { color: var(--lb-muted, #8a8577); font-size: 12px; }
.rank-num-warn { color: #b45309; }

/* 可点击数字与统计卡 */
.rank-mine-stat.is-link { cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: -2px -6px; transition: background-color .15s; }
.rank-mine-stat.is-link:hover { background: rgba(52, 105, 78, .07); }
.rank-mine-stat.is-link:hover b, .rank-mine-stat.is-link:hover span { color: #34694e; }
a.rank-num { cursor: pointer; text-decoration: none; transition: color .15s; }
a.rank-num:hover { color: #34694e; }
a.rank-num:hover b { color: #34694e; }
a.rank-num:hover.hot b { color: #d97706; }
.stat-card.is-link { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat-card.is-link:hover { border-color: #34694e; box-shadow: 0 4px 14px rgba(52, 105, 78, .10); transform: translateY(-1px); }

@media (max-width: 640px) {
    .rank-mine { flex-direction: column; align-items: flex-start; }
    .rank-mine-stats { gap: 18px; }
    .user-page .section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .user-page .stats-row.stats-row--auto { grid-template-columns: repeat(2, 1fr); }
    .rank-tab-desc { font-size: 12px; line-height: 1.6; }
    .rank-row { flex-wrap: wrap; row-gap: 8px; gap: 10px; padding-left: 12px; padding-right: 12px; }
    .rank-row.self { padding-left: 12px; padding-right: 12px; }
    .rank-user { flex: 1; }
    .rank-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rank-nums { order: 4; flex-basis: 100%; margin-left: 0; justify-content: flex-start; gap: 14px; }
    .rank-honors { order: 5; flex-basis: 100%; }
}

/* ==================== 背题模式 ==================== */
.memorize-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.07);
    color: #1d4ed8;
    font-size: 13px;
    line-height: 1.5;
}
.memorize-tip i { font-size: 16px; flex-shrink: 0; }

.memorize-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #34694e;
}
.memorize-all i { font-size: 15px; }

.q-memorize-tag {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}
.q-memorize-tag i { font-size: 12px; }

/* ==================== 书卷主题：登录/注册页 ==================== */
body.login-page {
    background:
        radial-gradient(900px 480px at 12% -8%, rgba(52, 105, 78, 0.10), transparent 60%),
        radial-gradient(760px 420px at 105% 108%, rgba(181, 119, 42, 0.08), transparent 60%),
        linear-gradient(165deg, #f6f2e7 0%, #efe9da 100%);
    min-height: 100vh;
}

.login-page .login-box {
    background: #fffdf8;
    border: 1px solid #e6dfcf;
    border-radius: 22px;
    box-shadow: 0 24px 50px -24px rgba(96, 82, 52, 0.28);
}

.login-page .login-logo {
    background: linear-gradient(145deg, #3d7a5b, var(--lb-green));
    border-radius: 18px;
    box-shadow:
        0 0 0 12px rgba(52, 105, 78, 0.07),
        0 12px 24px -10px rgba(52, 105, 78, 0.5);
}

.login-page .login-header h1 {
    color: var(--lb-ink);
    letter-spacing: 0.5px;
}

.login-page .login-header p {
    color: var(--lb-muted);
}

.login-page .form-group input {
    border-color: #ddd5c2;
    background: #fffefa;
}

.login-page .form-group input:focus {
    border-color: var(--lb-green);
    box-shadow: 0 0 0 3px rgba(52, 105, 78, 0.12);
}

.login-page .pf-btn-primary {
    background: var(--lb-green);
    border-color: var(--lb-green);
    color: #fff;
}

.login-page .pf-btn-primary:hover {
    background: var(--lb-green-deep);
    border-color: var(--lb-green-deep);
    color: #fff;
}

.login-page .login-footer {
    color: var(--lb-muted);
}

.login-page .login-footer a {
    color: var(--lb-green);
}

.login-page .login-footer a:hover {
    color: var(--lb-green-deep);
}

/* 书卷风下版权文字改暖灰（原规则为深底白字） */
.login-page .login-copyright {
    color: var(--lb-muted);
}

.login-page .login-copyright a {
    color: var(--lb-green);
}

/* 第三方登录分隔线 + 飞书登录按钮 */
.login-page .login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0 16px;
    color: var(--lb-muted);
    font-size: 12px;
}

.login-page .login-divider::before,
.login-page .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e6dfcf;
}

.login-page .login-feishu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    font-size: 15px;
    background: #fff;
    color: var(--lb-green);
    border: 1px solid #cfdccf;
    border-radius: 10px;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease;
}

.login-page .login-feishu-btn i {
    font-size: 17px;
    line-height: 1;
}

.login-page .login-feishu-btn:hover {
    background: rgba(52, 105, 78, 0.06);
    border-color: var(--lb-green);
    color: var(--lb-green-deep);
}

@media (max-width: 768px) {
    /* APP 式布局：品牌区居上、卡片跟随、底部留白 */
    body.login-page {
        justify-content: flex-start;
        padding: 14vh 20px 48px;
    }

    .login-page .login-container {
        max-width: 100%;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .login-page .login-box {
        padding: 30px 22px;
        border-radius: 18px;
    }

    .login-page .login-header {
        margin-bottom: 26px;
    }

    .login-page .login-logo {
        width: 60px;
        height: 60px;
        border-radius: 17px;
        margin-bottom: 14px;
    }

    .login-page .login-logo .app-logo-img {
        width: 30px;
        height: 30px;
    }

    .login-page .login-header h1 {
        font-size: 24px;
    }

    .login-page .login-header p {
        font-size: 13px;
        line-height: 1.7;
        margin-top: 4px;
    }

    /* 触控友好的表单控件（16px 防 iOS 聚焦缩放） */
    .login-page .form-group {
        margin-bottom: 16px;
    }

    .login-page .form-group label {
        font-size: 13px;
    }

    .login-page .form-group input {
        height: 46px;
        font-size: 16px;
        border-radius: 12px;
        padding: 0 14px;
    }

    .login-page .pf-btn-block {
        height: 48px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* 飞书登录：触控友好的全宽按钮 */
    .login-page .login-divider {
        margin: 18px 0 14px;
    }

    .login-page .login-feishu-btn {
        height: 48px;
        font-size: 16px;
        border-radius: 12px;
    }

    .login-page .login-footer {
        margin-top: 22px;
        font-size: 13px;
    }
}

/* ==================== 移动端隐藏竖向滚动条（滚动能力保留） ==================== */
@media (max-width: 768px) {
    * {
        /* Firefox / Chrome 121+ 标准属性：隐藏滚动条（无法区分方向，移动端页面无横向滚动场景，影响可忽略） */
        scrollbar-width: none;
    }

    *::-webkit-scrollbar:vertical {
        /* WebKit：仅隐藏竖向滚动条，横向不受影响 */
        display: none;
    }
}
