@font-face {
    font-family: 'HarmonyOS Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../font/HarmonyOS.woff2') format('woff2');
}

/* ========== Theme Variables (Light) ========== */
:root {
    /* 主色（翠绿） */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-deep: #047857;
    --primary-soft: #ecfdf5;
    --primary-border: #a7f3d0;

    /* 深色导航色（顶栏/页脚/按钮） */
    --navy: #2b3a4a;
    --navy-dark: #1c2836;

    /* 中性色 */
    --bg: #f5f6f8;
    --card-bg: #ffffff;
    --bg-input: #f6f8f9;
    --bg-hover: #f2f3f5;
    --border: #e5e6eb;
    --border-light: #eef0f3;
    --text: #333333;
    --text-strong: #1d2129;
    --text-secondary: #4e5969;
    --text-muted: #999999;
    --text-faint: #bbbbbb;
}

/* ========== Theme Variables (Dark) ========== */
html[data-theme="dark"] {
    --primary: #34d399;
    --primary-dark: #10b981;
    --primary-deep: #059669;
    --primary-soft: rgba(16, 185, 129, 0.12);
    --primary-border: #1f4a38;

    --navy: #2a3646;
    --navy-dark: #1d2733;

    --bg: #10151c;
    --card-bg: #1a212b;
    --bg-input: #1e2733;
    --bg-hover: #232e3b;
    --border: #2c3847;
    --border-light: #232e3b;
    --text: #c8d2dc;
    --text-strong: #eef2f6;
    --text-secondary: #8b98a8;
    --text-muted: #6b7a8c;
    --text-faint: #56657a;
}

/* 主题切换过渡 */
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

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

body {
    font-family: 'HarmonyOS Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-width: 320px;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
}

input,
button {
    font-family: inherit;
}

/* ========== Top Bar ========== */

.top-bar {
    background: var(--navy);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
}

.top-bar-inner {
    width: 100%;
    max-width: 1300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.top-bar a,
.top-bar span {
    color: #fff;
}

.top-bar a:hover {
    text-decoration: underline;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#topbarDate {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.topbar-date {
    font-weight: 500;
    padding-right: 5px;
    position: relative;
}

.topbar-date::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
}

.topbar-week {
    font-weight: 400;
}

.top-bar-right .site-nav {
    display: flex;
    align-items: center;
}

.top-bar-right .nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
}

.top-bar-right .nav-link {
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.top-bar-right .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ========== Header ========== */

.header-wrap {
    width: 100%;
    padding: 0 8px;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header {
    max-width: 1300px;
    margin: 0 auto;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.logo {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: contain;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-strong);
    white-space: nowrap;
}

.header-divider {
    width: 1px;
    height: 32px;
    background: var(--border-light);
    opacity: 0.5;
}

.header-desc {
    font-size: 12px;
    color: var(--text-faint);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.header-desc p {
    line-height: 1.6;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Search Bar ========== */

.search-bar {
    position: relative;
    width: 400px;
    height: 44px;
    border-radius: 22px;
    padding: 0 4px 0 16px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    background: var(--card-bg);
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.search-engine-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 8px;
    border-right: 1px solid var(--border);
}

.search-engine-trigger img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.search-engine-trigger svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.engine-name-text {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-engine-trigger.open svg {
    transform: rotate(180deg);
}

.search-bar input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--text-strong);
}

.search-btn {
    width: 36px;
    height: 36px;
    background: var(--navy);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--navy-dark);
}

.search-btn svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.engine-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    width: 100%;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.engine-dropdown.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.engine-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.engine-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
}

.engine-item:hover {
    background: var(--bg-hover);
}

.engine-item img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
}

.engine-item span {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ========== Header Right Icons ========== */

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.header-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.header-icon:hover {
    opacity: 0.8;
}

.header-icon img {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.header-icon p {
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
}

/* ========== Main Content ========== */

.main-content {
    width: 100%;
    background: var(--bg);
    padding: 0 8px;
    flex: 1;
}

.main-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 32px;
}

/* ========== Section ========== */

.section {
    margin-bottom: 8px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin: 18px 0 12px;
    font-size: 14px;
    color: var(--text);
    gap: 12px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

/* 标题左侧绿色竖条装饰 */
.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary), #34d399);
    flex-shrink: 0;
}

