/* Telegram / 纸飞机官网 — 全新主题（靛青 + 青绿） */
:root {
    --tg-primary: #4f46e5;
    --tg-primary-dark: #3730a3;
    --tg-accent: #14b8a6;
    --tg-accent-light: #5eead4;
    --tg-bg: #0f172a;
    --tg-bg-soft: #1e293b;
    --tg-surface: #ffffff;
    --tg-surface-muted: #f1f5f9;
    --tg-border: #e2e8f0;
    --tg-text: #1e293b;
    --tg-text-muted: #64748b;
    --tg-radius: 12px;
    --tg-radius-lg: 20px;
    --tg-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --tg-shadow-lg: 0 12px 40px rgba(79, 70, 229, 0.12);
    --tg-container: min(1140px, 100% - 2rem);
    --tg-transition: 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.tg-site,
body.tg-inner {
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--tg-text);
    line-height: 1.65;
    margin: 0;
    background: var(--tg-surface);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* —— 导航 —— */
.z354b6navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tg-border);
    padding: 0.65rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.z354b6navbar .container {
    max-width: var(--tg-container);
}

.z354b6navbar-brand img {
    height: 42px;
    width: auto;
}

.z354b6nav-link {
    color: var(--tg-text) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.45rem 0.85rem !important;
    border-radius: 8px;
    transition: color var(--tg-transition), background var(--tg-transition);
}

.z354b6nav-link:hover,
.z354b6nav-item.active .z354b6nav-link {
    color: var(--tg-primary) !important;
    background: rgba(79, 70, 229, 0.08);
}

.navbar-toggler {
    border: 1px solid var(--tg-border);
    padding: 0.4rem 0.55rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

@media (max-width: 991px) {
    .z354b6navbar .navbar-collapse {
        margin-top: 0.75rem;
        padding: 0.75rem;
        border: 1px solid var(--tg-border);
        border-radius: var(--tg-radius);
        background: var(--tg-surface);
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* —— 首页 Hero —— */
.tg-hero {
    background: linear-gradient(145deg, var(--tg-bg) 0%, #1e1b4b 45%, var(--tg-primary-dark) 100%);
    color: #fff;
    padding: clamp(3rem, 8vw, 5.5rem) 0;
    position: relative;
    overflow: hidden;
}

.tg-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(20, 184, 166, 0.25), transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(79, 70, 229, 0.3), transparent 45%);
    pointer-events: none;
}

.tg-hero .container {
    max-width: var(--tg-container);
    position: relative;
    z-index: 1;
}

.tg-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.tg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.2);
    color: var(--tg-accent-light);
    margin-bottom: 1rem;
}

.tg-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
}

.tg-hero-lead {
    font-size: 1.05rem;
    opacity: 0.92;
    margin-bottom: 0.75rem;
}

.tg-hero-text {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: 1.5rem;
    max-width: 540px;
}

.tg-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tg-hero-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--tg-radius-lg);
    padding: 1.25rem;
    overflow: hidden;
}

.tg-hero-img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    margin: 0 auto;
}

/* —— 按钮 —— */
.tg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform var(--tg-transition), box-shadow var(--tg-transition), background var(--tg-transition);
    white-space: nowrap;
}

.tg-btn--light {
    background: #fff;
    color: var(--tg-primary-dark);
}

.tg-btn--accent {
    background: var(--tg-accent);
    color: #fff;
}

.tg-btn--outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.tg-btn--primary {
    background: linear-gradient(135deg, var(--tg-primary), var(--tg-primary-dark));
    color: #fff;
}

.tg-btn--block {
    width: 100%;
}

.tg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    color: inherit;
}

.tg-btn--primary:hover {
    color: #fff;
}

/* —— 区块通用 —— */
.tg-section {
    padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.tg-section--light {
    background: var(--tg-surface);
}

.tg-section--muted {
    background: var(--tg-surface-muted);
}

.tg-section--articles {
    background: var(--tg-surface-muted);
    border-top: 1px solid var(--tg-border);
}

.tg-section .container {
    max-width: var(--tg-container);
}

.tg-section-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 2.5rem;
}

.tg-section-head--left {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.tg-section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--tg-bg);
    margin-bottom: 0.75rem;
}

.tg-section-head p {
    color: var(--tg-text-muted);
    margin: 0;
    font-size: 1rem;
}

