/* =========================================================
   macOS 风格内容排版 — 适用于 .content / .book-content / .content-body
   ========================================================= */

.content, .book-content, .content-body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
                 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.75;
    color: #1d1d1f;
    max-width: 820px;
    margin: 0 auto;
    word-break: break-word;
}

/* ── Headings ── */
.content h1, .book-content h1, .content-body h1,
.content h2, .book-content h2, .content-body h2,
.content h3, .book-content h3, .content-body h3,
.content h4, .book-content h4, .content-body h4,
.content h5, .book-content h5, .content-body h5,
.content h6, .book-content h6, .content-body h6 {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                 "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    line-height: 1.3;
}

.content h1, .book-content h1, .content-body h1 { font-size: 1.8rem; }
.content h2, .book-content h2, .content-body h2 { font-size: 1.4rem; }
.content h3, .book-content h3, .content-body h3 { font-size: 1.15rem; }
.content h4, .book-content h4, .content-body h4 { font-size: 1rem; }

/* ── Paragraphs ── */
.content p, .book-content p, .content-body p {
    margin-bottom: 1em;
}

/* ── Code Blocks (Xcode / macOS Terminal 风格) ── */
.content pre, .book-content pre, .content-body pre {
    background: #f5f5f7;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid #e5e5ea;
    margin-bottom: 1.2em;
}

.content code, .book-content code, .content-body code {
    font-family: "SF Mono", "Menlo", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
    background: #f5f5f7;
    padding: 2px 6px;
    border-radius: 4px;
    color: #1d1d1f;
}

.content pre code, .book-content pre code, .content-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* ── Tables (极简线条) ── */
.content table, .book-content table, .content-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1.2em;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    font-size: 13px;
}

.content th, .book-content th, .content-body th {
    background: #f5f5f7;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e5ea;
    color: #1d1d1f;
}

.content td, .book-content td, .content-body td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f2;
}

.content tr:last-child td, .book-content tr:last-child td, .content-body tr:last-child td {
    border-bottom: none;
}

/* ── Blockquote (macOS 备忘录风格) ── */
.content blockquote, .book-content blockquote, .content-body blockquote {
    border-left: 3px solid #007aff;
    background: #f5f5f7;
    border-radius: 0 8px 8px 0;
    padding: 12px 20px;
    margin: 1em 0;
    font-size: 13px;
    color: #3a3a3c;
}

.content blockquote p, .book-content blockquote p, .content-body blockquote p {
    margin-bottom: 0;
}

/* ── Images ── */
.content img, .book-content img, .content-body img {
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    display: block;
}

/* ── Lists ── */
.content ul, .book-content ul, .content-body ul,
.content ol, .book-content ol, .content-body ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.content li, .book-content li, .content-body li {
    margin-bottom: 0.4em;
}

.content li > ul, .book-content li > ul, .content-body li > ul,
.content li > ol, .book-content li > ol, .content-body li > ol {
    margin-top: 0.3em;
    margin-bottom: 0;
}

/* ── Horizontal Rule ── */
.content hr, .book-content hr, .content-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e5ea, transparent);
    margin: 2em 0;
}

/* ── Links ── */
.content a, .book-content a, .content-body a {
    color: #007aff;
    text-decoration: none;
    transition: color 0.2s;
}

.content a:hover, .book-content a:hover, .content-body a:hover {
    color: #0056cc;
    text-decoration: underline;
}

/* ── Strong / Emphasis ── */
.content strong, .book-content strong, .content-body strong {
    font-weight: 600;
    color: #1d1d1f;
}

/* =========================================================
   右侧栏 — macOS 风格（限定在 .ai-sidebar 内，不泄漏到正文）
   ========================================================= */

.ai-sidebar {
    position: sticky;
    top: 20px;
}

.ai-sidebar .sidebar-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #eaeaea;
}

.ai-sidebar .sidebar-section h3 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

.ai-sidebar .hot-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-sidebar .tool-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #1d1d1f;
    border: 1px solid #e5e5ea;
    transition: all 0.2s;
    font-size: 13px;
}

.ai-sidebar .tool-item:hover {
    background: #e8f0fe;
    border-color: #007aff;
    transform: translateX(2px);
}

.ai-sidebar .tool-icon {
    margin-right: 8px;
    font-size: 16px;
    flex-shrink: 0;
}

.ai-sidebar .tool-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-sidebar .tool-category {
    font-size: 11px;
    color: #8c8f94;
    background: #f5f5f7;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ai-sidebar .related-recommendations {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-sidebar .related-item {
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #1d1d1f;
    border: 1px solid #e5e5ea;
    transition: all 0.2s;
}

.ai-sidebar .related-item:hover {
    background: #f5f5f7;
    border-color: #d1d1d6;
}

.ai-sidebar .related-title {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-sidebar .related-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #8c8f94;
}

.ai-sidebar .quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ai-sidebar .quick-link {
    padding: 8px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #1d1d1f;
    text-align: center;
    border: 1px solid #e5e5ea;
    font-size: 12px;
    transition: all 0.2s;
}

