:root {
    --apple-bg: #f5f5f7;
    --card-bg: #fff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --input-bg: rgba(229, 231, 235, 0.5);
    --skeleton-bg: #e5e7eb;

    /* 共享组件兼容别名（映射到项目已有变量） */
    --bg-page: var(--apple-bg);
    --bg-card: var(--card-bg);
    --bg-nav: var(--glass-bg);
    --bg-input: var(--input-bg);

    /* 共享 CSS 需要但项目未定义的变量 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --brand-primary: #e94560;
    --brand-primary-hover: #d63a52;
    --brand-secondary: #3b82f6;
    --brand-secondary-hover: #2563eb;
    --rg-teal: #3fb8c4;
    --rg-coral: #e8734a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}
body { background-color: var(--apple-bg); color: var(--text-primary); font-family: -apple-system, "SF Pro SC", "SF Pro Display", "Helvetica Neue", Arial, sans-serif; }

/* 搜索筛选区域 */
.search-filter-area { margin-bottom: 1rem; }

/* 毛玻璃效果 */
.glass { background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px); }

/* 搜索高亮样式 */
mark { background: rgba(255, 213, 0, 0.4); color: inherit; border-radius: 2px; padding: 0 2px; }

/* 屏幕阅读器专用文本与跳过链接显示 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    left: -9999px;
}
.sr-only:focus,
.sr-only:focus-visible {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.5rem 1rem;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: #111827;
    color: #ffffff;
    border-radius: 9999px;
    z-index: 1000;
}

/* 全局焦点可见样式，确保键盘导航有清晰指示 */
:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* 图片预览大图层（div） */
#lightbox {
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
}
#lightbox.hidden {
    display: none !important;
}
#lightbox:not(.hidden) {
    display: flex !important;
}
#lightbox > .modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
.lightbox-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.lightbox-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
}
.lightbox-spinner.hidden {
    display: none;
}
@keyframes lightbox-spin {
    to { transform: rotate(360deg); }
}
.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.close-btn:hover,
.close-btn:focus-visible {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
}