.section-header .desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.section-header .sort-more {
    font-size: 12px;
    color: var(--text-strong);
    white-space: nowrap;
    margin-left: auto;
    opacity: 0.65;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    flex-shrink: 0;
}

/* 「查看更多」右侧箭头 */
.section-header .sort-more::after {
    content: '→';
    font-size: 13px;
    transition: transform 0.2s;
    line-height: 1;
}

.section-header .sort-more:hover {
    opacity: 1;
    color: var(--primary);
    border-color: var(--primary-border);
    background: var(--primary-soft);
}

.section-header .sort-more:hover::after {
    transform: translateX(3px);
}

/* ========== 最近打开记录 ========== */

.recent-section .section-header {
    margin-top: 4px;
}

.recent-hint {
    font-size: 12px;
    color: var(--text-faint);
    margin-left: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.recent-clear {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    transition: all 0.2s;
    cursor: pointer;
    user-select: none;
}

.recent-clear:hover {
    color: #ff6b35;
    border-color: rgba(255, 107, 53, 0.4);
    background: rgba(255, 107, 53, 0.08);
}

.empty-section {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ========== Link Grid ========== */

.link-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .link-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (max-width: 992px) {
    .link-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .link-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .top-bar-inner {
        padding: 0 12px;
    }

    .footer-bookmark {
        display: none;
    }

    .header {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        min-height: auto;
        padding: 12px 0;
        gap: 8px;
    }

    .header-left {
        flex: 1;
        justify-content: flex-start;
        min-width: 0;
        gap: 8px;
    }

    .header-left .logo {
        flex-shrink: 0;
    }

    /* 移动端：搜索栏常显示，占满整行 */
    .search-bar {
        width: 100%;
        order: 3;
        margin: 0 auto;
    }

    .header-right {
        flex: 0 0 auto;
        order: 2;
        gap: 12px;
    }

    .engine-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .section-header {
        height: auto;
        flex-wrap: wrap;
        gap: 6px;
        margin: 14px 0 10px;
    }

    .section-header .desc {
        width: 100%;
        margin-left: 0;
        padding-left: 12px;
    }
}

@media (max-width: 576px) {
    .top-bar {
        height: 32px;
        font-size: 11px;
    }

    .header-left {
        gap: 6px;
    }

    .header-left .header-desc {
        font-size: 11px;
        max-width: 45vw;
    }

    .header-left .header-desc p {
        line-height: 1.5;
        margin: 1px 0;
    }

    .header {
        padding: 10px 0;
    }

    .logo {
        width: 48px;
        height: 48px;
    }

    .logo-text {
        font-size: 20px;
    }

    .link-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .link-card {
        padding: 5px 8px;
        gap: 6px;
        height: 36px;
        border-radius: 7px;
    }

    .link-card img {
        width: 18px;
        height: 18px;
        border-radius: 4px;
    }

    .link-card p {
        font-size: 12px;
    }

    .main-content {
        padding: 0 6px;
    }

    .header-wrap {
        padding: 0 6px;
    }

    .search-bar {
        height: 38px;
        border-radius: 19px;
        padding: 0 4px 0 12px;
    }

    .search-btn {
        width: 30px;
        height: 30px;
    }

    .engine-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-right {
        gap: 10px;
    }

    .header-icon {
        gap: 2px;
    }

    .header-icon img {
        width: 26px;
        height: 26px;
    }

    .header-icon p {
        font-size: 11px;
    }

    .section-title {
        font-size: 15px;
    }

    .section-title::before {
        height: 14px;
    }

    .section-header .desc {
        font-size: 11px;
    }

    .footer {
        padding: 12px 6px;
    }

    .footer-links {
        gap: 6px;
        padding: 6px 8px;
    }

    .footer-links a {
        font-size: 11px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        font-size: 11px;
    }

    .side-toolbar {
        right: 10px;
        bottom: 170px;
    }

    .side-btn {
        width: 36px;
        height: 36px;
    }

    .article-container,
    .page-container,
    .comment-section {
        padding-left: 8px;
        padding-right: 8px;
    }

    .article-card,
    .page-card {
        padding: 16px;
    }

    .article-card h1 {
        font-size: 20px;
    }

    .article-meta {
        font-size: 12px;
        gap: 8px;
    }
}

/* ========== Link Card ========== */

.link-card {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.link-card:hover {
    border-color: var(--primary-border);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.link-card img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 5px;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.link-card:hover img {
    transform: scale(1.15);
}

.link-card p {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
    min-width: 0;
    transition: color 0.2s ease;
}

.link-card:hover p {
    color: var(--primary);
}

.link-card .red {
    color: #dc2626;
}

/* ========== Footer ========== */

.footer {
    background: var(--navy);
    padding: 8px 8px 16px;
    color: #fff;
    font-size: 12px;
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(21, 22, 24, 0.4);
    border-radius: 6px;
    padding: 8px 12px;
}

.footer-links a {
    color: #fff;
    white-space: nowrap;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-bottom-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-bottom a {
    color: #fff;
}

.footer-bottom .footer-sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

/* ========== Bookmark Tip ========== */

/* 暗色模式下的收藏提示卡片 */
html[data-theme="dark"] .bottom-bookmark-tip {
    background: linear-gradient(135deg, #1a212b 0%, #12281f 50%, #0e1d17 100%);
    color: #c8d2dc;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .bottom-bookmark-tip .green-url {
    color: #34d399;
}

html[data-theme="dark"] .bottom-bookmark-tip .key-label {
    border-bottom-color: #065f46;
}

.footer-bookmark {
    max-width: 1300px;
    margin: 0 auto;
    padding: 28px 16px 32px;
    background: transparent;
}

.bottom-bookmark-tip {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-soft) 50%, #d1fae5 100%);
    border: 1px solid var(--primary-border);
    border-radius: 22px;
    padding: 34px 44px;
    font-size: 18px;
    line-height: 1.7;
    color: #374151;
    text-align: center;
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.14), 0 3px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 顶部高亮光带 */
.bottom-bookmark-tip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #6ee7b7, var(--primary));
}

/* 右上角装饰光晕 */
.bottom-bookmark-tip::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent 70%);
    pointer-events: none;
}

.bookmark-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

.tip-text {
    display: inline;
}

.key-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 4px 16px;
    background: linear-gradient(180deg, #34d399 0%, var(--primary) 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    border-radius: 11px;
    border-bottom: 4px solid var(--primary-deep);
    box-shadow: 0 5px 12px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.green-url {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(5, 150, 105, 0.35);
    text-underline-offset: 4px;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* ========== Side Toolbar ========== */

.side-toolbar {
    position: fixed;
    right: 16px;
    bottom: 170px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-btn {
    width: 40px;
    height: 40px;
    background: var(--navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.side-btn:hover {
    opacity: 0.8;
}

/* 主题切换按钮：亮色显示太阳，暗色显示月亮 */
.side-btn .icon-moon {
    display: none;
}

html[data-theme="dark"] .side-btn .icon-sun {
    display: none;
}

html[data-theme="dark"] .side-btn .icon-moon {
    display: block;
}

/* ========== 分享按钮（高亮 + 晃动吸引注意） ========== */

#share-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    animation: share-pulse 1.6s ease-in-out infinite;
}

#share-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#share-btn svg {
    animation: share-wiggle 1.6s ease-in-out infinite;
    transform-origin: 50% 50%;
}

@keyframes share-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55), 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0), 0 2px 12px rgba(16, 185, 129, 0.35);
    }
}

@keyframes share-wiggle {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-12deg) scale(1.08); }
    20% { transform: rotate(10deg) scale(1.08); }
    30% { transform: rotate(-8deg); }
    40% { transform: rotate(6deg); }
    50% { transform: rotate(0deg); }
}

