/* ============================================================
   十二的小店 · 导航页样式
   日间 / 夜间主题 + 桌面 / 移动端响应式
   ============================================================ */

@font-face {
    font-family: "OPPOSans";
    src: url("../fonts/OPPOSansOS2-5000-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "YouShe";
    src: url("../fonts/YouSheBiaoTiHei-3500.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------- 主题变量 ---------- */
:root {
    --bg-base: #f7f4ef;
    --text: #1a2432;
    --muted: #5c6a7a;
    --faint: #697786;
    --accent: #e8833a;
    --accent-2: #2f8f8a;
    --line: rgba(20, 35, 55, 0.12);
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(20, 35, 55, 0.10);
    --card-shadow: 0 18px 50px -24px rgba(24, 38, 58, 0.35);
    --topbar-bg: rgba(250, 248, 244, 0.60);
    --toast-bg: rgba(255, 255, 255, 0.86);
    --focus: #e8833a;
    --radius: 24px;
}

html[data-theme="night"] {
    --bg-base: #050a15;
    --text: #edf3ff;
    --muted: #a7b6cb;
    --faint: #7d8da6;
    --accent: #f2a25c;
    --accent-2: #5cc4bd;
    --line: rgba(255, 255, 255, 0.12);
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.13);
    --card-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.75);
    --topbar-bg: rgba(6, 12, 24, 0.55);
    --toast-bg: rgba(13, 21, 38, 0.88);
    --focus: #f2a25c;
}

/* ---------- 基础 ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-base);
    color: var(--text);
    font-family: "OPPOSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

::selection {
    background: rgba(232, 131, 58, 0.28);
}

a {
    color: inherit;
}

/* ---------- 背景 ---------- */
.sky {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(1100px 720px at 82% 8%, rgba(47, 143, 138, 0.16), transparent 62%),
        radial-gradient(900px 680px at 8% 96%, rgba(232, 131, 58, 0.20), transparent 60%),
        linear-gradient(165deg, #fdfbf7 0%, #f2f5fa 52%, #f8f1e8 100%);
    transition: background 0.8s ease, opacity 0.8s ease;
}

html[data-theme="night"] .sky {
    background:
        radial-gradient(900px 640px at 80% 6%, rgba(58, 112, 190, 0.22), transparent 62%),
        radial-gradient(760px 560px at 12% 92%, rgba(242, 162, 92, 0.10), transparent 60%),
        linear-gradient(170deg, #081123 0%, #050a15 55%, #04070f 100%);
}

.stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

html[data-theme="night"] .stars {
    opacity: 1;
}

/* ---------- 顶栏 ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(18px, 4vw, 44px);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: linear-gradient(145deg, rgba(232, 131, 58, 0.24), rgba(47, 143, 138, 0.18));
}

.brand-mark svg {
    width: 20px;
    height: 20px;
    fill: var(--accent);
}

.brand-text {
    font-family: "YouShe", "OPPOSans", sans-serif;
    font-size: 1.02rem;
    line-height: 1.25;
    letter-spacing: 0.08em;
}

.brand-sub {
    display: block;
    font-family: "OPPOSans", system-ui, sans-serif;
    font-size: 0.52rem;
    letter-spacing: 0.26em;
    color: var(--faint);
    margin-top: 1px;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.5s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.theme-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle .ico-moon path {
    fill: none;
}

html[data-theme="day"] .theme-toggle .ico-sun,
html[data-theme="night"] .theme-toggle .ico-moon {
    display: none;
}

/* ---------- 顶栏 · 时间与温度 ---------- */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.status-clock {
    color: var(--text);
    font-weight: 500;
}

.status-sep {
    color: var(--faint);
    opacity: 0.7;
}

.status-weather {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-weather[hidden] {
    display: none;
}

.wx-city {
    color: var(--muted);
}

.wx-city:empty {
    display: none;
}

.wx-temp {
    color: var(--text);
    font-weight: 500;
}

@media (max-width: 760px) {
    .status {
        height: 32px;
        padding: 0 10px;
        font-size: 0.74rem;
        gap: 6px;
    }

    .status-sep {
        display: none;
    }
}

@media (max-width: 460px) {
    .wx-city,
    .status-sep {
        display: none;
    }
}

/* ---------- 页面骨架 ---------- */
.page {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px);
}

.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 0 56px;
    max-width: 860px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    font-size: 0.86rem;
    letter-spacing: 0.10em;
    color: var(--muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(232, 131, 58, 0.12);
    animation: pulse 3s ease-in-out infinite;
}

.hero h1 {
    margin: 0 0 22px;
    font-family: "YouShe", "OPPOSans", sans-serif;
    font-weight: 400;
    font-size: clamp(2.6rem, 7vw, 4.8rem);
    line-height: 1.14;
    letter-spacing: 0.06em;
    text-wrap: balance;
}

html[data-theme="night"] .hero h1 {
    text-shadow: 0 0 40px rgba(120, 170, 255, 0.18);
}

.lede {
    margin: 0;
    max-width: 38em;
    font-size: clamp(0.94rem, 1.4vw, 1.04rem);
    line-height: 1.9;
    color: var(--muted);
}

.scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: 38px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--faint);
    text-decoration: none;
    transition: color 0.3s ease;
}

.scroll-hint:hover {
    color: var(--accent);
}

.scroll-hint svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: bob 2.6s ease-in-out infinite;
}