/* 隐藏滚动条但保持功能 */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 手册筛选栏横向滚动渐变提示 */
.manual-filter-wrap {
    position: relative;
}
.manual-filter-wrap::before,
.manual-filter-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.manual-filter-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--apple-bg, #f5f5f7), transparent);
}
.manual-filter-wrap::after {
    right: 0;
    background: linear-gradient(to left, var(--apple-bg, #f5f5f7), transparent);
}
.manual-filter-wrap.can-scroll-left::before { opacity: 1; }
.manual-filter-wrap.can-scroll-right::after { opacity: 1; }

/* 卡片阴影与边框 */
.qa-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    transition: all 0.2s ease;
}
.qa-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 列表双列（仅桌面，默认单列） */
@media (min-width: 1024px) {
    #qa-container.layout-double {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
}

/* 正文可读性 */
.qa-content {
    line-height: 1.6;
}

/* 搜索框：48px 触控区、白底、细边框、focus 蓝色描边 */
#searchInput,
.search-input {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#searchInput:focus,
.search-input:focus {
    background-color: #fff;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.search-input::placeholder {
    color: #d1d5db;
}
@media (max-width: 640px) {
    .search-input {
        width: 100%;
        font-size: 16px;
    }
}

/* 排序下拉框 */
.sort-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--input-bg, rgba(229, 231, 235, 0.5));
    color: var(--text-secondary, #4b5563);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 4px 28px 4px 10px;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.sort-select:hover {
    border-color: #3b82f6;
}
.sort-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 卡片 hover 放大与指针 */
.qa-card {
    cursor: pointer;
    transform-origin: center;
}
.qa-card:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 复制按钮图标/文字切换 */
.copy-icon.hidden, .copy-done.hidden { display: none; }
.copy-answer-icon.hidden, .copy-answer-done.hidden { display: none; }

/* 搜索历史 */
.search-history {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}
.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 4px;
}
.search-history-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}
.search-history-clear {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.search-history-clear:hover { color: #ef4444; background: rgba(239,68,68,0.08); }
.search-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: background 0.1s;
}
.search-history-item:hover { background: rgba(59,130,246,0.06); }
.search-history-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-history-remove {
    opacity: 0;
    font-size: 1rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: opacity 0.15s, color 0.15s;
    line-height: 1;
}
.search-history-item:hover .search-history-remove { opacity: 1; }
.search-history-remove:hover { color: #ef4444; }

/* Toast */
#copyToast.show { opacity: 1; }

/* 骨架屏 */
.skeleton-card { min-height: 200px; }
.skeleton { background-color: var(--skeleton-bg); border-radius: 0.5rem; }
.skeleton-line { height: 1rem; }
.skeleton-title { height: 1.25rem; }
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.animate-skeleton { animation: skeleton-pulse 1.5s ease-in-out infinite; }
.qa-card.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.empty-state { margin-top: 60px; background: #f3f4f6; }

/* 搜索 loading spinner */
.search-spinner { width: 1rem; height: 1rem; border: 2px solid #e5e7eb; border-top-color: #2563eb; border-radius: 50%; animation: search-spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes search-spin { to { transform: rotate(360deg); } }

/* 搜索按钮：48px 触控区、移动端 padding */
.search-btn,
#searchBtn {
    min-height: 48px;
    min-width: 48px;
}
@media (max-width: 640px) {
    .search-btn {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* 语言切换按钮 */
.language-toggle {
    display: flex;
    gap: 2px;
    align-items: center;
}
.language-toggle [data-lang] {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.language-toggle [data-lang]:hover {
    background-color: rgba(37, 99, 235, 0.08);
    color: #2563EB;
}
.language-toggle [data-lang].active {
    background-color: #2563EB;
    color: white;
    border-color: #2563EB;
}

/* 裁定标签样式 */
.ruling-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}
.ruling-badge.ruling-allowed { background: #dcfce7; color: #15803d; }
.ruling-badge.ruling-not_allowed { background: #fee2e2; color: #b91c1c; }
.ruling-badge.ruling-conditional { background: #fef3c7; color: #b45309; }
.ruling-badge.ruling-clarification { background: #dbeafe; color: #1d4ed8; }

/* 规则编号标签 */
.rule-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1.5px dashed rgba(37, 99, 235, 0.4);
    position: relative;
}
.rule-tag:hover { background: #dbeafe; color: #1d4ed8; border-bottom-color: #2563EB; }

/* 规则标签 hover tooltip */
.rule-tag[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #1f2937;
    color: #f9fafb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 50;
}
.rule-tag[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 50;
}
@media (hover: hover) {
    .rule-tag[data-tooltip]:hover::after,
    .rule-tag[data-tooltip]:hover::before {
        opacity: 1;
    }
}

/* AI 总结区块 - 左侧蓝色边框 */
.qa-ai-summary {
    border-left: 3px solid #3b82f6;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.qa-ai-summary .section-label {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 6px;
}
.qa-ai-summary .conclusion-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

/* 卡片标题 - 官方论坛风格 */
.qa-title-header {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a4d8c;
    line-height: 1.35;
    margin: 0;
    transition: color 0.15s;
}
.group:hover .qa-title-header { color: #1d4ed8; }

/* 英文副标题（中英混排） */
.qa-title-en {
    display: block;
    font-size: 0.78em;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    margin-top: 2px;
    line-height: 1.4;
}

/* 虚线分隔 */
.qa-separator {
    border: none;
    border-top: 2px dotted #d1d5db;
    margin: 12px 0 14px;
}

/* 元信息行 */
.qa-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.qa-meta-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #6b7280;
}

/* 提问内容 - 纯文本无背景 */
.qa-question-text {
    margin-bottom: 16px;
}

/* 官方回答 - 绿色边框盒子 */
.qa-answer-box {
    border: 2.5px solid #22c55e;
    border-radius: 8px;
    padding: 20px 24px;
    margin-top: 4px;
}
.qa-answer-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.qa-answer-badge {
    font-size: 1.15rem;
    font-weight: 600;
    color: #16a34a;
}
.qa-answer-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6b7280;
}

/* 卡片底部 */
.qa-card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 规则标签行 */
.qa-rules-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

/* 筛选栏按钮 */
.filter-btn.hidden { display: none; }
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { background: rgba(37,99,235,0.06); border-color: #2563EB; color: #2563EB; }
.filter-btn.active { background: #2563EB; color: white; border-color: #2563EB; }
.filter-btn .filter-count {
    font-size: 11px;
    opacity: 0.7;
}
/* 规则分组 */
.rule-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
    padding: 2px 0;
    user-select: none;
    letter-spacing: 0.5px;
}
/* 规则展开/收起按钮 */
.rule-toggle-btn {
    border-style: dashed;
    color: var(--text-muted);
    font-size: 12px;
    align-self: flex-start;
    margin-top: 2px;
}
.rule-toggle-btn:hover {
    border-style: solid;
}

/* 全面屏安全区域 */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
#backToTop {
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
#copyToast {
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

/* 触摸反馈：按下时轻微缩小 */
@media (hover: none) and (pointer: coarse) {
    .qa-card:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
    .filter-btn:active,
    .language-toggle [data-lang]:active,
    .rule-tag:active {
        transform: scale(0.93);
        transition: transform 0.1s ease;
    }
    /* 手机端取消 hover 放大效果，避免黏滞 */
    .qa-card:hover {
        transform: none;
    }
}

/* 规则气泡卡片 */
.rule-popover {
    position: absolute;
    z-index: 60;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 16px;
    animation: popoverIn 0.18s ease-out;
}
@keyframes popoverIn {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.rule-popover.hidden { display: none; }
.rule-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.rule-popover-header .rule-code {
    font-size: 15px;
    font-weight: 700;
    color: #2563EB;
}
.rule-popover-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0,0,0,0.06);
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.rule-popover-close:hover { background: rgba(0,0,0,0.12); color: #111827; }
.rule-popover-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.4;
}
.rule-popover-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px;
}
.rule-popover-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.rule-popover-actions a,
.rule-popover-actions button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
}
.rule-popover-actions a:hover,
.rule-popover-actions button:hover {
    background: rgba(37,99,235,0.08);
    color: #2563EB;
    border-color: #2563EB;
}
.rule-popover-actions a.primary-action {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
}
.rule-popover-actions a.primary-action:hover {
    background: #1d4ed8;
}
.rule-popover-not-found {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 12px;
}
/* 手机端气泡 — 底部弹出 */
@media (max-width: 640px) {
    .rule-popover {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 14px 14px 0 0;
        padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
        animation: popoverSlideUp 0.25s ease-out;
    }
    @keyframes popoverSlideUp {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .rule-popover-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 59;
        animation: overlayFadeIn 0.2s ease;
    }
    .rule-popover-overlay.hidden { display: none; }
    @keyframes overlayFadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}

/* 导航栏规则手册按钮 */
.manual-links {
    display: flex;
    gap: 6px;
    align-items: center;
}
.manual-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.manual-link-btn:hover {
    background: rgba(37,99,235,0.08);
    color: #2563EB;
    border-color: #2563EB;
}

/* 标题行（编号 + 新增标记） */
.qa-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.qa-title-row .qa-title-header {
    flex: 1;
    min-width: 0;
}

/* 新增标记 */
.qa-new-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #ef4444;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 4px;
    animation: newBadgePulse 2s ease-in-out infinite;
}
@keyframes newBadgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 移动端卡片折叠 */
.qa-card-detail {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}
.qa-card-detail.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* 展开/收起按钮 */
.qa-expand-btn {
    display: none;
    width: 100%;
    padding: 8px;
    margin: 4px 0 0;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}
.qa-expand-btn:hover {
    background: rgba(37,99,235,0.06);
    color: #2563EB;
}
@media (max-width: 640px) {
    .qa-expand-btn {
        display: block;
    }
}

/* ========== 收藏按钮 ========== */
.qa-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 9999px;
    background: rgba(229, 231, 235, 0.5);
    color: var(--text-muted, #6b7280);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.qa-fav-btn:hover {
    background: rgba(251, 191, 36, 0.15);
    color: #f59e0b;
    transform: scale(1.1);
}
.qa-fav-btn.active {
    color: #f59e0b;
    background: rgba(251, 191, 36, 0.12);
}
.qa-fav-btn.active:hover {
    background: rgba(251, 191, 36, 0.25);
}

/* 收藏筛选按钮 */
.fav-filter-btn {
    border-left: 1px solid var(--border-color, #e5e7eb) !important;
    margin-left: 4px !important;
    padding-left: 12px !important;
}
.fav-filter-btn.active {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #b45309 !important;
    border-color: rgba(251, 191, 36, 0.4) !important;
}

/* ========== 重要通知模块 ========== */
.notices-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    margin-bottom: 1rem;
    overflow: hidden;
}
.notices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.notices-header:hover {
    background: rgba(0, 0, 0, 0.02);
}
.notices-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.notices-header-left svg {
    color: #f59e0b;
    flex-shrink: 0;
}
.notices-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 8px;
    border-radius: 9999px;
}
.notices-toggle {
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.notices-toggle:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}
.notices-body {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.notices-body.collapsed {
    display: none;
}
.notice-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    transition: background 0.15s;
}
.notice-stripe {
    width: 3px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
}
.notice-stripe.warning { background: #f59e0b; }
.notice-stripe.info { background: #3b82f6; }
.notice-stripe.urgent { background: #ef4444; }
.notice-content {
    flex: 1;
    min-width: 0;
}
.notice-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}
.notice-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}
.notice-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.notice-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.notice-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #2563EB;
    text-decoration: none;
    transition: color 0.15s;
}
.notice-link:hover { color: #1d4ed8; }

/* ========== PDF 下载 + 顶部栏 ========== */
.manual-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 8px;
}
.pdf-download-group {
    display: flex;
    gap: 6px;
}
.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.pdf-download-btn:hover {
    background: rgba(37, 99, 235, 0.06);
    color: #2563EB;
    border-color: #2563EB;
}

/* ========== 倒计时横幅 ========== */
.update-banner {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.update-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}
.update-banner-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--brand-secondary);
    flex-shrink: 0;
}
.update-banner-link {
    margin-left: auto;
    color: var(--brand-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    text-decoration: none;
    transition: opacity 0.2s;
}
.update-banner-link:hover { opacity: 0.7; }
/* 缓冲期状态（黄色） */
.update-banner.grace-period {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}
.update-banner.grace-period .update-banner-icon { color: #f59e0b; }
@media (max-width: 640px) {
    .update-banner-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .update-banner-link {
        margin-left: 0;
        font-size: 0.8rem;
    }
}

/* ========== Tab 切换时隐藏 ========== */
.tab-hidden { display: none !important; }

/* ========== 更新日志 ========== */
.changelog-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (min-width: 768px) {
    .changelog-layout {
        flex-direction: row;
    }
}
/* 左侧时间线 */
.changelog-timeline {
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .changelog-timeline {
        width: 200px;
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        align-self: flex-start;
    }
}
.changelog-timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
/* 桌面端竖线 */
@media (min-width: 768px) {
    .changelog-timeline-list {
        border-left: 2px solid var(--border-color);
        padding-left: 0;
    }
}
/* 移动端水平排列 */
@media (max-width: 767px) {
    .changelog-timeline-list {
        display: flex;
        gap: 0;
        overflow-x: auto;
        padding-bottom: 8px;
        border-bottom: 2px solid var(--border-color);
    }
}
.changelog-timeline-item {
    position: relative;
}
.changelog-timeline-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px 8px 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border-left: 3px solid transparent;
    margin-left: -2px;
    white-space: nowrap;
}
@media (max-width: 767px) {
    .changelog-timeline-btn {
        border-left: none;
        border-bottom: 3px solid transparent;
        margin-left: 0;
        margin-bottom: -2px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}
.changelog-timeline-btn:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.04);
}
.changelog-timeline-btn.active {
    color: var(--brand-secondary);
    font-weight: 600;
    border-left-color: var(--brand-secondary);
    background: rgba(59, 130, 246, 0.06);
}
@media (max-width: 767px) {
    .changelog-timeline-btn.active {
        border-left-color: transparent;
        border-bottom-color: var(--brand-secondary);
    }
}
.changelog-version-label {
    font-weight: 600;
    display: block;
}
.changelog-version-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}
@media (max-width: 767px) {
    .changelog-version-date { display: none; }
}
.changelog-version-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 9999px;
    margin-left: 4px;
    vertical-align: middle;
}
.changelog-version-badge.current {
    background: rgba(59, 130, 246, 0.12);
    color: var(--brand-secondary);
}
.changelog-version-badge.upcoming {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}
/* 右侧详情区 */
.changelog-detail {
    flex: 1;
    min-width: 0;
}
.changelog-version-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.changelog-version-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.changelog-version-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.changelog-version-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 8px 0 0;
    line-height: 1.5;
}
/* 变更卡片 */
.changelog-change-card {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.changelog-change-card:last-child { border-bottom: none; }
.changelog-change-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.changelog-change-type {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}
.changelog-change-type.type-expand { background: #dbeafe; color: #1d4ed8; }
.changelog-change-type.type-update { background: #fef3c7; color: #b45309; }
.changelog-change-type.type-add { background: #dcfce7; color: #15803d; }
.changelog-change-type.type-fix { background: #fee2e2; color: #b91c1c; }
.changelog-change-rule {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 0.88rem;
    color: #2563EB;
}
.changelog-change-summary {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 4px 0 0;
}
.changelog-change-summary-en {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 2px 0 0;
}
/* 解读展开区 */
.changelog-interpretation {
    margin-top: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.changelog-interp-section {
    margin-bottom: 10px;
}
.changelog-interp-section:last-child { margin-bottom: 0; }
.changelog-interp-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-secondary);
    margin-bottom: 4px;
}
.changelog-interp-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}
/* diff 对比 */
.changelog-diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}
@media (max-width: 640px) {
    .changelog-diff { grid-template-columns: 1fr; }
}
.changelog-diff-box {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.4;
}
.changelog-diff-box.old {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.changelog-diff-box.new {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.changelog-diff-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2px;
    opacity: 0.7;
}
/* 空状态 */
.changelog-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== Tab 切换栏 ========== */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    margin-bottom: 16px;
    padding-top: 4px;
}
.tab-btn {
    position: relative;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab-btn:hover {
    color: var(--text-primary, #111827);
}
.tab-btn.active {
    color: #2563EB;
    border-bottom-color: #2563EB;
    font-weight: 600;
}

/* ========== 手册布局（桌面目录+内容） ========== */
.manual-layout {
    display: flex;
    flex-direction: column;
    max-width: 1100px;
    margin: 0 auto;
}
.manual-main {
    flex: 1;
    min-width: 0;
    max-width: 800px;
}
@media (min-width: 1024px) {
    .manual-layout {
        flex-direction: row;
        gap: 24px;
    }
}

/* ========== 目录导航 ========== */
.manual-toc {
    flex-shrink: 0;
}
@media (min-width: 1024px) {
    .manual-toc {
        width: 220px;
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        align-self: flex-start;
    }
    .manual-toc-toggle { display: none !important; }
    .manual-toc-list { display: block !important; }
}
@media (max-width: 1023px) {
    .manual-toc {
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 30;
        background: var(--apple-bg);
        border-bottom: 1px solid var(--border-color);
        padding: 8px 0;
        margin-bottom: 12px;
    }
    .manual-toc-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        max-height: 60vh;
        overflow-y: auto;
        z-index: 31;
    }
    .manual-toc-list.open { display: block; }
}
.manual-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.manual-toc-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.manual-toc-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s;
}
.manual-toc-toggle:hover { background: rgba(0,0,0,0.04); }
.manual-toc-item {
    list-style: none;
}
.manual-toc-link {
    display: block;
    padding: 6px 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    cursor: pointer;
}
.manual-toc-link:hover {
    color: #2563EB;
    background: rgba(37,99,235,0.04);
}
.manual-toc-link.active {
    color: #2563EB;
    font-weight: 600;
    border-left-color: #2563EB;
    border-left-width: 3px;
    background: rgba(37,99,235,0.06);
}
.manual-toc-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ========== 连续阅读模式 ========== */
.manual-reading {
    padding-bottom: 40px;
}
.manual-chapter {
    margin-bottom: 32px;
}
.manual-chapter:not(:first-child) {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}
.manual-chapter-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
    padding-bottom: 8px;
    scroll-margin-top: 100px;
}
.manual-entry {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.manual-entry:last-child {
    border-bottom: none;
}
.manual-entry-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}
.manual-entry-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.manual-entry-id.type-rule { color: #2563EB; }
.manual-entry-id.type-def { color: #059669; }
.manual-entry-summary {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin: 0 0 4px;
    line-height: 1.5;
}
.manual-entry-summary-en {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 6px;
    font-style: italic;
}

/* ========== 搜索匹配横幅 ========== */
.manual-search-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e40af;
}
.manual-search-banner.hidden { display: none; }
.manual-search-nav {
    display: flex;
    gap: 6px;
}
.manual-search-nav-btn {
    padding: 3px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: white;
    color: #2563EB;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.manual-search-nav-btn:hover { background: #dbeafe; }

/* ========== 术语弹窗 ========== */
.manual-term-tooltip {
    position: absolute;
    z-index: 55;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    padding: 14px;
    animation: popoverIn 0.18s ease-out;
}
.manual-term-tooltip.hidden { display: none; }
.manual-term-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.manual-term-tooltip-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #059669;
}
.manual-term-tooltip-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0,0,0,0.06);
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s;
}
.manual-term-tooltip-close:hover { background: rgba(0,0,0,0.12); }
.manual-term-tooltip-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 8px;
}
.manual-term-tooltip-link {
    font-size: 0.78rem;
    color: #2563EB;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}
.manual-term-tooltip-link:hover { color: #1d4ed8; }
@media (max-width: 640px) {
    .manual-term-tooltip {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px 12px 0 0;
        padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
        animation: popoverSlideUp 0.25s ease-out;
    }
}

/* ========== 规则手册卡片（保留用于高亮动画） ========== */
.manual-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 16px 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.manual-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-color: var(--border-hover, #d1d5db);
}
.manual-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.manual-rule-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 0.95rem;
}
.manual-type-rule {
    color: #2563EB;
}
.manual-type-def {
    color: #059669;
}
.manual-section-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 9999px;
    background: var(--tag-bg, #f3f4f6);
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
}
.manual-summary {
    font-size: 0.9rem;
    color: var(--text-primary, #111827);
    margin: 0 0 4px;
    line-height: 1.5;
}
.manual-summary-en {
    font-size: 0.8rem;
    color: var(--text-muted, #9ca3af);
    margin: 0 0 8px;
    font-style: italic;
}

/* 规则手册 Q&A 交叉引用 */
.manual-qa-refs {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.8rem;
}
.manual-qa-label {
    color: var(--text-muted, #6b7280);
}
.manual-qa-link {
    display: inline-block;
    margin: 0 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #eff6ff;
    color: #2563EB;
    text-decoration: none;
    font-size: 0.75rem;
    transition: background 0.15s;
}
.manual-qa-link:hover {
    background: #dbeafe;
}

/* 手册展开按钮 */
.manual-expand-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 8px 0 0;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: center;
}
.manual-expand-btn:hover {
    background: rgba(37, 99, 235, 0.06);
    color: #2563EB;
    border-color: rgba(37, 99, 235, 0.3);
}
.manual-expand-btn.active {
    border-style: solid;
    border-color: rgba(37, 99, 235, 0.2);
    color: #2563EB;
}

/* 手册全文内容区域 */
.manual-content-area {
    margin-top: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-primary);
    overflow-x: auto;
    transition: max-height 0.3s ease;
}
.manual-content-area.hidden {
    display: none;
}
.manual-content-area.collapsing {
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.manual-content-area p {
    margin: 0 0 10px;
}
.manual-content-area ul,
.manual-content-area ol {
    margin: 0 0 10px;
    padding-left: 24px;
}
.manual-content-area li {
    margin-bottom: 4px;
}
.manual-content-area table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.85rem;
}
.manual-content-area th,
.manual-content-area td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}
.manual-content-area th {
    background: rgba(0, 0, 0, 0.03);
    font-weight: 600;
}

/* 内容区域图片 */
.manual-content-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

/* 内容区域内部规则链接 */
.manual-content-rule-link {
    color: #2563EB;
    text-decoration: none;
    border-bottom: 1px dashed rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.manual-content-rule-link:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

/* 内容区域术语高亮 */
.manual-content-term {
    font-weight: 600;
    color: #059669;
}

/* 内容区域规则摘要 */
.manual-content-rule-summary {
    font-weight: 600;
    font-style: italic;
}

/* 内容区域特殊盒子 */
.manual-content-redbox {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 12px 0;
    color: #991b1b;
}
.manual-content-greybox {
    background: #f3f4f6;
    border-left: 4px solid #9ca3af;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 12px 0;
}
.manual-content-vexubox {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 12px 0;
}
.manual-content-violations {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 12px 0;
}
.manual-content-notes {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 12px 0;
}

/* 手册条目/卡片高亮（从 Q&A 跳转到规则时的闪烁效果） */
.manual-card-highlight,
.manual-entry-highlight {
    animation: manual-highlight-flash 2s ease-out;
}
@keyframes manual-highlight-flash {
    0%, 20% { box-shadow: 0 0 0 3px #2563eb; border-radius: 8px; }
    100% { box-shadow: none; }
}

/* 手册章节筛选按钮 */
.manual-section-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* 最近浏览 */
.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.recent-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.recent-clear {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.recent-clear:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}
.recent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.recent-chip {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}
.recent-chip:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

@media print {
    body, main { background: #fff !important; color: #000 !important; }
    .platform-nav { display: none !important; }
    .search-filter-area { display: none !important; }
    #notices-area { display: none !important; }
    #themeToggle, #searchBtn, #searchClear, #searchLoading, #layoutToggle, #loadMoreWrap, #loadMoreBtn, #backToTop, #copyToast, #lightbox { display: none !important; }
    .qa-card button { display: none !important; }
    .qa-card { break-inside: avoid; box-shadow: none; border: 1px solid #e5e7eb; }
    #skeleton-wrap, #searchEmptyState { display: none !important; }
}