/* ========== 复制提示 Toast ========== */

.share-toast {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%) translateY(16px);
    z-index: 300;
    background: var(--card-bg);
    color: var(--text-strong);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    max-width: 90vw;
}

.share-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.share-toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--primary);
}

/* ========== QQ 浏览器环境提示弹窗 ========== */

.qq-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qq-overlay.show {
    opacity: 1;
    visibility: visible;
}

.qq-modal {
    position: relative;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px 28px 28px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
    transform: translateY(16px) scale(0.96);
    transition: transform 0.3s ease;
}

.qq-overlay.show .qq-modal {
    transform: translateY(0) scale(1);
}

.qq-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qq-close:hover {
    background: var(--border);
}

.qq-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #34d399);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

.qq-icon svg {
    width: 28px;
    height: 28px;
}

.qq-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 8px;
}

.qq-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.qq-copy {
    width: 100%;
    padding: 12px 0;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.qq-copy:hover {
    background: var(--primary-dark);
}

.qq-copy.copied {
    background: var(--primary-dark);
}

/* ========== Navigation Dropdown ========== */

.nav-user-menu {
    position: relative;
}

.nav-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    min-width: 120px;
    list-style: none;
    padding: 4px 0;
    z-index: 100;
}

.nav-user-menu:hover .nav-dropdown {
    display: block;
}

