:root {
    --page-bg: #f5f7fb;
    --panel-bg: rgba(255, 255, 255, 0.82);
    --panel-border: rgba(255, 255, 255, 0.65);
    --text-primary: #10233f;
    --text-secondary: #5d6b82;
    --brand-primary: #2563eb;
    --brand-secondary: #10b981;
    --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.10);
    --shadow-card: 0 16px 40px rgba(37, 99, 235, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.home-page {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.14), transparent 24%),
        linear-gradient(180deg, #eef4ff 0%, var(--page-bg) 32%, #eef2f8 100%);
}

a {
    color: inherit;
}

.hero-header,
.home-main {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.hero-header {
    padding: 32px 0 20px;
}

.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
    gap: 24px;
    align-items: stretch;
}

.hero-copy,
.clock-panel,
.hero-note-card,
.content-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-soft);
}

.hero-copy {
    padding: 42px;
    border-radius: var(--radius-xl);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.hero-copy::after {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0));
}

.hero-badge,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.10);
}

.hero-copy h1 {
    margin: 18px 0 12px;
    font-size: clamp(40px, 6vw, 68px);
    line-height: 1.05;
}

.hero-subtitle {
    max-width: 620px;
    margin: 0;
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 136px;
    padding: 13px 20px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.hero-button:hover {
    transform: translateY(-2px);
}

.hero-button.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary), #4f46e5);
    box-shadow: var(--shadow-card);
}

.hero-button.secondary {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.hero-highlights li {
    padding: 10px 14px;
    border-radius: 999px;
    color: #1e3a5f;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.hero-side {
    display: grid;
    gap: 20px;
}

.clock-panel,
.hero-note-card,
.content-panel {
    border-radius: var(--radius-lg);
}

.clock-panel,
.hero-note-card {
    padding: 24px;
}

.clock-panel {
    min-height: 180px;
}

#clock-container {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    min-height: 90px;
}

.hero-note-card p {
    margin: 14px 0 0;
    line-height: 1.8;
    color: var(--text-secondary);
}

.home-main {
    padding: 8px 0 40px;
}

.content-panel {
    padding: 28px;
    margin-top: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 22px;
    text-align: left;
}

.section-heading h2 {
    margin: 12px 0 0;
    font-size: clamp(28px, 3vw, 38px);
}

.section-heading p {
    margin: 0;
    max-width: 520px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.featured-panel {
    position: relative;
    overflow: hidden;
}

.featured-panel::before {
    content: "";
    position: absolute;
    inset: -100px auto auto -80px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0));
    pointer-events: none;
}

.recommendation-stage {
    position: relative;
    min-height: 260px;
    max-height: 72vh; /* 保证模块高度不会超出可视区域 */
}

.square-recommendation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.square-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
    max-width: min(1100px, 96vw);
    aspect-ratio: 16 / 10; /* 长方形 16:10 */
    max-height: calc(72vh - 40px); /* 留出一些外部间距，保证整屏可见 */
    margin: 0 auto;
    padding: 12px;
    border-radius: 36px;
    background:
        radial-gradient(circle at top left, rgba(233, 255, 241, 0.96), rgba(233, 255, 241, 0) 30%),
        linear-gradient(180deg, #e4fff0 0%, #c5f2d7 48%, #9fdab8 100%);
    border: 1px solid rgba(144, 206, 167, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 30px 60px rgba(43, 122, 83, 0.18);
}

.square-track {
    overflow: hidden; /* 防止子元素溢出 */
    align-items: stretch;
    justify-items: stretch;
}

.recommendation-card {
    min-width: 0;
    display: block;
    height: 100%;
    padding: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.recommendation-card.slot-0 { grid-area: 1 / 1; }
.recommendation-card.slot-1 { grid-area: 1 / 2; }
.recommendation-card.slot-2 { grid-area: 1 / 3; }
.recommendation-card.slot-3 { grid-area: 1 / 4; }
.recommendation-card.slot-4 { grid-area: 1 / 5; }
.recommendation-card.slot-5 { grid-area: 2 / 5; }
.recommendation-card.slot-6 { grid-area: 3 / 5; }
.recommendation-card.slot-7 { grid-area: 4 / 5; }
.recommendation-card.slot-8 { grid-area: 5 / 5; }
.recommendation-card.slot-9 { grid-area: 5 / 4; }
.recommendation-card.slot-10 { grid-area: 5 / 3; }
.recommendation-card.slot-11 { grid-area: 5 / 2; }
.recommendation-card.slot-12 { grid-area: 5 / 1; }
.recommendation-card.slot-13 { grid-area: 4 / 1; }
.recommendation-card.slot-14 { grid-area: 3 / 1; }
.recommendation-card.slot-15 { grid-area: 2 / 1; }


.recommendation-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    text-decoration: none;
    padding: 6px 6px;
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 255, 246, 0.92)),
        linear-gradient(135deg, #d6f8e0, #b9efca);
    border: 1px solid rgba(128, 198, 154, 0.56);
    box-shadow: 0 8px 16px rgba(62, 144, 97, 0.10);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
}

.recommendation-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.48), transparent 55%);
    pointer-events: none;
}

.recommendation-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px rgba(58, 136, 91, 0.18);
    border-color: rgba(94, 182, 124, 0.74);
}

