/* ===== Hero 区域 ===== */
.hero {
    /* 用 min-height 代替固定 height：
       - 移动端浏览器地址栏会占据一部分视口，100vh 是“地址栏收起”时的最大高度，
         地址栏可见时底部内容会被挤出屏幕（显示不完整）。
         改用动态视口 dvh/svh，让 hero 恰好等于当前可见区域。
       - 固定 height + flex 居中在内容超高时会把顶部（标题）裁掉且无法滚动到；
         改用 min-height，内容超高时 hero 自动撑高，保证完整显示。 */
    min-height: 600px;
    min-height: 100vh;                  /* 旧浏览器回退 */
    min-height: max(600px, 100dvh);     /* 桌面/平板：至少满屏，随视口（含缩放/工具栏）变化 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* 深色渐变遮罩(scrim)：背景图来自随机图 API(https://t.alcy.cc/ycy)，每次加载明暗、色相都不同，
       叠加半透明深色渐变保证白色文字在任何图片上都有足够对比度（WCAG 大文字 ≥ 3:1） */
    background:
        linear-gradient(rgba(15, 23, 42, 0.50), rgba(15, 23, 42, 0.65)),
        url('https://t.alcy.cc/ycy') center / cover no-repeat;
    padding: 0;
}

/* ===== Hero 内容：首屏标题 → 副标语 滚动交叉渐变 =====
   功能：进入页面时首屏显示大标题「坊绘链路」与一言卡片；向下滚动时大标题淡出，
   副标语「青春是一场旅行，一幕独角戏」在「一言卡片」下方淡入，方便用户看见。
   透明度由 js/navbar.js 依据滚动位置实时写入。 */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 主标题容器：仅包含「坊绘链路」主标题，与下方一言卡片、副标语纵向排列 */
.hero-headline {
    max-width: 780px;
    margin-bottom: 16px;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    color: #ffffff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
    line-height: 1.3;
    transition: opacity 0.25s linear;   /* 透明度平滑过渡，避免滚动时跳动 */
}

/* 系统开启「减少动态效果」时：不做渐变动画，直接显隐 */
@media (prefers-reduced-motion: reduce) {
    .hero-title {
        transition: none;
    }
}

/* 主标题「坊绘链路」：默认完全可见，向下滚动时由 JS 淡出。
   抖动由 CSS @keyframes 实现：模仿 v2.hysteria.network 首页 Logo 的「间歇轻抖」——
   每个 2s 周期开头做两下 ±4px 对角快速轻颤（各含两次往返），随后长时间静止；
   只作用 transform，不干扰滚动时的透明度淡出。
   必须用 inline-block：span 默认是内联盒，CSS transform 对内联盒不生效，
   动画矩阵会计算但视觉上纹丝不动（抖动失效）。 */
.hero-brand {
    display: inline-block;
    opacity: 1;
    animation: hero-brand-wiggle 2s infinite;
    will-change: transform;
}

/* 抖动关键帧（节奏与幅度对应 hysteria 站点 extra.css 中 #wiggle-logo 的 @keyframes wiggle）：
   0%–4%  第一下对角轻颤（\2212 4px,+4px → +4px,\2212 4px 往返）；
   10%–14% 第二下对角轻颤（\2212 4px,\2212 4px → +4px,+4px 往返）；
   其余 ~86% 完全静止，形成「抖两下 → 安静 → 循环」的观感 */
@keyframes hero-brand-wiggle {
    0%       { transform: translate(0, 0); }
    1%       { transform: translate(-4px, 4px); }
    2%       { transform: translate(0, 0); }
    3%       { transform: translate(4px, -4px); }
    4%       { transform: translate(0, 0); }
    10%      { transform: translate(0, 0); }
    11%      { transform: translate(-4px, -4px); }
    12%      { transform: translate(0, 0); }
    13%      { transform: translate(4px, 4px); }
    14%      { transform: translate(0, 0); }
    100%     { transform: translate(0, 0); }
}

/* 系统开启「减少动态效果」时：停止抖动 */
@media (prefers-reduced-motion: reduce) {
    .hero-brand {
        animation: none;
    }
}

/* 副标语「青春是一场旅行，一幕独角戏」：位于一言卡片下方，
   默认隐藏(占位不塌陷)，向下滚动时由 JS 淡入，方便用户在卡片下方看见 */