.nav-dropdown li a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.2s;
}

.nav-dropdown li a:hover {
    background: var(--bg);
}

/* ========== Article Detail (echo_log) ========== */

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.article-card {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.article-card h1 {
    font-size: 24px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.article-meta a {
    color: var(--text-secondary);
}

.article-meta a:hover {
    color: var(--text-strong);
}

.article-content {
    line-height: 1.8;
    font-size: 15px;
    color: var(--text);
    word-wrap: break-word;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

.article-content a {
    color: var(--text-strong);
    text-decoration: underline;
}

.article-content p {
    margin-bottom: 12px;
}

.article-content h2,
.article-content h3 {
    margin: 20px 0 12px;
}

.article-cover {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 16px;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}

.article-nav a {
    color: var(--text-strong);
    font-size: 13px;
}

.article-nav a:hover {
    text-decoration: underline;
}

/* ========== Page Template ========== */

.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.page-card {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-card h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

.page-content {
    line-height: 1.8;
    font-size: 15px;
    color: var(--text);
}

.page-content img {
    max-width: 100%;
    height: auto;
}

/* ========== 聚合热搜榜 (page_hotlist.php) ========== */

/* 热搜榜页面用宽容器，覆盖默认 page 的 800px 限制，保持多列布局 */
.hotlist-page {
    max-width: 1400px;
}

/* 外层大卡透明化，让平台白卡直接浮在页面背景上（层次分明） */
.hotlist-card.page-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.hotlist-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #2d3fc7, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 8px;
}

.hotlist-desc {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.hotlist-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1300px) {
    .hotlist-board {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .hotlist-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hotlist-card .platform-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hotlist-card .platform-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.08);
    border-color: var(--primary-border);
}

.hotlist-card .platform-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.hotlist-card .platform-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-strong);
}

.hotlist-card .platform-time {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 3px 10px;
    border-radius: 30px;
    white-space: nowrap;
}

.hotlist-card .platform-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.hotlist-card .platform-list::-webkit-scrollbar {
    width: 5px;
}

.hotlist-card .platform-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.hotlist-card .platform-list::-webkit-scrollbar-track {
    background: transparent;
}

.hotlist-card .list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 6px;
    border-radius: 12px;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-light);
    min-width: 0;
}

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

.hotlist-card .list-item:hover {
    background: var(--bg-hover);
}

.hotlist-card .item-rank {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-faint);
    min-width: 34px;
    text-align: center;
    font-style: italic;
    flex-shrink: 0;
}

.hotlist-card .list-item:nth-child(1) .item-rank {
    color: #f59e0b;
}

.hotlist-card .list-item:nth-child(2) .item-rank {
    color: #9ca3af;
}