.ai-sidebar .quick-link:hover {
    background: #e8f5e8;
    border-color: #34c759;
}

@media (max-width: 992px) {
    .ai-sidebar {
        position: static;
    }
}

/* =========================================================
   正文下方 — 相关推荐（不与侧栏冲突）
   ========================================================= */

.related-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5ea;
}

.related-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 1rem;
}

.related-list {
    display: flex;
    flex-direction: column;
}

.related-list .related-item {
    display: block;
    padding: 10px 0 10px 2em;
    background: none;
    border: none;
    border-radius: 0;
    color: #1d1d1f;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f2;
}

.related-list .related-item:last-child {
    border-bottom: none;
}

.related-list .related-item:hover {
    background: none;
}

.related-list .related-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #007aff;
    margin-bottom: 2px;
    line-height: 1.5;
}

.related-list .related-item:hover .related-title {
    text-decoration: underline;
}

.related-list .related-meta {
    display: block;
    font-size: 12px;
    color: #8c8f94;
    line-height: 1.5;
    margin-top: 2px;
}

.related-list .related-meta:empty {
    display: none;
}

/* ========== 详情页 Hero 信息卡片 ========== */
.detail-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 14px;
    color: #86868b;
    margin: 0;
    line-height: 1.4;
}

.hero-score {
    text-align: center;
    flex-shrink: 0;
    min-width: 70px;
}

.score-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #f5a623;
    line-height: 1;
}

.score-stars {
    position: relative;
    display: inline-block;
    font-size: 14px;
    letter-spacing: 2px;
    width: 74px;
    height: 1em;
    margin-top: 4px;
}

.score-stars::before {
    content: '★★★★★';
    position: absolute;
    color: #e0e0e0;
}

.score-stars .stars-fill {
    position: absolute;
    overflow: hidden;
    top: 0;
    left: 0;
    height: 100%;
}

.score-stars .stars-fill::before {
    content: '★★★★★';
    color: #f5a623;
    display: block;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    font-size: 13px;
    color: #86868b;
}

.hero-meta .meta-item i {
    margin-right: 4px;
    width: 14px;
    text-align: center;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.hero-tags .tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #e5e5ea;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e5ea;
}

/* ========== macOS 风格详情卡片 ========== */
.detail-card {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}
.detail-card .content-body,
.detail-card .content {
    max-width: none;
    margin: 0;
}
.detail-card h1 {
    font-size: 2.0rem;
}

/* ========== macOS 风格操作按钮 ========== */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid #007aff;
    border-radius: 8px;
    background: #007aff;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1.5;
}
.action-btn i {
    font-size: 14px;
}
.action-btn:hover {
    background: #0056cc;
    border-color: #0056cc;
    color: #fff;
}
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================================================
   新布局：全宽顶栏 + 三栏主体
   ========================================================= */

/* ── 全宽顶栏 ── */
.top-nav {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e5ea;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1090;
}
body {
    padding-top: 60px !important;
}
.top-nav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 5px 24px;
}
.top-nav-logo {
    flex-shrink: 0;
    margin-right: 24px;
    display: flex;
    align-items: center;
}
.top-nav-logo img {
    display: block;
    max-height: 50px;
}
.top-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}
.top-nav-menu > li > a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 36px;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.top-nav-menu > li > a:hover {
    background: rgba(0, 0, 0, 0.05);
}
.top-nav-menu > li.active > a {
    color: #007aff;
    font-weight: 600;
}
.top-nav-menu > li > a i {
    font-size: 16px;
}
.top-nav-menu a[href="/policy"] i {
    color: #e74c3c;
}
.top-nav-hot {
    font-size: 7px;
    padding: 1px 4px;
    line-height: 1.4;
    vertical-align: super;
    margin-top: -11px;
}
.top-nav-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 12px;
}
.top-nav-tagline {
    font-size: 13px;
    color: #8c8f94;
    white-space: nowrap;
}
.top-nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #333;
}
.top-nav-toggle i {
    font-size: 22px;
}

/* ── 三栏主体 ── */
.three-col-layout {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
}
.left-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 10px 16px;
    align-self: flex-start;
    margin: 24px 0 24px 24px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}
.content-col {
    flex: 1;
    min-width: 0;
}
.right-sidebar {
    width: 300px;
    flex-shrink: 0;
}
.content-col--framed {
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 24px;
}

