:root {
    --accent: #cc462e;
    --bg: #f2efe8;
    --surface: #fafaf7;
    --surface-2: #ffffff;
    --surface-alt: #faf8f3;
    --line: #f0eee9;
    --line-2: #efeadf;
    --text: #1a1a1a;
    --text-2: #555555;
    --text-3: #666666;
    --text-4: #888888;
    --text-5: #999999;
    --text-6: #bbbbbb;
    --chip: #eceae6;
    --chip-2: #e2dfd9;
    --shadow: 0 12px 32px rgba(26, 26, 26, 0.08);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-h: 98px;
    --footer-h: 34px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a, button, [role="tab"], [role="button"] {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    overscroll-behavior-y: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea {
    font: inherit;
    color: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

img, svg {
    display: block;
}

.page {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

@media (max-width: 559px) {
    .page {
        max-width: none;
        box-shadow: none;
    }
}

.page-content {
    flex: 1;
}

.hide-scrollbar::-webkit-scrollbar, .page-content::-webkit-scrollbar, .tabs::-webkit-scrollbar {
    display: none;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -40px;
    z-index: 999;
    background: var(--text);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
}

.skip-link:focus {
    top: 12px;
}

.header, .detail-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.status-bar {
    height: calc(54px + var(--safe-top));
    padding: calc(12px + var(--safe-top)) 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-bar__time {
    font-size: 17px;
    line-height: 22px;
    font-weight: 600;
}

.status-bar__icons {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
}

.status-bar__icons svg {
    width: auto;
    height: 12px;
}

.tabs-wrap {
    height: 44px;
    position: relative;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    overflow-x: auto;
    padding: 0 6px;
    white-space: nowrap;
}

.tabs__item {
    position: relative;
    height: 100%;
    padding: 0 12px;
    color: var(--text-3);
    font-size: 14px;
    line-height: 44px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.tabs__item.is-active {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.tabs__item.is-active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
}

.tabs-fade {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff);
    pointer-events: none;
}

.detail-header__bar {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.icon-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.detail-header__title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer {
    height: calc(34px + var(--safe-bottom));
    background: var(--surface);
    align-items: flex-end;
    justify-content: center;
    padding-bottom: calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    padding-top: 2px;
}

.footer__indicator {
    width: 139px;
    height: 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
}

.feed, .related-list {
    background: var(--surface-2);
}

.card {
    padding: 12px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    -webkit-tap-highlight-color: transparent;
}

.card:last-child {
    border-bottom: 0;
}

.card:active {
    background: #f7f6f2;
}

.card__row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.card__main {
    flex: 1;
    min-width: 0;
}

.card__title {
    font-size: 16px;
    line-height: 1.45;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.1px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
}

.card--text .card__title {
    font-size: 17px;
}

.ad--image > div, .ad--image iframe {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
}
.ad--image:not(:has(> *)) {
    display: none;
    padding: 0;
    border: 0;
}

.related-list .ad--image > div[data-ad-slot-id] {
    min-height: 96px;
    background: var(--surface-2);
}

/* 文字+右图布局 */
.card-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 72px;
}

.meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-5);
}

.meta__dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #ccc;
}

.meta__grow {
    flex: 1;
}

.meta__reads {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #bbb;
}

.thumb, .placeholder {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: var(--radius-md);
}

.thumb {
    width: 110px;
}

.placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: repeating-linear-gradient(135deg, var(--chip) 0 6px, var(--chip-2) 6px 12px);
}

.placeholder img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover !important;
    object-position: 50% 33%;
}

.placeholder--wide {
    aspect-ratio: 16 / 9;
}

.placeholder__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    color: var(--text-4);
    letter-spacing: 0.4px;
    font-weight: 500;
}

.tag {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 10px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--accent);
    color: #fff;
    font-weight: 500;
}

.gallery {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.gallery__item {
    position: relative;
}

.gallery__count {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.55);
    font-weight: 500;
}

.ad-badge-inline {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    color: #b5b0a6;
    letter-spacing: 0.4px;
}

.ad-badge-corner {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ad-close {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b5b0a6;
}

.ad-close--light {
    color: rgba(255, 255, 255, 0.92);
}

.ad-close svg {
    width: 12px;
    height: 12px;
}

.ad-actions-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ad-thumb-corner {
    position: absolute;
    right: 4px;
    bottom: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.banner-ad {
    padding: 12px 18px 0;
    background: var(--surface-2);
    position: relative;
}

.banner-ad > div, .banner-ad iframe {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
}

.article-header {
    padding: 12px 18px 0;
}

.article-title {
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}

.article-meta {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-5);
}

.article-meta__source {
    color: var(--text-2);
    font-weight: 500;
}

.article-body {
    padding: 18px 18px 8px;
}

.article-body p {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.75;
    color: #2a2a2a;
    /*letter-spacing: 0.1px;*/
}

.article-body h3 {
    margin: 8px 0 14px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.article-body figure {
    margin: 4px 0 18px;
}

.article-body iframe,
.article-body embed,
.article-body object,
.article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

.article-body video {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* ── 折叠展开 ─────────────────────────────────────── */
.article-body {
    position: relative;
    overflow: hidden;
    max-height: 260px;
    transition: max-height 0.4s ease;
}

.article-body.is-expanded {
    max-height: none;
}

.article-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--surface-2));
    pointer-events: none;
    transition: opacity 0.3s;
}

.article-body.is-expanded::after {
    opacity: 0;
}

.read-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 0 14px;
    font-size: 14px;
    color: var(--accent);
    cursor: pointer;
    background: var(--surface-2);
    border: none;
    width: 100%;
}
/* ===== 折叠展开end ===== */

.read-more-btn svg {
    transition: transform 0.3s;
}

.read-more-btn.is-hidden {
    display: none;
}


.article-actions {
    margin: 4px 18px 16px;
    display: flex;
    justify-content: center;
    gap: 28px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px;
}

.action-btn__label {
    font-size: 11px;
    color: var(--text-4);
}

.related-head {
    padding: 12px 18px 8px;
    border-top: 8px solid var(--bg);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.related-head__bar {
    width: 3px;
    height: 14px;
    border-radius: 1.5px;
    background: var(--accent);
}

.end-text {
    text-align: center;
    padding: 15px 0;
    font-size: 11px;
    color: var(--text-6);
}

.ba-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-6);
}

/* 卡片渲染动画 */
img.lazy {
    background: var(--chip);
}

.card--hidden {
    opacity: 0;
    -webkit-transform: translate3d(0, 10px, 0);
    transform: translate3d(0, 10px, 0);
    /* transition 放在这里，card--visible 加上后自动触发 */
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    will-change: opacity, transform;
}

.card--visible {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.card--no-anim {
    transition: none !important;
}