.hotlist-card .list-item:nth-child(3) .item-rank {
    color: #d97706;
}

.hotlist-card .item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hotlist-card .item-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hotlist-card .item-hot {
    font-size: 12px;
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.08);
    padding: 1px 10px;
    border-radius: 20px;
    align-self: flex-start;
    white-space: nowrap;
}

.hotlist-card .item-arrow {
    color: var(--text-faint);
    font-size: 16px;
    font-weight: 300;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.hotlist-card .list-item:hover .item-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

.hotlist-card .platform-loading,
.hotlist-card .platform-error,
.hotlist-card .platform-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.hotlist-card .platform-loading::before {
    content: '';
    display: block;
    width: 26px;
    height: 26px;
    margin: 0 auto 10px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: hotlist-spin 0.8s linear infinite;
}

@keyframes hotlist-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .hotlist-board {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hotlist-title {
        font-size: 26px;
    }

    .hotlist-card .platform-card {
        padding: 14px 12px;
    }
}

/* ========== Edit Link ========== */

.edit-link {
    font-size: 12px;
    color: var(--text-strong);
    opacity: 0.5;
    margin-left: 8px;
}

.edit-link:hover {
    opacity: 1;
}

/* ========== 404 ========== */

.error-page {
    text-align: center;
    padding: 80px 16px;
}

.error-page h1 {
    font-size: 72px;
    color: var(--text-faint);
    margin-bottom: 16px;
}

.error-page p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.error-page a {
    display: inline-block;
    padding: 10px 24px;
    background: var(--navy);
    color: #fff;
    border-radius: 6px;
    transition: opacity 0.2s;
}

.error-page a:hover {
    opacity: 0.85;
}

/* ========== Comments ========== */

.comment-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px 24px;
}

.comment-section h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.comment-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.6;
}

.comment-form {
    margin-top: 24px;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.comment-form textarea:focus {
    border-color: var(--text-strong);
}

.comment-form .btn {
    margin-top: 8px;
    padding: 8px 20px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.comment-form .btn:hover {
    opacity: 0.85;
}

/* ========== Banner Row (optional) ========== */

.banner-row {
    display: flex;
    gap: 8px;
    padding: 12px 0 4px;
}

.banner-item {
    flex: 1;
    height: 80px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
}

.banner-item img {
    height: 100%;
    object-fit: cover;
}

/* ========== Sort Page ========== */

.sort-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 16px 0 32px;
}

.sort-header {
    margin-bottom: 16px;
}

.sort-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.sort-header .sort-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ========== Pagination ========== */

.page-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.page-nav a,
.page-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.page-nav a:hover {
    border-color: var(--text-strong);
    color: var(--text-strong);
}

.page-nav .this-page {
    background: var(--navy);
    color: #fff;
    border-color: var(--text-strong);
    font-weight: 600;
}

.page-nav .disabled {
    color: var(--text-faint);
    cursor: not-allowed;
    border-color: var(--border-light);
}

.page-nav .pre-page {
    margin-right: 4px;
}

.page-nav .next-page {
    margin-left: 4px;
}

/* ========== Site Search ========== */

.site-search-section {
    max-width: 600px;
    margin: 24px auto;
    padding: 0 16px;
}

.site-search-form {
    display: flex;
    gap: 8px;
}

.site-search-form input {
    flex: 1;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 0 16px;
    font-size: 14px;
    background: var(--bg-input);
    outline: none;
    transition: all 0.3s;
}

.site-search-form input:focus {
    background: var(--card-bg);
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.site-search-form button {
    width: 44px;
    height: 44px;
    background: var(--navy);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.site-search-form button:hover {
    background: var(--navy-dark);
}

.site-search-form button svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.site-search-results {
    margin-top: 16px;
}

.site-search-results h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.site-search-item {
    display: block;
    background: var(--card-bg);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: box-shadow 0.2s;
}

.site-search-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.site-search-item .search-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 4px;
    line-height: 1.4;
}

.site-search-item .search-item-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.site-search-item .search-item-date {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 4px;
}