/* ── 覆盖原主题侧栏样式 ── */
.left-sidebar .sidebar-nav {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    z-index: auto !important;
    display: block !important;
    box-shadow: none !important;
}
.left-sidebar .sidebar-nav-inner {
    max-width: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.left-sidebar .sidebar-logo {
    display: none !important;
}
.left-sidebar .sidebar-menu {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
}
.left-sidebar .sidebar-item a {
    padding: 6px 12px 6px 8px !important;
}
.sidebar-menu ul:first-child > li > a,
.sidebar-menu ul:first-child > li > a span {
    line-height: 40px;
    max-height: 40px;
}

.media:after {
    padding-top: 10px !important;
}

/* ── 覆盖原主题 main-content 偏移 ── */
.main-content {
    margin-left: 0 !important;
    flex: 1;
    min-width: 0;
}

/* ── 首页搜索栏：macOS 毛玻璃 ── */
#search-bg {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-image: none !important;
    animation: none !important;
    border-bottom: 1px solid #e5e5ea;
    padding-top: 10px !important;
    padding-bottom: 20px !important;
}
#search-bg h1.big-title {
    color: #1d1d1f !important;
    text-shadow: none !important;
    font-size: 22px !important;
    margin-bottom: 24px !important;
}

/* 搜索输入框适配浅色背景 */
.header-big #search-text {
    color: #1d1d1f !important;
    background: #ffffff !important;
    border: 1px solid #d1d1d6 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.header-big #search-text::placeholder {
    color: #8e8e93 !important;
}

/* 搜索类型文字（百度/谷歌等）适配浅色 */
.header-big:not(.no-bg) .search-type label .text-muted,
.header-big:not(.no-bg) .text-muted {
    color: #666 !important;
}

@media (min-width: 768px) {
    #search-bg {
        padding-top: 20px !important;
        padding-bottom: 30px !important;
    }
    #search-bg h1.big-title {
        font-size: 26px !important;
        margin-bottom: 16px !important;
    }
}

/* ── Simple 页面（about/contact/upload）：全宽正文，无边栏 ── */
.three-col-layout--simple {
    max-width: 860px;
}
.content-col--simple {
    flex: 1;
    min-width: 0;
}
.content-col--simple .detail-card {
    max-width: 100%;
}

/* ── 响应式 ── */
@media (max-width: 992px) {
    .top-nav-menu {
        display: none;
    }
    .top-nav-tagline {
        display: none;
    }
    .top-nav-toggle {
        display: inline-flex;
    }
    .three-col-layout {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    .left-sidebar,
    .right-sidebar {
        width: 100%;
    }
    .left-sidebar .sidebar-nav {
        display: none !important;
    }
    .left-sidebar .sidebar-nav.show {
        display: block !important;
    }

    .page-container {
        flex-direction: column;
    }
    .left-sidebar {
        margin: 0;
    }
    .detail-card {
        padding: 20px 16px;
    }
}

@media (max-width: 576px) {
    .three-col-layout {
        padding: 12px;
        gap: 12px;
    }
    .detail-card {
        padding: 16px 12px;
        border-radius: 10px;
    }
    .detail-card h1 {
        font-size: 1.3rem;
    }
    .action-btn {
        font-size: 13px;
        padding: 6px 14px;
    }
    .detail-card .text-muted .mr-3 {
        display: block;
        margin-bottom: 4px;
    }
}

/* ── 站内搜索 ── */
#site-search-results,
#m_site-search-results {
    position: absolute;
    z-index: 20;
    width: 100%;
    overflow: hidden;
    margin-top: 4px;
}
#site-search-results .site-search-list,
#m_site-search-results .site-search-list {
    padding: 10px 0;
    margin: 0;
}
#site-search-results .site-search-list li,
#m_site-search-results .site-search-list li {
    line-height: 30px;
    font-size: 14px;
    padding: 0 25px;
    cursor: pointer;
    list-style: none;
    transition: .3s;
}
#site-search-results .site-search-list li:hover,
#m_site-search-results .site-search-list li:hover {
    background-color: rgba(130, 130, 130, .5);
}
#site-search-results .site-search-empty,
#m_site-search-results .site-search-empty {
    padding: 20px 25px;
    text-align: center;
    color: #999;
    font-size: 14px;
}
#site-search-results .text-warning,
#m_site-search-results .text-warning {
    color: #f5a623;
}
#site-search-results .site-search-list li.current,
#m_site-search-results .site-search-list li.current {
    background-color: rgba(130, 130, 130, .5);
}

/* ── macOS 风格 pill 标签（适配浅色背景）── */

/* 覆写 custom-style.css 的干扰色 */
.header-big:not(.no-bg) .s-type-list {
    color: #1d1d1f !important;
}

.header-big .s-type-list.big {
    background: none !important;
    margin-bottom: 20px !important;
}

/* pill 本体 */
.header-big .s-type-list.big label {
    display: inline-flex !important;
    align-items: center;
    padding: 0 22px;
    margin: 0 5px;
    height: 36px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.header-big .s-type-list.big label.active {
    background: rgba(0, 0, 0, 0.1);
}

.header-big .s-type-list.big label:not(.active):hover {
    background: rgba(0, 0, 0, 0.08);
}

/* 覆写原有半透明 + indicator */
.header-big .s-type-list label:not(.active) {
    opacity: 0.75;
}
.header-big .s-type-list label:not(.active):hover {
    opacity: 1;
}
.header-big .s-type-list label:not(.active)::after {
    display: none !important;
}

/* 内联文字 */
.header-big .s-type-list.big label span {
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f !important;
    padding: 0 !important;
    line-height: 1;
    display: inline !important;
}

/* =========================================================
   政策专区页面
   ========================================================= */
.policy-page-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #e5e5ea;
    margin-bottom: 24px;
}
.policy-page-title {
    font-family: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1d1d1f;
}
.policy-page-desc {
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.6;
    margin: 0 0 16px;
    max-width: 720px;
}
.policy-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #86868b;
}
.policy-stats i {
    margin-right: 4px;
}