.recommendation-image {
    display: block;
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 10px;
    background: radial-gradient(circle, rgba(214, 248, 224, 0.9), rgba(214, 248, 224, 0.24));
}

.recommendation-name {
    margin: 6px 0 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: #1f6e43;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recommendation-card.active .recommendation-link {
    /* subtle active state: don't mimic full hover to avoid appearing 'hovered' */
    transform: translateY(-2px) scale(1.00);
    box-shadow: 0 10px 20px rgba(62, 144, 97, 0.12);
    border-color: rgba(30, 140, 80, 0.6);
}

/* keep hover stronger so mouseover is still noticeable */
.recommendation-card.active .recommendation-link:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 28px 44px rgba(62, 144, 97, 0.22);
    border-color: rgba(30, 140, 80, 0.92);
}

/* 流光轨道 */
.track-glow {
    position: absolute;
    inset: 8px;
    border-radius: 30px;
    pointer-events: none;
    background: conic-gradient(from 0deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02), rgba(255,255,255,0.14));
    mix-blend-mode: overlay;
    filter: blur(18px) saturate(1.1);
    opacity: 0.85;
    animation: spinGlow 8s linear infinite;
}

@keyframes spinGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 中心翻牌动画 */
.recommendation-center.dynamic.flip {
    animation: flipIn 520ms ease-in-out;
}

@keyframes flipIn {
    0% { transform: rotateX(0deg); opacity: 1; }
    40% { transform: rotateX(90deg); opacity: 0.15; }
    60% { transform: rotateX(90deg); opacity: 0.15; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

.recommendation-center-wrapper {
    grid-area: 2 / 2 / 5 / 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.recommendation-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 12px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 48%),
        linear-gradient(180deg, #78d79a 0%, #48b56f 100%);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 22px 36px rgba(41, 122, 75, 0.22);
    overflow: hidden;
}

.recommendation-center::after {
    content: "";
    position: absolute;
    inset: auto -20px -34px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0));
}

.recommendation-center-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #effff3;
    background: rgba(19, 95, 46, 0.16);
}

.recommendation-center-image {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 20px;
    background: rgba(241, 255, 245, 0.26);
}

.recommendation-center-title {
    margin: 0;
    font-size: 18px;
    color: #f6fff7;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(20, 74, 36, 0.12);
}

.recommendation-center-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    padding: 12px 18px;
    border-radius: 999px;
    color: #1d6e42;
    text-decoration: none;
    font-weight: 700;
    background: linear-gradient(180deg, #f5fff8 0%, #dbf8e5 100%);
    box-shadow: 0 12px 24px rgba(31, 98, 56, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}

.recommendation-center-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 28px rgba(31, 98, 56, 0.22);
}

.recommendation-center-meta {
    font-size: 13px;
    font-weight: 600;
    color: rgba(244, 255, 247, 0.86);
}

.recommendation-controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.carousel-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 128px;
    height: 50px;
    padding: 0 22px;
    border: 1px solid rgba(106, 188, 134, 0.44);
    border-radius: 999px;
    color: #1f6e43;
    background: linear-gradient(180deg, #fafffc 0%, #dff8e8 100%);
    box-shadow: 0 14px 24px rgba(58, 136, 91, 0.14);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.carousel-arrow:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(58, 136, 91, 0.18);
}

@media (max-width: 1024px) {
    .hero-shell {
        grid-template-columns: 1fr;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .hero-header,
    .home-main {
        width: min(100% - 24px, 1000px);
    }

    .hero-copy,
    .clock-panel,
    .hero-note-card,
    .content-panel {
        padding: 22px;
    }

    .hero-copy h1 {
        font-size: 42px;
    }

    .hero-subtitle,
    .section-heading p {
        font-size: 15px;
    }

    .recommendation-stage {
        min-height: 760px;
    }

    .square-track {
        gap: 12px;
        padding: 14px;
    }

    .recommendation-center-wrapper {
        gap: 12px;
    }
}

@media (max-width: 520px) {
    .hero-actions {
        flex-direction: column;
    }

    .hero-button {
        width: 100%;
    }

    .hero-highlights {
        gap: 10px;
    }

    .hero-highlights li {
        width: 100%;
        max-width: none;
    }

    .recommendation-stage {
        min-height: auto;
    }

    .square-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        aspect-ratio: auto;
        width: 100%;
    }

    .recommendation-card.slot-0,
    .recommendation-card.slot-1,
    .recommendation-card.slot-2,
    .recommendation-card.slot-3,
    .recommendation-card.slot-4,
    .recommendation-card.slot-5,
    .recommendation-card.slot-6,
    .recommendation-card.slot-7,
    .recommendation-card.slot-8,
    .recommendation-card.slot-9,
    .recommendation-card.slot-10,
    .recommendation-card.slot-11,
    .recommendation-card.slot-12,
    .recommendation-card.slot-13,
    .recommendation-card.slot-14,
    .recommendation-card.slot-15,
    .recommendation-center-wrapper,
    .recommendation-center {
        grid-area: auto;
    }

    .recommendation-center-wrapper {
        order: -1;
        grid-template-columns: 1fr;
    }

    .recommendation-center {
        min-height: 220px;
    }

    .recommendation-image {
        width: min(100%, 68px);
    }

    .recommendation-controls {
        width: 100%;
    }

    .carousel-arrow {
        flex: 1 1 0;
        min-width: 0;
    }
}
