/* ===== 背景光斑（与首页一致） ===== */
:root {
    --glow-top: #16204a;
    --blob-opacity: 0.55;
}

/* 浅色主题：跟随首页的主题开关（本页不提供切换按钮） */
[data-theme="light"] {
    --glow-top: #dbe6ff;
    --blob-opacity: 0.35;
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--glow-top) 0%, var(--bg) 60%);
    overflow: hidden;
}

.blob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--size);
    height: var(--size);
    margin-top: calc(var(--size) / -2);
    margin-left: calc(var(--size) / -2);
    border-radius: 50%;
    /* 模糊半径也跟着视口缩：光斑小、模糊也小，光才不会糊满整个小屏 */
    filter: blur(clamp(44px, 6.2vw, 90px));
    opacity: var(--blob-opacity);
    will-change: transform;
    animation: roam-a 44s ease-in-out infinite;
}

/* 四颗光斑各走一条环游全屏的轨迹，相位错开；尺寸用 clamp 随视口缩放——
   手机上保持屏幕宽度的三到五成，背景才留得住暗色，宽屏则维持原来的大小 */
.blob-1 { --size: clamp(190px, 30vw, 420px); background: #2563eb; animation-duration: 44s; }
.blob-2 { --size: clamp(160px, 26vw, 360px); background: #06b6d4; animation-name: roam-b; animation-duration: 52s; animation-delay: -10s; }
.blob-3 { --size: clamp(200px, 33vw, 460px); background: #7c3aed; animation-name: roam-c; animation-duration: 48s; animation-delay: -20s; }
.blob-4 { --size: clamp(120px, 19vw, 260px); background: #db2777; opacity: 0.35; animation-name: roam-d; animation-duration: 58s; animation-delay: -30s; }

/* 小屏上光斑尺寸已被 clamp 压小，再整体降一档透明度，背景才留得住暗色 */
@media (max-width: 640px) {
    :root { --blob-opacity: 0.42; }
}

/* 环游轨迹：以屏幕中心为原点，用 vw/vh 位移跑遍整屏，首尾一致无跳变 */
@keyframes roam-a {
    0%, 100% { transform: translate(-32vw, -34vh) scale(1); }
    25%      { transform: translate(30vw, -24vh) scale(1.12); }
    50%      { transform: translate(26vw, 30vh) scale(0.92); }
    75%      { transform: translate(-28vw, 26vh) scale(1.06); }
}
@keyframes roam-b {
    0%, 100% { transform: translate(-38vw, 22vh) scale(1); }
    25%      { transform: translate(-26vw, -30vh) scale(1.1); }
    50%      { transform: translate(24vw, -34vh) scale(0.94); }
    75%      { transform: translate(36vw, 18vh) scale(1.08); }
}
@keyframes roam-c {
    0%, 100% { transform: translate(20vw, -36vh) scale(1); }
    25%      { transform: translate(34vw, 10vh) scale(1.14); }
    55%      { transform: translate(-10vw, 34vh) scale(0.9); }
    80%      { transform: translate(-36vw, -6vh) scale(1.06); }
}
@keyframes roam-d {
    0%, 100% { transform: translate(-30vw, 34vh) scale(1); }
    30%      { transform: translate(22vw, 30vh) scale(1.12); }
    60%      { transform: translate(30vw, -26vh) scale(0.94); }
    85%      { transform: translate(-24vw, -32vh) scale(1.08); }
}

/* ===== 布局 ===== */
.container {
    /* width 不能省：body 是纵向弹性容器，margin:auto 的元素不会被拉伸 */
    width: min(1080px, 92%);
    margin: 0 auto;
}

.page-head {
    text-align: center;
    margin-bottom: 26px;
}

.page-head h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.3;
}

.subtitle {
    margin-top: 10px;
    color: var(--text-dim);
    font-size: 1rem;
}

/* ===== 日期选择栏 ===== */
.date-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: var(--glass-strong);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}

.icon-btn:hover:not(:disabled) {
    background: var(--glass);
    border-color: var(--stroke-strong);
    transform: translateY(-1px);
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.date-input {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: var(--glass-strong);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    /* 让原生日历面板跟随深色主题 */
    color-scheme: dark;
    cursor: pointer;
}

.date-input:focus {
    outline: none;
    border-color: var(--accent);
}

.today-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.25s ease, transform 0.25s ease;
}

.today-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.today-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.date-note {
    margin-top: 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.date-note[hidden] {
    display: none;
}

/* ===== 内容区 ===== */
/* 今日要闻 与 当日长图 左右并列、等宽；高度各自按内容（长图保持固定比例，不拉伸不裁切） */
.daily-grid {
    display: grid;
    /* minmax(0,…) 防止长文本把栅格撑破 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
    margin-top: 22px;
}

/* 当日无长图时，要闻独占整行 */
.daily-grid.no-image {
    grid-template-columns: 1fr;
}

.news-card {
    padding: 26px 26px 30px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--stroke);
}

.card-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
}

.card-head h2 i {
    color: var(--accent);
}

.card-date {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.news-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.news-list .idx {
    flex: none;
    width: 26px;
    height: 26px;
    margin-top: 3px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.news-list .txt {
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.78;
}

/* 加载 / 空 / 错误状态 */
.state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 44px 0;
    color: var(--text-dim);
    text-align: center;
}

.state[hidden] {
    display: none;
}

.state i {
    font-size: 26px;
    color: var(--text-faint);
}

.state-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--stroke);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 每日金句 / 侧栏卡片 ===== */
.tip-card {
    margin-top: 22px;
    padding: 22px;
}

.side-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-2);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
}

.tip-text {
    margin-top: 12px;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.85;
}

.side-card {
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.side-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-radius: calc(var(--radius) - 8px);
    color: var(--text-dim);
    font-size: 0.95rem;
    transition: background 0.25s ease, color 0.25s ease;
}

.side-link span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.side-link:hover {
    background: var(--glass-strong);
    color: var(--text);
}

/* 当日长图：固定按原图比例展示，不拉伸、不裁切 */
.image-card {
    padding: 16px;
}

.image-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px 12px;
}

.image-open {
    flex: none;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 0.82rem;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.image-open:hover {
    background: var(--glass-strong);
    border-color: var(--stroke);
    color: var(--text);
}

.day-image {
    display: block;
    /* 宽度铺满卡片，高度按原图比例固定，不变形也不裁切 */
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius) - 8px);
    border: 1px solid var(--stroke);
    background: var(--glass-strong);
}

.meta-card {
    margin-top: 18px;
    padding: 18px 20px;
    gap: 8px;
}

/* 阅读原文图文 */
.link-card {
    margin-top: 18px;
}

.meta-card p {
    color: var(--text-dim);
    font-size: 0.88rem;
}

.meta-source {
    color: var(--text-faint);
    font-size: 0.8rem;
    line-height: 1.6;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .daily-grid {
        grid-template-columns: 1fr;
    }

    .news-card {
        padding: 22px 18px 24px;
    }
}

@media (max-width: 520px) {
    .date-bar {
        gap: 8px;
        padding: 12px;
    }

    .date-input {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .today-btn {
        order: 4;
        width: 100%;
    }

    .news-list .txt {
        font-size: 0.92rem;
    }
}