.hero-slogan {
    opacity: 0;
    font-size: clamp(1.3rem, 3vw, 2rem);
    max-width: 780px;
    margin-top: 20px;
    text-align: center;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 一言卡片 ===== */
.hitokoto-card {
    max-width: 400px;
    min-height: 100px;
    margin: 0 auto;
}

.hitokoto-text {
    font-size: 1.2rem;
    color: #e2e8f0;
    line-height: 1.4;
    text-align: center;
    margin: 0;
}

.hitokoto-creator {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.3;
    text-align: right;
    margin-top: 6px;
}

/* ===== 滚动提示 ===== */
.scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 0.95rem;
    animation: bounce-down 2.4s infinite;
}

.scroll-hint-icon {
    width: 22px;
    height: 22px;
    stroke: #cbd5e1;
}

@keyframes bounce-down {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

/* ===== 滚动进度指示器 ===== */
.scroll-progress {
    position: absolute;
    top: 100%;                 /* 紧贴导航栏底部，随 navbar 滑动 */
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    z-index: -1;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    pointer-events: none;
}

.scroll-progress.visible {
    opacity: 1;
}

/* ===== 内容区块 ===== */
.page-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 24px 120px;
}

.page-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 44px;
    margin-bottom: 36px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    transition: box-shadow 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.page-section-body {
    flex: 1;
    min-width: 0;
}

.page-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.page-section-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-section-badge {
    font-size: 0.8rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4f46e5;
    padding: 2px 14px;
    border-radius: 30px;
}

.page-section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 4px;
    margin: 16px 0 20px;
}

.page-section-text {
    color: #475569;
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.page-section-text:last-child {
    margin-bottom: 0;
}

.page-section-tip {
    margin-top: 16px;
    color: #94a3b8;
    font-size: 0.95rem;
}

/* ===== 液态玻璃时钟 ===== */
.page-section-clock {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 24px;
    background: rgba(99, 102, 241, 0.08);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 2px 12px rgba(99, 102, 241, 0.12),
        0 0 0 1px rgba(99, 102, 241, 0.06);
    position: relative;
    overflow: hidden;
}

/* 光斑 — 液态流动高光 */
.page-section-clock::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -40%;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(168, 85, 247, 0.15),
        transparent 60%
    );
    animation: clock-shimmer 6s ease-in-out infinite;
}

@keyframes clock-shimmer {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(10%, 10%) rotate(3deg); }
}

.clock-time {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -1px;
    line-height: 1;
}

/* 本地浏览器时间 — 加粗 */
#localTime {
    font-weight: 800;
    color: #0f172a;
}

.clock-date {
    font-size: 0.75rem;
    color: #6366f1;
    font-weight: 600;
}

.clock-weekday {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    /* 移动端：hero 高度取 100svh（地址栏可见时的实际视口高度），
       首屏恰好填满可视区，不再把底部内容挤出屏幕 */
    .hero {
        min-height: 100vh;   /* 旧浏览器回退 */
        min-height: 100svh;
    }

    .page-section {
        padding: 24px 20px;
        flex-direction: column;
        align-items: stretch;
    }

    /* 长方形卡片：横向排列 时间 | 日期 | 星期 */
    .page-section-clock {
        width: auto;
        height: auto;
        flex-direction: row;
        gap: 16px;
        padding: 16px 24px;
        border-radius: 16px;
    }

    .clock-time {
        font-size: 1.5rem;
    }

    .clock-date {
        font-size: 0.8rem;
    }

    /* 文字容器自适应宽度 */
    .page-section-body {
        flex: none;
        width: 100%;
    }

    .page-section-title {
        font-size: 1.35rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    /* 品牌主标题「坊绘链路」：移动端仍保持大字号突出，与普通 hero-title 区分开，
       只作用于 .hero-brand，不影响副标语/卡片等的收紧尺寸 */
    .hero-brand {
        font-size: 2.75rem;
    }

    .hero-slogan {
        font-size: 1.25rem;
    }
}

/* 小屏手机：收紧 hero 内容，避免首屏元素“显示过大”导致内容超出可视区 */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
        letter-spacing: -0.5px;
        /* 防止副标题「将梦绘进现实，与民一起」横向顶满屏幕边缘 */
        padding: 0 16px;
    }

    /* 小屏上品牌标题保持明显大号，但比 768px 档略收敛，避免挤出下方一言卡片 */
    .hero-brand {
        font-size: 2.25rem;
    }

    .hero-slogan {
        font-size: 1.1rem;
        padding: 0 16px;
    }

    .hitokoto-card {
        min-height: 84px;
    }

    .hitokoto-text {
        font-size: 1.05rem;
    }

    .scroll-hint {
        font-size: 0.9rem;
    }
}

