:root {
    color-scheme: dark;
    --bg: #05070b;
    --bg-elevated: #0b0f17;
    --card: #111723;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f5f7fb;
    --muted: #94a0b5;
    --blue: #2d7dff;
    --blue-soft: rgba(45, 125, 255, 0.16);
    --danger: #ff5d72;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top center, rgba(45, 125, 255, 0.22), transparent 28%),
        linear-gradient(180deg, #07101c 0%, #05070b 22%, #05070b 100%);
    color: var(--text);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    overflow-x: hidden;
}

.app-shell {
    max-width: 860px;
    margin: 0 auto;
    padding: 12px 14px 96px;
    position: relative;
}

.pull-indicator {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
}

.pull-indicator.is-visible {
    height: 24px;
}

.page {
    display: none;
}

.page.is-active {
    display: block;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 2px 14px;
}

.drag-header {
    display: none !important;
}

.drag-handle {
    display: none !important;
}

.topbar-subtitle,
.section-kicker {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.topbar-title,
.section-head h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 700;
}

.hero-banner,
.section-card,
.tabbar {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(17, 23, 35, 0.98), rgba(10, 14, 22, 0.98));
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
}

.hero-banner,
.section-card {
    border-radius: 24px;
}

.section-card {
    padding: 16px;
    margin-top: 16px;
}

.ad-stream {
    margin-top: 14px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.sticky-head {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(180deg, rgba(17, 23, 35, 0.98), rgba(17, 23, 35, 0.86) 78%, rgba(17, 23, 35, 0));
    padding-bottom: 12px;
}

.hero-banner {
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.hero-banner.has-image {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hero-banner.is-strip {
    min-height: 0;
}

.hero-banner.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.hero-slide {
    position: relative;
    min-height: 0;
}

.hero-slide img,
.hero-image {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    display: block;
}

.hero-slide.is-strip img,
.hero-image.is-strip {
    height: auto;
    max-height: 104px;
    object-fit: contain;
    background: transparent;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 10, 17, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.hero-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    max-width: 88%;
    color: #ffffff;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.hero-dots {
    position: absolute;
    right: 14px;
    bottom: 12px;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
}

.hero-dot.is-active {
    width: 28px;
    background: var(--blue);
}

.ad-stream-list,
.news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ad-stream-list {
    gap: 8px;
}

.news-card,
.profile-block {
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(18, 25, 38, 0.98), rgba(10, 14, 22, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.news-cover {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    display: block;
}

.news-video {
    background: #000;
    object-fit: contain;
}

.ad-strip {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
    text-align: left;
    overflow: hidden;
    border-radius: 16px;
}

.ad-strip-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 16px;
    background: transparent;
}

.ad-strip.is-strip .ad-strip-image {
    max-height: 86px;
}

.ad-strip-fallback {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    font-weight: 600;
}

.news-link {
    color: #9ec4ff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.country-filter {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
}

.country-chip,
.subscription-chip {
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d1320;
    color: #d0d7e8;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.01em;
}

.country-chip.is-active,
.subscription-chip.is-active {
    background: var(--blue-soft);
    border-color: rgba(45, 125, 255, 0.32);
    color: #f3f7ff;
}

.news-card {
    padding: 16px 16px 14px;
}

.inline-ad-slot {
    margin: 2px 0;
}

.news-cover {
    height: 172px;
    margin-bottom: 12px;
    cursor: zoom-in;
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
}

.news-tag {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #c2ccde;
    padding: 3px 9px;
    letter-spacing: 0.01em;
}

.news-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.news-summary {
    margin: 0 0 12px;
    color: #9daabf;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-line;
}

.news-body {
    margin: 0 0 14px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #d7dfef;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
}

.news-body-paragraph {
    margin: 0 0 12px;
    white-space: pre-line;
}

.news-body-paragraph:last-child {
    margin-bottom: 0;
}

.news-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.news-action-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.text-link {
    color: var(--muted);
    font-size: 12px;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.88);
}

.image-lightbox.is-visible {
    display: flex;
}

.image-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.favorite-button {
    border: 1px solid rgba(45, 125, 255, 0.22);
    background: rgba(45, 125, 255, 0.08);
    color: #cfe0ff;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 12px;
}

.news-link-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.news-source-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
}

.favorite-button.is-active {
    background: rgba(255, 93, 114, 0.14);
    border-color: rgba(255, 93, 114, 0.32);
    color: #ffd7dc;
}

.list-status {
    padding: 18px 0 6px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.list-sentinel {
    height: 2px;
}

.profile-hero {
    padding: 18px;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(45, 125, 255, 0.9), rgba(19, 92, 205, 0.7));
    color: white;
    font-size: 22px;
    font-weight: 700;
}

.profile-name {
    margin: 0;
    font-size: 22px;
}

.profile-meta,
.profile-note {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(13, 19, 32, 0.98), rgba(9, 13, 20, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-value {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}

.stat-label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.subscription-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.compact-list .news-cover {
    height: 120px;
}

.empty-state {
    padding: 30px 12px;
    text-align: center;
    color: var(--muted);
}

.tabbar {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 860px;
    border-radius: 22px;
    backdrop-filter: blur(16px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 8px;
    z-index: 10;
}

.scroll-top-button {
    position: fixed;
    right: 18px;
    bottom: 96px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: rgba(45, 125, 255, 0.92);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 32px rgba(7, 18, 39, 0.34);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
    z-index: 11;
}

.scroll-top-button.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top-button:active {
    background: #1d6df0;
}

.tabbar-item {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
}

.tabbar-item.is-active {
    background: rgba(45, 125, 255, 0.16);
    color: white;
}

@media (max-width: 640px) {
    .app-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .topbar-title {
        font-size: 22px;
    }

    .ad-strip-image {
        border-radius: 14px;
    }

    .ad-strip.is-strip .ad-strip-image {
        max-height: 72px;
    }

    .hero-slide img {
        max-height: 200px;
    }

    .hero-slide,
    .hero-banner {
        min-height: 0;
    }

    .hero-banner.is-strip,
    .hero-slide.is-strip {
        min-height: 0;
    }

    .hero-slide.is-strip img,
    .hero-image.is-strip {
        max-height: 88px;
    }

    .news-cover {
        height: 152px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .scroll-top-button {
        right: 14px;
        bottom: 90px;
    }
}