/* 城市 Pill 导航 */
.policy-city-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 24px;
    margin-bottom: 8px;
}
.policy-city-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    border-radius: 20px;
    background: #f0f0f2;
    color: #515154;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}
.policy-city-pill:hover {
    background: #007aff;
    color: #fff;
    text-decoration: none;
}
.policy-city-pill.priority {
    background: #e8f0fe;
    color: #007aff;
    font-weight: 600;
}
.policy-city-pill.priority:hover {
    background: #007aff;
    color: #fff;
}
.pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: rgba(0,0,0,0.08);
    font-size: 11px;
    font-weight: 600;
    padding: 0 5px;
}
.policy-city-pill:hover .pill-count {
    background: rgba(255,255,255,0.2);
}

/* 城市政策区域 */
.policy-city-section {
    padding: 0 0 8px;
}
.policy-city-title {
    font-family: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    padding: 16px 0 12px;
    margin: 0 0 16px;
    border-bottom: 2px solid #007aff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.policy-city-title i {
    color: #007aff;
    font-size: 18px;
}
.city-count {
    font-size: 13px;
    font-weight: 500;
    color: #86868b;
    margin-left: auto;
}

/* 政策卡片列表 */
.policy-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

/* 政策卡片 */
.policy-card {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    padding: 20px 24px;
    transition: box-shadow 0.2s ease;
}
.policy-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.policy-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.policy-name {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.4;
    flex: 1;
}
.policy-status {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
}
.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}
.status-upcoming {
    background: #fff3e0;
    color: #e65100;
}
.status-ended {
    background: #fce4ec;
    color: #c62828;
}
.policy-summary {
    font-size: 13px;
    color: #6e6e73;
    line-height: 1.6;
    margin: 0 0 12px;
}

/* 权益 pill */
.policy-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.policy-benefit-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 8px;
    background: #f0f5ff;
    color: #007aff;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #d6e4ff;
    cursor: help;
}

/* 元信息 */
.policy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: #86868b;
    margin-bottom: 14px;
}
.policy-meta i {
    margin-right: 4px;
}

/* 操作按钮 */
.policy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f2;
}
.policy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 8px;
    background: #007aff;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
}
.policy-btn:hover {
    background: #0062cc;
    color: #fff;
    text-decoration: none;
}
.policy-btn-secondary {
    background: #f0f0f2;
    color: #515154;
    border: 1px solid #e5e5ea;
}
.policy-btn-secondary:hover {
    background: #e5e5ea;
    color: #1d1d1f;
}

/* 侧栏政策菜单 */
.sidebar-item .sidebar-count {
    float: right;
    font-size: 11px;
    color: #86868b;
    background: rgba(0,0,0,0.06);
    border-radius: 8px;
    padding: 0 6px;
    line-height: 18px;
}

/* 右侧栏标签云 */
.policy-tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}
.tagcloud-item {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 8px;
    background: #f0f5ff;
    color: #007aff;
    border: 1px solid #d6e4ff;
    cursor: help;
    line-height: 1.5;
    transition: all 0.2s ease;
}
.tagcloud-item:hover {
    background: #007aff;
    color: #fff;
    border-color: #007aff;
}

/* =========================================================
   热点榜单页面 /hot/
   ========================================================= */
.hot-layout {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}
.hot-container {
    width: 100%;
}
.hot-header {
    text-align: center;
    margin-bottom: 48px;
}
.hot-title {
    font-family: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 12px;
}
.hot-desc {
    font-size: 15px;
    color: #6e6e73;
    line-height: 1.6;
    max-width: 640px;
    margin: 0 auto;
}
.hot-section {
    margin-bottom: 48px;
}
/* 顶部导航 pills */
.hot-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 40px;
    padding: 0 4px;
}
.hot-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 24px;
    background: #f0f0f2;
    color: #515154;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.hot-nav-item:hover {
    background: #007aff;
    color: #fff;
    text-decoration: none;
}
.hot-nav-item i {
    font-size: 15px;
}