/* —— Bento 功能 —— */
.tg-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tg-bento-item {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    padding: 1.5rem;
    box-shadow: var(--tg-shadow);
    transition: border-color var(--tg-transition), box-shadow var(--tg-transition);
    overflow: hidden;
    min-height: 0;
}

.tg-bento-item:hover {
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: var(--tg-shadow-lg);
}

.tg-bento-item--wide {
    grid-column: span 2;
}

.tg-bento-item--accent {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(20, 184, 166, 0.08));
    border-color: rgba(79, 70, 229, 0.2);
}

.tg-bento-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--tg-primary), var(--tg-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.tg-bento-item h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: var(--tg-bg-soft);
}

.tg-bento-item p {
    font-size: 0.9rem;
    color: var(--tg-text-muted);
    margin: 0;
    line-height: 1.55;
}

/* —— 知识区 —— */
.tg-guide-panel {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius-lg);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--tg-shadow);
}

.tg-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.tg-guide-block {
    padding: 1.25rem;
    border-radius: var(--tg-radius);
    background: var(--tg-surface-muted);
    border: 1px solid var(--tg-border);
}

.tg-guide-block h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    color: var(--tg-primary-dark);
}

.tg-guide-block p {
    font-size: 0.9rem;
    color: var(--tg-text-muted);
    margin: 0;
}

/* —— 统计 —— */
.tg-stats {
    background: linear-gradient(90deg, var(--tg-primary) 0%, var(--tg-accent) 100%);
    color: #fff;
    padding: 2.5rem 0;
}

.tg-stats .container {
    max-width: var(--tg-container);
}

.tg-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}

.tg-stat strong {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
}

.tg-stat span {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* —— 下载 —— */
.tg-download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

.tg-download-card {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--tg-shadow);
    overflow: hidden;
    min-height: 0;
}

.tg-download-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tg-download-head h3 {
    font-size: 1.05rem;
    margin: 0 0 0.25rem;
}

.tg-download-head p {
    font-size: 0.85rem;
    color: var(--tg-text-muted);
    margin: 0;
}

.tg-platform-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

.tg-platform-icon--win {
    background: linear-gradient(135deg, #0ea5e9, #0369a1);
}

.tg-platform-icon--android {
    background: linear-gradient(135deg, #22c55e, #15803d);
}

.tg-platform-icon--ios {
    background: linear-gradient(135deg, #6366f1, #4338ca);
}

.tg-download-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    flex: 1;
}

.tg-download-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--tg-text-muted);
    padding: 0.35rem 0;
}

.tg-download-list i {
    color: var(--tg-accent);
    margin-top: 0.15rem;
}

.tg-download-card .tg-btn {
    margin-top: auto;
}

/* —— 安全 —— */
.tg-security-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.tg-security-item {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    box-shadow: var(--tg-shadow);
    overflow: hidden;
}

.tg-security-item i {
    font-size: 1.75rem;
    color: var(--tg-primary);
    margin-bottom: 0.75rem;
}

.tg-security-item h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.tg-security-item p {
    font-size: 0.85rem;
    color: var(--tg-text-muted);
    margin: 0;
}

/* —— FAQ —— */
.tg-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tg-faq-card {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--tg-shadow);
}

.tg-faq-card h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    color: var(--tg-primary-dark);
}

.tg-faq-card p {
    font-size: 0.9rem;
    color: var(--tg-text-muted);
    margin: 0;
}

/* —— 文章列表（首页） —— */
.tg-articles-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tg-articles-head h2 {
    font-size: 1.5rem;
    margin: 0;
}