/* ---------- 网站列表 ---------- */
.links {
    padding: 12px 0 28px;
    scroll-margin-top: 88px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    margin-bottom: 26px;
}

.section-head h2 {
    margin: 0;
    font-family: "YouShe", "OPPOSans", sans-serif;
    font-weight: 400;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.section-head p {
    margin: 7px 0 0;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--faint);
}

.section-line {
    flex: 1;
    height: 1px;
    margin-bottom: 11px;
    background: linear-gradient(90deg, var(--line), transparent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 2.4vw, 26px);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: var(--text);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
        box-shadow 0.45s ease, border-color 0.45s ease, background-color 0.5s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(232, 131, 58, 0.38);
    box-shadow: 0 30px 64px -26px rgba(24, 38, 58, 0.48);
}

html[data-theme="night"] .card:hover {
    box-shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.85);
}

.card:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0c1424;
}

.thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scale(1.02);
    filter: saturate(1.05) brightness(1.03);
    transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .thumb img {
    transform: scale(1.07);
}

.thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 8, 16, 0) 42%, rgba(4, 8, 16, 0.58));
    pointer-events: none;
}

.tag {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 2;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    background: rgba(7, 13, 25, 0.55);
    color: #fff;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px 20px 20px;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.title-row h3 {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.45;
}

.arrow {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: var(--faint);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.35s ease, stroke 0.35s ease;
}

.card:hover .arrow {
    transform: translate(3px, -3px);
    stroke: var(--accent);
}

.body p {
    flex: 1;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.75;
    color: var(--muted);
}

.tip {
    margin: 22px 0 0;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--faint);
}

/* ---------- 页脚 ---------- */
.footer {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 30px clamp(20px, 4vw, 40px) calc(44px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--line);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    color: var(--faint);
}

.footer p {
    margin: 0;
}

.footer-sub {
    color: var(--faint);
    opacity: 0.85;
}

/* ---------- 收藏提示 ---------- */
.fav-toast {
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: calc(clamp(16px, 3vw, 32px) + env(safe-area-inset-bottom));
    z-index: 30;
    width: min(322px, calc(100vw - 32px));
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background: var(--toast-bg);
    box-shadow: 0 26px 60px -22px rgba(9, 18, 32, 0.55);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    visibility: hidden;
    opacity: 0;
    transform: translateY(140%);
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.5s ease, visibility 0.5s;
}

.fav-toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.fav-title {
    margin: 0 26px 2px 0;
    font-weight: 600;
    font-size: 0.92rem;
}

.fav-text {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.fav-list {
    list-style: none;
    margin: 11px 0 0;
    padding: 10px 0 0;
    border-top: 1px dashed var(--line);
    display: grid;
    gap: 7px;
    font-size: 0.72rem;
    color: var(--muted);
}

.fav-list kbd {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid var(--line);
    background: rgba(127, 127, 127, 0.10);
    font-family: inherit;
    font-size: 0.68rem;
}

.fav-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--faint);
    font-size: 1.12rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.fav-close:hover {
    color: var(--text);
    background: rgba(127, 127, 127, 0.12);
}

.fav-close:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* ---------- 动画 ---------- */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(232, 131, 58, 0.10); }
    50% { box-shadow: 0 0 0 9px rgba(232, 131, 58, 0.04); }
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    body {
        font-size: 15px;
    }

    .topbar {
        padding: 12px 18px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .brand-text {
        font-size: 0.95rem;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
    }

    .hero {
        min-height: 88svh;
        padding: 108px 0 44px;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 11vw, 3.2rem);
        letter-spacing: 0.04em;
    }

    .pc-only {
        display: none;
    }

    .lede {
        font-size: 0.92rem;
        line-height: 1.85;
    }

    .scroll-hint {
        margin-top: 30px;
    }

    .section-head {
        gap: 14px;
        margin-bottom: 20px;
    }

    .section-head p {
        letter-spacing: 0.12em;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .card {
        border-radius: 20px;
    }

    .body {
        padding: 16px 18px 18px;
    }

    .title-row h3 {
        font-size: 1rem;
    }

    .fav-toast {
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        width: auto;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 380px) {
    .hero h1 {
        font-size: 2.1rem;
    }

    .brand-sub {
        display: none;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: 96px;
        padding-bottom: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