.hot-section-title {
    font-family: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 -24px 6px;
    padding: 14px 24px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 60px;
    z-index: 10;
    background: #f8f9fa;
    border-bottom: 2px solid #007aff;
}
.hot-section-title i {
    color: #007aff;
    font-size: 20px;
}
.hot-section-desc {
    font-size: 13px;
    color: #86868b;
    margin: 0 0 20px;
}
.hot-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.hot-card {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}
.hot-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}
.hot-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 0;
}
.hot-card-rank {
    font-size: 13px;
    font-weight: 700;
    color: #86868b;
    flex-shrink: 0;
}
.hot-card:nth-child(1) .hot-card-rank {
    color: #007aff;
}
.hot-card:nth-child(2) .hot-card-rank {
    color: #5856d6;
}
.hot-card:nth-child(3) .hot-card-rank {
    color: #34c759;
}
.hot-card-source {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 6px;
    background: #e8f5e9;
    color: #2e7d32;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.hot-card-source-tool {
    background: #e3f2fd;
    color: #1565c0;
}
.hot-card-source-ext {
    background: #fef3e2;
    color: #e65100;
}
.hot-card-body {
    padding: 10px 18px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hot-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hot-card-desc {
    font-size: 12px;
    color: #6e6e73;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hot-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: #86868b;
    margin-top: auto;
}
.hot-card-footer {
    display: flex;
    gap: 8px;
    padding: 12px 18px 16px;
}
.hot-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 8px;
    background: #007aff;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
}
.hot-card-btn:hover {
    background: #0062cc;
    color: #fff;
    text-decoration: none;
}
.hot-card-btn-outline {
    background: transparent;
    color: #007aff;
    border: 1px solid #007aff;
}
.hot-card-btn-outline:hover {
    background: #007aff;
    color: #fff;
}
.hot-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 8px;
    background: #007aff;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
}
.hot-btn:hover {
    background: #0062cc;
    color: #fff;
    text-decoration: none;
}
.hot-btn-outline {
    background: transparent;
    color: #007aff;
    border: 1px solid #007aff;
}
.hot-btn-outline:hover {
    background: #007aff;
    color: #fff;
}
.hot-footer {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #e5e5ea;
    font-size: 12px;
    color: #86868b;
    margin-top: 16px;
}
.hot-footer code {
    background: #f0f0f2;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* policy 页警告框 */
.policy-notice {
    background: #fef8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 24px 0 8px;
    font-size: 13px;
    color: #6b5e4a;
    line-height: 1.7;
    border-left: 4px solid #ff9500;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.policy-notice p {
    margin-bottom: 6px;
}
.policy-notice-last {
    margin-bottom: 0;
}
.policy-notice i {
    color: #ff9500;
    margin-right: 6px;
}

/* ===== report 数据报告页 ===== */
.report-wrapper {
    width: 100%;
    background: #f5f5f7;
    min-height: calc(100vh - 60px);
    padding-top: 24px;
}
.report-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 40px;
}
#report-export {
    padding: 32px;
    background: #fff;
    border-radius: 12px;
}
.report-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.report-title {
    font-size: 26px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 8px;
}
.report-desc {
    font-size: 14px;
    color: #6e6e73;
    margin: 0;
    line-height: 1.6;
    max-width: 600px;
}
.report-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #007aff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .1s;
    flex-shrink: 0;
}
.report-download-btn:hover { background: #0062cc; }
.report-download-btn:active { transform: scale(.97); }
.report-download-btn:disabled { background: #8e8e93; cursor: not-allowed; }

.report-section {
    margin-bottom: 28px;
}
.report-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5ea;
}
.report-section-title i { margin-right: 8px; color: #007aff; }

/* KPI */
.report-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.report-kpi-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 22px 16px;
    text-align: center;
    border: 1px solid #e5e5ea;
    transition: transform .15s, box-shadow .15s;
}
.report-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: #007aff;
    line-height: 1.2;
    font-family: "SF Pro Display", -apple-system, sans-serif;
}
.kpi-label {
    font-size: 13px;
    color: #6e6e73;
    margin-top: 6px;
}

/* Charts */
.report-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.report-chart-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e5ea;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.report-chart-box h3 {
    font-size: 14px;
    font-weight: 600;
    color: #6e6e73;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.report-chart-box canvas {
    max-height: 280px;
}