.tg-link-more {
    color: var(--tg-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.tg-link-more:hover {
    color: var(--tg-accent);
}

.tg-articles-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.tg-article-card {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    overflow: hidden;
    box-shadow: var(--tg-shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tg-article-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-bottom: 1px solid var(--tg-border);
}

.tg-article-thumb img,
.z354b6thumb-home {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tg-article-body {
    padding: 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tg-article-meta {
    font-size: 0.75rem;
    color: var(--tg-text-muted);
    margin-bottom: 0.35rem;
}

.tg-article-body h3 {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tg-article-body h3 a {
    color: var(--tg-text);
    text-decoration: none;
}

.tg-article-body h3 a:hover {
    color: var(--tg-primary);
}

/* —— 页脚 —— */
.z354b6footer.tg-footer {
    background: var(--tg-bg);
    color: #94a3b8;
    padding: 3rem 0 1.5rem;
}

.tg-footer .container {
    max-width: var(--tg-container);
}

.tg-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.tg-footer-brand p {
    font-size: 0.9rem;
    margin-top: 0.75rem;
    line-height: 1.6;
}

.tg-footer h5 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.z354b6footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.z354b6footer-links li {
    margin-bottom: 0.5rem;
}

.z354b6footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--tg-transition);
}

.z354b6footer-links a:hover {
    color: var(--tg-accent-light);
}

.tg-footer-links-row h5 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.z354b6friend-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.z354b6friend-links a {
    color: #94a3b8;
    font-size: 0.85rem;
    text-decoration: none;
}

.z354b6friend-links a:hover {
    color: var(--tg-accent-light);
}

.tg-footer-bottom,
.z354b6footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
}

.tg-footer-bottom a,
.z354b6footer-bottom a {
    color: #94a3b8;
    text-decoration: none;
}

.tg-footer-bottom a:hover {
    color: var(--tg-accent-light);
}

.tg-footer-bottom p {
    margin: 0.35rem 0;
}

/* —— 内页 / 列表页 —— */
.tg-page-main {
    padding: 2.5rem 0 3.5rem;
    background: var(--tg-surface-muted);
    min-height: 50vh;
}

.tg-page-main .container {
    max-width: var(--tg-container);
}

.tg-page-header {
    margin-bottom: 1.5rem;
}

.tg-page-header h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    color: var(--tg-bg);
}

.tg-page-header p {
    color: var(--tg-text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.tg-content-card {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius-lg);
    box-shadow: var(--tg-shadow);
    overflow: hidden;
}

.tg-content-card .card-body {
    padding: 1.5rem;
}

.tg-sidebar-card {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    box-shadow: var(--tg-shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.tg-sidebar-card .card-body {
    padding: 1.25rem;
}

.tg-sidebar-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--tg-primary-dark);
}

.z354b6article-content {
    line-height: 1.75;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.z354b6article-content img {
    max-width: 100%;
    height: auto;
}

.z354b6thumb-cover {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    border-radius: var(--tg-radius);
}

.z354b6thumb-list,
.z354b6thumb-related {
    width: 100%;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
}

.z354b6thumb-side {
    width: 100%;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
}

.tg-side-thumb-wrap {
    width: 72px;
    flex: 0 0 72px;
}

.listbox .e2 li {
    border-bottom: 1px solid var(--tg-border) !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1rem !important;
}

.listbox .e2 li:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.pagebar .pagelist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagebar .pagelist li {
    display: inline-flex;
}

/* —— 响应式 —— */
@media (max-width: 1199px) {
    .tg-articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .tg-hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .tg-hero-text {
        margin-left: auto;
        margin-right: auto;
    }

    .tg-hero-actions {
        justify-content: center;
    }

    .tg-bento {
        grid-template-columns: 1fr 1fr;
    }

    .tg-bento-item--wide {
        grid-column: span 2;
    }

    .tg-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .tg-download-grid,
    .tg-security-grid {
        grid-template-columns: 1fr;
    }

    .tg-articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tg-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .tg-hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .tg-hero-actions .tg-btn {
        width: 100%;
    }

    .tg-bento {
        grid-template-columns: 1fr;
    }

    .tg-bento-item--wide {
        grid-column: span 1;
    }

    .tg-guide-grid,
    .tg-faq-grid {
        grid-template-columns: 1fr;
    }

    .tg-stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .tg-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tg-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .tg-footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .z354b6navbar-brand img {
        height: 36px;
    }

    .tg-content-card .card-body {
        padding: 1rem;
    }

    .z354b6thumb-list,
    .z354b6thumb-related {
        height: 72px;
    }

    .z354b6thumb-side {
        height: 50px;
    }

    .listbox .e2 .col-4 {
        flex: 0 0 35%;
        max-width: 35%;
    }

    .listbox .e2 .col-8 {
        flex: 0 0 65%;
        max-width: 65%;
    }
}

@media (max-width: 575px) {
    .tg-stats-row {
        grid-template-columns: 1fr;
    }

    .tg-articles-grid {
        grid-template-columns: 1fr;
    }

    .tg-section-head {
        margin-bottom: 1.5rem;
    }

    .tg-guide-panel {
        padding: 1.25rem;
    }

    .tg-download-card,
    .tg-security-item,
    .tg-faq-card {
        padding: 1.15rem;
    }

    .z354b6thumb-cover {
        max-height: 200px;
    }
}
