:root { 
    --primary: #0065cc; 
    --bg-body: #f4f5f7; 
    --bg-card: #ffffff; 
    --text-main: #333333; 
    --text-sub: #888888; 
    --border: #e1e4e8; 
    --shadow: 0 4px 12px rgba(0,0,0,0.05); 
    --card-overlay: rgba(255, 255, 255, 0.60);
}
[data-theme="dark"] { 
    --primary: #4da3ff; 
    --bg-body: #121212; 
    --bg-card: #1e1e1e; 
    --text-main: #e0e0e0; 
    --text-sub: #a0a0a0; 
    --border: #333333; 
    --shadow: none; 
    --card-overlay: rgba(30, 30, 30, 0.70);
}
@property --border-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 基础设置 */
html { 
    overflow-y: scroll; scroll-behavior: smooth; 
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg-body); color: var(--text-main); margin: 0; line-height: 1.6; padding-top: 75px; overflow-x: hidden; transition: background 0.3s, color 0.3s; }
a { text-decoration: none; color: var(--text-main); transition: 0.2s; } a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }

#translate { display: none; }

/* Header */
header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: fixed; top: 0; left: 0; width: 100%; height: 60px; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.05); backdrop-filter: blur(10px); }
[data-theme="dark"] header { box-shadow: none; }
.header-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.site-desc-tag { margin-left: 12px; font-size: 13px; color: var(--text-sub); font-weight: normal; letter-spacing: 0; }
@media (max-width: 768px) { .site-desc-tag { display: none; } }
.main-nav { display: flex; gap: 20px; overflow-x: auto; flex-grow: 1; align-items: center; margin-left: 30px; }
.main-nav a { font-weight: 500; font-size: 0.95rem; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.search-input { background: var(--bg-body); border: 1px solid var(--border); color: var(--text-main); padding: 6px 14px; border-radius: 20px; font-size: 13px; width: 120px; transition: width 0.3s; outline: none; text-align: center; }
.search-input:focus { width: 180px; border-color: var(--primary); }
.theme-toggle { cursor: pointer; background: none; border: 1px solid var(--border); color: var(--text-main); padding: 4px 10px; border-radius: 4px; }

/* Layout */
.container { max-width: 1400px; margin: 20px auto 0 auto; padding: 0 20px; display: flex; gap: 25px; } 
.col-main { flex-grow: 1; min-width: 0; }
.col-side { width: 260px; flex-shrink: 0; position: static; z-index: 1; }

/* Components */
.sidebar-card, .post-card, .focus-wrap { background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 20px; }
.sidebar-card { padding: 15px; }
.focus-wrap { padding: 15px; text-align: center; border-style: dashed; color: var(--text-sub); overflow: hidden; }
.focus-wrap:empty { display: none; }
.sticky-card { position: -webkit-sticky; position: sticky; top: 80px; z-index: 10; }
.ad-block-warning { background: #ffe6e6; color: #d93025; padding: 15px; border: 1px dashed #ff4d4f; border-radius: 4px; font-size: 14px; font-weight: bold; margin-bottom: 10px; display: none; }
#ads-test-bait { height: 1px; width: 1px; position: absolute; left: -9999px; }

.sidebar-title { font-size: 14px; font-weight: 700; color: var(--text-sub); margin-bottom: 12px; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 8px; }
.sidebar-list a { display: block; font-size: 14px; line-height: 1.4; padding: 4px 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sidebar-list a:hover { transform: translateX(3px); }

/* Post Card */
.post-card { padding: 30px; transition: all 0.3s; background-repeat: no-repeat; background-position: center center; background-size: cover; position: relative; border: none; border-radius: 12px; z-index: 1; }
.post-card::after { content: ""; position: absolute; inset: 0; border-radius: 12px; padding: 2px; background: conic-gradient(from var(--border-angle), var(--ls-border-color, var(--primary)) 0%, transparent 15%, transparent 33%, var(--ls-border-color, var(--primary)) 33%, transparent 48%, transparent 66%, var(--ls-border-color, var(--primary)) 66%, transparent 81%); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spinBorder 4s linear infinite; pointer-events: none; z-index: -1; }
@keyframes spinBorder { to { --border-angle: 360deg; } }
.post-card.has-bg { background-image: linear-gradient(var(--card-overlay), var(--card-overlay)), var(--post-bg-url); }
.post-card.is-sticky { background-image: linear-gradient(to bottom right, var(--bg-card), rgba(255, 77, 79, 0.05)); }
.post-card.is-sticky::after { background: conic-gradient(from var(--border-angle), #ff4d4f 0%, transparent 15%, transparent 33%, #ff4d4f 33%, transparent 48%, transparent 66%, #ff4d4f 66%, transparent 81%); }
.post-card.is-sticky.has-bg { background-image: linear-gradient(var(--card-overlay), var(--card-overlay)), linear-gradient(to bottom right, transparent, rgba(255, 77, 79, 0.1)), var(--post-bg-url); }

.post-title { font-size: 1.7rem; font-weight: 700; display: block; margin-bottom: 12px; line-height: 1.3; position: relative; z-index: 2; }
.sticky-tag { background: #ff4d4f; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 12px; margin-right: 5px; vertical-align: middle; }
.post-meta { font-size: 0.85rem; color: var(--text-sub); display: flex; gap: 15px; align-items: center; flex-wrap: wrap; position: relative; z-index: 50; }
.cat-tag { color: #fff !important; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.meta-copy-btn { background: transparent; border: 1px solid var(--border); color: var(--text-sub); font-size: 12px; padding: 2px 8px; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; height: 26px; box-sizing: border-box; }
.meta-copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.meta-copy-btn.copied { border-color: #2e7d32; color: #2e7d32; background: #e8f5e9; }
.meta-copy-btn svg { width: 12px; height: 12px; fill: currentColor; }

/* Grid Layout Fixes */
.posts-wrapper.is-grid { 
    display: grid; 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 15px; 
}
.posts-wrapper.is-grid .post-card { 
    margin-bottom: 0; 
    height: 100%; 
    padding: 18px 15px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}
.posts-wrapper.is-grid .post-title {
    font-size: 1.05rem; 
    line-height: 1.45;
    margin-bottom: 12px; 
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    order: 1; 
}
.posts-wrapper.is-grid .post-meta {
    margin-top: auto; 
    order: 2;
    gap: 8px;
    font-size: 12px;
}

/* QR Popover */
.meta-qr-wrapper { position: relative; display: inline-flex; align-items: center; vertical-align: middle; z-index: 200; }
.qr-popover { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: #fff; padding: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-radius: 8px; border: 1px solid var(--border); z-index: 20000; margin-top: 12px; width: 160px; text-align: center; }
.qr-popover::before { content: ""; position: absolute; top: -6px; left: 50%; margin-left: -6px; border-width: 0 6px 6px; border-style: solid; border-color: transparent transparent #fff transparent; z-index: 20001; }
[data-theme="dark"] .qr-popover { background: #fff; border-color: #ccc; } 
[data-theme="dark"] .qr-popover::before { border-color: transparent transparent #fff transparent; }
.qr-popover.show { display: block; animation: fadeInUp 0.2s ease; }
.qr-popover img, .qr-popover canvas { width: 100% !important; height: auto !important; display: block; margin: 0 auto; }
@keyframes fadeInUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Article Content */
.article-content { font-size: 1.05rem; line-height: 1.8; color: var(--text-main); white-space: pre-wrap !important; word-wrap: break-word; position: relative; z-index: 1; -webkit-text-size-adjust: 100%; }
.article-content br { display: none !important; }
.article-content p, .article-content div, .article-content blockquote, .article-content ul, .article-content ol { margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 0; padding-bottom: 0; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4 { margin-top: 1em !important; margin-bottom: 0.5em !important; font-weight: 700; line-height: 1.3; }
.article-content img, .article-content iframe, .article-content video { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 15px auto !important; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: default; }
@media (min-width: 769px) { .article-content img { cursor: zoom-in; } }
.article-content pre { background: #f6f8fa; padding: 20px; border-radius: 8px; font-family: Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 15px 0 !important; }
[data-theme="dark"] .article-content pre { background: #252525; }

/* Lightbox */
.ls-lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: all 0.25s ease; backdrop-filter: blur(5px); cursor: zoom-out; }
.ls-lightbox.active { opacity: 1; visibility: visible; }
.ls-lightbox img { max-width: 85%; max-height: 85%; object-fit: contain; box-shadow: 0 0 30px rgba(0,0,0,0.5); transform: scale(0.95); transition: transform 0.25s ease; cursor: default; }
.ls-lightbox.active img { transform: scale(1); }
.ls-lb-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2); color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; user-select: none; }
.ls-lb-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-50%) scale(1.1); }
.ls-lb-prev { left: 20px; } .ls-lb-next { right: 20px; }
@media (max-width: 768px) { .ls-lb-btn { width: 40px; height: 40px; font-size: 20px; background: rgba(0,0,0,0.5); border: none; } .ls-lb-prev { left: 10px; } .ls-lb-next { right: 10px; } .ls-lightbox img { max-width: 100%; max-height: 80%; } }

/* GZH Style */
.gzh-container { background: var(--bg-card); padding: 35px; border-radius: 0; margin-bottom: 20px; }
.gzh-title { font-size: 24px; font-weight: 600; line-height: 1.4; margin-bottom: 14px; }
.gzh-meta { display: flex; align-items: center; font-size: 15px; color: #888; margin-bottom: 30px; gap: 10px; }
.gzh-author { color: #576b95; font-weight: 500; cursor: pointer; }
.gzh-follow-box { margin-top: 40px; padding: 30px; background: #f7f7f7; border-radius: 8px; text-align: center; }
[data-theme="dark"] .gzh-follow-box { background: #252525; }
.gzh-qr { width: 160px; height: 160px; object-fit: cover; margin: 0 auto 15px; border-radius: 4px; }

/* Share Buttons */
.interact-zone { margin: 35px 0; display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 2; }
.i-chip { display: inline-flex; align-items: center; justify-content: center; padding: 6px 14px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #fff !important; text-decoration: none; border: none; cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.i-chip:hover { transform: translateY(-3px); box-shadow: 0 5px 12px rgba(0,0,0,0.2); filter: brightness(1.1); }
.is-wx { background: #07c160; } .is-wb { background: #E6162D; } .is-qq { background: #12B7F5; } .is-qz { background: #FFC107; color: #333 !important; } .is-db { background: #00B51D; } 
.is-x { background: #000000; } .is-fb { background: #1877F2; } .is-in { background: #0A66C2; } .is-tg { background: #26A5E4; } .is-wa { background: #25D366; } .is-ln { background: #06C755; } .is-rd { background: #FF4500; } .is-pn { background: #E60023; } .is-tm { background: #36465D; } .is-pk { background: #EF4056; } .is-en { background: #2DBE60; } .is-sk { background: #00AFF0; } .is-em { background: #757575; } 
.is-vk { background: #4a76a8; } .is-hn { background: #FF6600; } .is-fl { background: #E12828; } .is-pr { background: #607D8B; }

.copyright-box { margin-top: 20px; background: rgba(0,0,0,0.02); border: 1px solid var(--border); border-left: 4px solid var(--primary); padding: 20px 25px; border-radius: 8px; font-size: 0.95rem; position: relative; z-index: 2; }
.pagination { text-align: center; margin: 20px 0; color: var(--text-sub); }
.pagination a, .pagination span { display: inline-block; padding: 8px 14px; background: var(--bg-card); margin: 0 4px; border: 1px solid var(--border); border-radius: 6px; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
footer { text-align: center; padding: 25px 0; color: var(--text-sub); font-size: 0.9rem; border-top: 1px solid var(--border); margin-top: 0; background: var(--bg-card); }

/* Navigation */
.post-navigation { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 20px; border-top: 1px dashed var(--border); gap: 20px; position: relative; z-index: 2; }
.nav-box { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nav-prev { align-items: flex-start; text-align: left; }
.nav-next { align-items: flex-end; text-align: right; }
.nav-label { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; display: block; }
.nav-title { font-size: 15px; font-weight: 600; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.nav-title:hover { color: var(--primary); }

/* Carousel */
.ls-slider-box { position: relative; width: 100%; aspect-ratio: 3 / 1; max-height: 400px; background: var(--bg-card); border-radius: 8px; overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.ls-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease-in-out; z-index: 1; }
.ls-slide.active { opacity: 1; z-index: 2; }
.ls-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ls-dots { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; }
.ls-dot { width: 8px; height: 8px; background: rgba(255,255,255,0.5); border-radius: 50%; cursor: pointer; transition: 0.3s; }
.ls-dot.active { background: #fff; transform: scale(1.2); }
.ls-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.2); color: #fff; border: none; width: 40px; height: 60px; font-size: 24px; cursor: pointer; z-index: 4; transition: 0.3s; opacity: 0; display: flex; align-items: center; justify-content: center; }
.ls-slider-box:hover .ls-nav-btn { opacity: 1; }
.ls-prev { left: 0; border-radius: 0 4px 4px 0; }
.ls-next { right: 0; border-radius: 4px 0 0 4px; }
.ls-nav-btn:hover { background: rgba(0,0,0,0.6); }

/* Random Grid */
.random-box { margin-top: 30px; padding-top: 25px; position: relative; z-index: 2; }
.random-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 15px; color: var(--text-main); }
.random-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg-card); }
.random-item { display: block; padding: 12px 15px; border-bottom: 1px solid var(--border); border-right: 1px solid transparent; background: transparent; font-size: 14px; color: var(--text-main); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.random-grid .random-item:nth-child(odd) { border-right: 1px solid var(--border); }
.random-item:hover { background: rgba(0, 101, 204, 0.05); color: var(--primary); }
[data-theme="dark"] .random-item:hover { background: rgba(255,255,255,0.05); }

/* Tools */
.fixed-tools { position: fixed; bottom: 30px; right: 30px; z-index: 999; display: flex; flex-direction: column; gap: 12px; opacity: 0; visibility: hidden; transition: 0.3s; }
.fixed-tools.show { opacity: 1; visibility: visible; }
.tool-btn { width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-sub); cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.tool-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.tool-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* Obfuscated Global Pop (Anti-Adblock) */
.ls-pop-layer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 25000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.ls-pop-layer.active { opacity: 1; visibility: visible; }
.ls-pop-inner {
    background: var(--bg-card);
    width: 320px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid var(--border);
}
.ls-pop-layer.active .ls-pop-inner { transform: scale(1); }
.ls-pop-inner h3 { margin: 0 0 20px 0; font-size: 18px; color: var(--text-main); }
.ls-pop-inner .qr-container { width: 160px; height: 160px; margin: 0 auto 15px; display: flex; justify-content: center; align-items: center; }
.ls-pop-inner .qr-container img, .ls-pop-inner .qr-container canvas { width: 100% !important; height: auto !important; }
.ls-pop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 25px; }
.ls-pop-item { 
    display: flex; flex-direction: column; align-items: center; gap: 5px; 
    text-decoration: none; color: var(--text-sub); font-size: 12px; 
    transition: 0.2s; background: none; border: none; cursor: pointer;
}
.ls-pop-item:hover { color: var(--primary); transform: translateY(-3px); }
.ls-pop-icon { 
    width: 40px; height: 40px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    color: #fff; font-weight: bold; font-size: 14px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.ls-pop-close {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px; border-radius: 50%;
    background: transparent; border: none; font-size: 20px;
    color: var(--text-sub); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ls-pop-close:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }

/* Responsive Grid Switch & Mobile Title Clamp */
.mobile-bottom-nav { display: none; }
@media (max-width: 768px) { 
    .container { flex-direction: column; padding: 0 10px; margin-top: 15px; gap: 15px; } 
    .col-side, .col-main { width: 100%; } 
    .left-side, .right-side, .main-nav, .fixed-tools { display: none !important; } 
    .col-main { order: 1; } 
    .search-input { width: 80px; } .search-input:focus { width: 120px; } 
    .post-card { padding: 15px; } body { padding-bottom: 60px; } 
    .gzh-container { padding: 20px 15px; } .gzh-title { font-size: 20px; }
    .ls-slider-box { aspect-ratio: 2 / 1; }
    
    /* v14.00: 强制移动端全部标题限制 2 行并截断 */
    .post-card .post-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal; /* 确保长文本换行 */
    }

    /* 还原成单列列表 */
    .posts-wrapper.is-grid { display: block; }
    .posts-wrapper.is-grid .post-card { margin-bottom: 20px; min-height: auto; }
    .posts-wrapper.is-grid .post-title { font-size: 1.5rem; height: auto; }
    
    /* Hide QR on mobile */
    .meta-qr-wrapper { display: none !important; }

    .mobile-bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; width: 100%; height: 55px; background: var(--bg-card); border-top: 1px solid var(--border); z-index: 2000; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); align-items: center; justify-content: center; backdrop-filter: blur(10px); }
    .mobile-nav-item { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text-sub); font-size: 14px; font-weight: 500; flex: 0 0 auto; padding: 0 12px; height: 100%; position: relative; }
    .mobile-nav-item.active { color: var(--primary); font-weight: bold; }
    .mobile-nav-item:not(:last-child)::after { content: "|"; position: absolute; right: -2px; color: #e1e4e8; font-size: 12px; }
    
    .random-grid { grid-template-columns: 1fr; }
    .random-grid .random-item:nth-child(odd) { border-right: none; }

    /* Mobile Navigation Fix */
    .post-navigation { flex-direction: column; gap: 15px; }
    .nav-box { text-align: center; align-items: center; border-bottom: 1px dashed var(--border); padding-bottom: 15px; }
    .nav-box:last-child { border-bottom: none; padding-bottom: 0; }
    .nav-prev, .nav-next { text-align: center; align-items: center; }
}

/* 强制修复 iframe 溢出问题 */
.article-content iframe {
    width: 100% !important; max-width: 100% !important; height: auto !important; aspect-ratio: 16 / 9;
    display: block; margin: 15px 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.article-content iframe[src*="bilibili.com"] { border: none; }