/* Rankings */
.report-ranking {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.report-ranking--horizontal {
    gap: 6px;
}
.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    transition: background .15s;
}
.rank-item:hover { background: #f0f1f2; }
.rank-num {
    width: 24px;
    text-align: center;
    font-weight: 700;
    color: #6e6e73;
    font-size: 14px;
    flex-shrink: 0;
}
.rank-name {
    flex: 1;
    color: #1d1d1f;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-bar {
    flex: 2;
    height: 8px;
    background: #e5e5ea;
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}
.rank-bar-fill {
    height: 100%;
    background: #007aff;
    border-radius: 4px;
    transition: width .6s ease;
}
.rank-bar-fill--green { background: #34c759; }
.rank-bar-fill--orange { background: #ff9500; }
.rank-count, .rank-amount {
    width: 50px;
    text-align: right;
    color: #6e6e73;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}
.rank-amount { color: #ff9500; }

/* Tagcloud */
.report-tagcloud {
    padding: 10px;
    line-height: 2.2;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
}
.report-tagcloud .tagcloud-item {
    display: inline-block;
    cursor: default;
    transition: transform .15s;
    padding: 2px 4px;
}
.report-tagcloud .tagcloud-item:hover {
    transform: scale(1.1);
}

/* Footer */
.report-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e5e5ea;
    text-align: center;
    color: #8e8e93;
    font-size: 12px;
}
.report-footer-note {
    margin-top: 4px;
    font-size: 11px;
}

/* Error / empty */
.report-error {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: #ff3b30;
    background: #fff2f0;
    border-radius: 12px;
    font-size: 15px;
}
.report-empty {
    padding: 20px;
    text-align: center;
    color: #8e8e93;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 992px) {
    .report-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .report-chart-row { grid-template-columns: 1fr; }
    .report-actions { flex-direction: column; }
    .report-title { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════════════
   ── App-Page 专属样式（管理后台 / 用户中心）
   作用域：.app-page（通过 app-page.html 布局加载）
   不影响首页、博客、资料、政策等页面
   ═══════════════════════════════════════════════════════════════ */

/* 1. CSS 变量 */
.app-page {
    --bg-page: #f5f5f7;
    --bg-card: #ffffff;
    --bg-sidebar: rgba(255,255,255,0.76);
    --bg-topbar: rgba(255,255,255,0.82);
    --bg-input: #ffffff;
    --bg-hover: rgba(0,0,0,0.04);
    --bg-active: rgba(0,122,255,0.08);

    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;
    --text-inverse: #ffffff;

    --border-color: #d2d2d7;
    --border-light: rgba(0,0,0,0.06);

    --accent-blue: #007aff;
    --accent-red: #ff3b30;
    --accent-green: #34c759;
    --accent-orange: #ff9500;
    --accent-purple: #af52de;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --font-sans: -apple-system, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-display: "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", sans-serif;
    --font-mono: "SF Mono", "SFMono-Regular", "JetBrains Mono", monospace;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --topbar-height: 60px;
    --sidebar-width: 220px;
}

/* Dark Mode */
.io-black-mode .app-page,
.io-grey-mode .app-page,
.app-page[data-theme="dark"] {
    --bg-page: #1c1c1e;
    --bg-card: #2c2c2e;
    --bg-sidebar: rgba(44,44,46,0.85);
    --bg-topbar: rgba(44,44,46,0.85);
    --bg-input: #3a3a3c;
    --bg-hover: rgba(255,255,255,0.06);
    --bg-active: rgba(0,122,255,0.15);

    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --text-tertiary: #636366;

    --border-color: #38383a;
    --border-light: rgba(255,255,255,0.06);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* 2. Layout */
.app-page {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Top Bar */
.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 24px;
}
.app-topbar .topbar-logo {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.app-topbar .topbar-logo:hover { opacity: 0.8; }
.app-topbar .topbar-logo img { height: 28px; }
.app-topbar .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Body wrapper (pushes below topbar) */
.app-body {
    display: flex;
    flex: 1;
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-light);
    padding: 16px 8px;
    position: sticky;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
}
.app-sidebar .sidebar-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 12px 6px;
}
.app-sidebar .sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 40px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}
.app-sidebar .sidebar-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
    color: var(--text-primary);
}
.app-sidebar .sidebar-item.active {
    background: var(--bg-active);
    color: var(--accent-blue);
    font-weight: 600;
}
.app-sidebar .sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* Content Area */
.app-content {
    flex: 1;
    padding: 32px;
    max-width: 100%;
    overflow-x: hidden;
}

/* 3. Cards */
.app-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 24px 28px;
}
.app-card + .app-card { margin-top: 20px; }
#userPage > * + * { margin-top: 20px; }
.app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.app-card-header h1,
.app-card-header h2,
.app-card-header h3 { margin: 0; }
.app-card-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 4. Buttons */
.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}
.app-btn:hover { text-decoration: none; }
.app-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.app-btn-primary {
    background: var(--accent-blue);
    color: var(--text-inverse);
    border-color: var(--accent-blue);
}
.app-btn-primary:hover { background: #0066d6; color: var(--text-inverse); }
.app-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.app-btn-secondary:hover { background: var(--bg-hover); }
.app-btn-danger {
    background: var(--accent-red);
    color: var(--text-inverse);
    border-color: var(--accent-red);
}
.app-btn-danger:hover { background: #d63031; }
.app-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.app-btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.app-btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: var(--radius-sm); }
.app-btn-lg { height: 48px; padding: 0 28px; font-size: 16px; border-radius: 10px; }

/* 5. Inputs & Forms */
.app-input {
    height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}
.app-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}
.app-input::placeholder { color: var(--text-tertiary); }
.app-input-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.app-select {
    height: 40px;
    padding: 0 32px 0 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.app-select:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
.app-form-group { margin-bottom: 16px; }
.app-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* 6. Tables */
.app-table-wrap { overflow-x: auto; }
.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.app-table thead th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}
.app-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}
.app-table tbody tr:hover td { background: var(--bg-hover); }
.app-table tbody tr:last-child td { border-bottom: none; }

/* 7. Badges */
.app-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.app-badge-blue { background: rgba(0,122,255,0.12); color: var(--accent-blue); }
.app-badge-red { background: rgba(255,59,48,0.12); color: var(--accent-red); }
.app-badge-green { background: rgba(52,199,89,0.12); color: var(--accent-green); }
.app-badge-orange { background: rgba(255,149,0,0.12); color: var(--accent-orange); }
.app-badge-gray { background: var(--bg-hover); color: var(--text-secondary); }

/* 8. Admin Section (dashboard, permissions, etc.) */
.admin-section .admin-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.admin-section .admin-toolbar .app-input { max-width: 280px; }
.admin-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Permissions Grid */
.perms-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.perms-role-section {
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.perms-role-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}
.perms-role-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 10px;
    color: #fff;
}
.perms-count { font-size: 12px; color: var(--text-tertiary); }
.perms-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    padding: 16px;
}
.perms-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.perms-toggle:hover { border-color: var(--accent-blue); }
.perms-toggle.checked { background: var(--bg-active); border-color: var(--accent-blue); }
.perms-toggle.disabled { opacity: 0.5; cursor: not-allowed; }
.perms-toggle input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
    flex-shrink: 0;
}
.perms-toggle.disabled input { cursor: not-allowed; }
.perms-toggle-label { font-size: 12px; color: var(--text-primary); line-height: 1.3; }

