: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;
}

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;
}

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;
    min-height: 100dvh;
    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;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.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;
}

.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);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--line);
}

.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, .ad--text .card__title {
    font-size: 17px;
}

.meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-5);
}

/* 追加此样式，不改动原有代码 */
.card-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 72px; /* 与缩略图等高，保持单行时也撑满 */
}

.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);
}
/* 👇 新增：让图片填满 4:3 区域 */
.placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /*object-fit: cover;         !* 等比例裁剪，填满 4:3 *!*/
    object-fit: contain;
}
.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 {
    margin: 12px 16px;
    padding: 12px;
    background: var(--surface-alt);
    border-radius: 10px;
    border: 1px solid var(--line-2);
    position: relative;
}

.banner-ad__body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.banner-ad__thumb {
    width: 120px;
    flex-shrink: 0;
}

.banner-ad__title {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.banner-ad__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.banner-ad__advertiser {
    font-size: 11px;
    color: var(--text-5);
}

.banner-ad__cta {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.banner-ad__tools {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.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 img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}


/* ===== 折叠展开begin ===== */
.article-body {
    position: relative;
    overflow: hidden;
    max-height: 280px;
    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: 5px 0 5px;
    font-size: 11px;
    color: var(--text-6);
}

.ba-text {
    text-align: center;
    padding: 5px 0 5px;
    font-size: 11px;
    color: var(--text-6);
}

.interstitial {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    animation: fadeIn .2s ease-out;
}

.interstitial.is-hidden {
    display: none;
}

.interstitial__close {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.interstitial__card {
    width: min(300px, calc(100vw - 48px));
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn .24s cubic-bezier(.2, .9, .3, 1.1);
}

.interstitial__hero {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: repeating-linear-gradient(135deg, #2c2a26 0 8px, #38342e 8px 16px);
}

.interstitial__hero-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    letter-spacing: .5px;
    font-family: ui-monospace, monospace;
}

.interstitial__brand {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    padding: 2px 6px;
    letter-spacing: .4px;
}

.interstitial__body {
    padding: 14px 16px;
}

.interstitial__sub {
    font-size: 11px;
    color: var(--text-5);
    margin-bottom: 6px;
}

.interstitial__title {
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.interstitial__desc {
    font-size: 12px;
    color: var(--text-4);
    margin-bottom: 12px;
}

.interstitial__cta {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