/* Role Badges */
.role-badge {
    font-size: 10px; padding: 2px 8px; border-radius: 10px;
    font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.role-badge.role-vip { background: linear-gradient(135deg,#FFD700,#FFA500); color: #333; }
.role-badge.role-svip { background: linear-gradient(135deg,#AF52DE,#5856D6); color: #fff; }
.role-badge.role-admin { background: linear-gradient(135deg,#FF3B30,#C0392B); color: #fff; }

/* Dashboard Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}
.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Profile Page */
.profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}
.profile-card .profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-card .profile-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}
.profile-card .profile-email {
    font-size: 14px;
    color: var(--text-secondary);
}

/* User Menu (in admin topbar) */
.app-topbar .user-menu-wrap {
    position: relative;
}
.app-topbar .user-menu-wrap .user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}
.app-topbar .user-menu-wrap .user-trigger:hover { background: var(--bg-hover); }
.app-topbar .user-menu-wrap .user-avatar-mini {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    font-weight: 600;
}
.app-topbar .user-menu-wrap .user-name-mini {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   ── Auth Pages (login / register / forgot / reset) ──
   ═══════════════════════════════════════════ */

/* Reset main when used as auth page layout */
.app-page .app-content:has(> .auth-page) {
  padding: 0;
}

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
  min-height: calc(100vh - var(--topbar-height));
  box-sizing: border-box;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 4px;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 28px;
}

.auth-page .app-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
}

.auth-page .auth-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.auth-page .auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 16px;
  z-index: 2;
  pointer-events: none;
  transition: color 0.2s;
}

.auth-page .app-input:focus ~ .auth-input-icon {
  color: var(--accent-blue);
}

.auth-page .app-input {
  width: 100%;
  height: 44px;
  padding-left: 44px !important;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: all 0.2s;
}

.auth-page .app-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
  outline: none;
}

.io-black-mode .auth-page .app-input:focus,
.io-grey-mode .auth-page .app-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

.auth-page .auth-error {
  display: none;
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--accent-red);
  margin-bottom: 16px;
  text-align: center;
}

.auth-page .auth-success {
  display: none;
  font-size: 14px;
  color: var(--accent-green);
  text-align: center;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(52, 199, 89, 0.08);
  border: 1px solid rgba(52, 199, 89, 0.2);
  border-radius: 8px;
}

.auth-page .auth-success a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.auth-page .app-btn-primary {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
}

.auth-page .auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-page .auth-switch a {
  color: var(--accent-blue);
  font-weight: 500;
  text-decoration: none;
}

.auth-page .auth-switch a:hover {
  text-decoration: underline;
}

.auth-page .auth-forgot-link {
  text-align: right;
  margin-bottom: 16px;
}

.auth-page .auth-forgot-link a {
  font-size: 13px;
  color: var(--accent-blue);
  text-decoration: none;
}

.auth-page .auth-forgot-link a:hover {
  text-decoration: underline;
}

/* 9. Responsive / Mobile (app-page only) */
@media (max-width: 768px) {
    .app-topbar { padding: 0 16px; }
    .app-sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: -100%;
        width: 260px;
        height: calc(100vh - var(--topbar-height));
        z-index: 99;
        transition: left 0.3s ease;
        border-right: 1px solid var(--border-color);
    }
    .app-sidebar.open { left: 0; }
    .app-sidebar-overlay {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 98;
        display: none;
    }
    .app-sidebar-overlay.show { display: block; }
    .app-sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        border-radius: var(--radius-md);
        border: none;
        background: transparent;
        color: var(--text-primary);
        font-size: 18px;
        cursor: pointer;
    }
    .app-sidebar-toggle:hover { background: var(--bg-hover); }
    .app-content { padding: 20px 16px; }
    .app-card { padding: 16px 18px; }
    .app-table-wrap { margin: 0 -16px; padding: 0 16px; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .perms-items { grid-template-columns: repeat(2, 1fr); }
    .auth-page { margin: 40px 16px; }
}

/* Desktop sidebar toggle hidden */
.app-sidebar-toggle { display: none; }

@media (min-width: 769px) {
    .app-sidebar-overlay { display: none !important; }
}

/* ═══════════════════════════════════════════
   FAQ 页面（/faq/）
   ═══════════════════════════════════════════ */
.faq-page {
    max-width: 760px;
    margin: 0 auto;
}
.faq-title {
    font-family: -apple-system, "SF Pro Display", "Helvetica Neue", "PingFang SC", sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    margin: 0 0 8px;
}
.faq-intro {
    font-size: 14px;
    line-height: 1.6;
    color: #86868b;
    margin: 0 0 28px;
}
.faq-list {
    border-top: 1px solid #e5e5ea;
}
.faq-item {
    padding: 28px 0;
    border-bottom: 1px solid #e5e5ea;
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-question {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #1d1d1f;
    margin: 0 0 14px;
}
.faq-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    border-radius: 8px;
    background: #e8f0fe;
    color: #007aff;
    font-size: 13px;
    font-weight: 600;
    margin-top: 1px;
}
.faq-q-text {
    font-weight: 600;
}
.faq-answer {
    font-size: 14px;
    line-height: 1.75;
    color: #515154;
    padding-left: 40px;
}
@media (max-width: 576px) {
    .faq-title {
        font-size: 22px;
    }
    .faq-answer {
        padding-left: 0;
    }
}

/* ═══════════════════════════════════════════
   广告位（blog / book 列表页顶部）
   carousel(轮播) + marquee(跑马灯) 两套效果
   ═══════════════════════════════════════════ */
.ad-carousel {
    width: min(100%, var(--ad-width, 100%));
    margin: 0 auto;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5ea;
    overflow: hidden;
}
.ad-carousel .carousel-inner {
    height: var(--ad-height, 260px);
}
.ad-carousel .carousel-item,
.ad-carousel .carousel-item a {
    height: 100%;
    display: block;
}
.ad-carousel .carousel-item a {
    position: relative;
    overflow: hidden;
}
/* 模糊背景层：同一张图放大模糊铺满，填满完整显示主图之外的空隙 */
.ad-carousel .ad-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transform: scale(1.2);
}
.ad-carousel .ad-carousel-img {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    display: block;
}
/* 底部指示圆点 */
.ad-carousel .carousel-indicators {
    margin-bottom: 10px;
}
.ad-carousel .carousel-indicators li {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .6);
    border: 1px solid rgba(0, 0, 0, .15);
    transition: background-color .2s ease;
}
.ad-carousel .carousel-indicators .active {
    background-color: var(--accent-blue, #007aff);
}
/* 左右箭头 */
.ad-carousel .carousel-control-prev,
.ad-carousel .carousel-control-next {
    width: 60px;
    opacity: 0;
    transition: opacity .2s ease;
}
.ad-carousel:hover .carousel-control-prev,
.ad-carousel:hover .carousel-control-next {
    opacity: 1;
}
.ad-carousel .carousel-control-prev-icon,
.ad-carousel .carousel-control-next-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, .25);
    background-size: 50% 50%;
}
.ad-carousel .carousel-control-prev:hover .carousel-control-prev-icon,
.ad-carousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, .5);
}
@media (prefers-reduced-motion: reduce) {
    .ad-carousel .carousel-item {
        transition: none;
    }
}

/* ── 跑马灯效果 ── */
.marquee-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(100%, var(--ad-width, 100%));
    margin: 0 auto;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5ea;
    padding: 20px 24px;
    overflow: hidden;
}
.marquee-icon {
    flex-shrink: 0;
    color: var(--accent-green, #34c759);
    font-size: 18px;
    line-height: 1;
}
.marquee-track {
    flex: 1;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.marquee-content {
    display: flex;
    align-items: center;
    gap: 20px;
    width: max-content;
    white-space: nowrap;
    animation: marquee-scroll 40s linear infinite;
}
.marquee-content:hover {
    animation-play-state: paused;
}
.marquee-ad {
    flex-shrink: 0;
    display: block;
    text-decoration: none;
}
.marquee-ad img {
    height: var(--ad-height, 140px);
    width: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    transition: box-shadow .2s ease;
}
.marquee-ad:hover img {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-content {
        animation: none;
        overflow-x: auto;
        width: auto;
    }
}
@media (max-width: 992px) {
    .marquee-bar {
        padding: 16px 18px;
    }
}
@media (max-width: 576px) {
    .marquee-bar {
        padding: 12px 14px;
    }
}
