/* ==========================================================================
   zzy.skin 分发站 — 柔光玻璃设计系统
   设计基调：通透 / 柔光 / 干净 / 规范
   ========================================================================== */

/* ---------- 1. 令牌 ---------- */
:root {
    --accent-1: #d8d2c8;
    --accent-2: #a9a29a;
    --accent-3: #8e887f;

    --glass-bg: rgba(255, 255, 255, 0.11);
    --glass-bg-strong: rgba(255, 255, 255, 0.17);
    --glass-bg-soft: rgba(255, 255, 255, 0.07);
    --glass-line: rgba(255, 255, 255, 0.24);
    --glass-line-soft: rgba(255, 255, 255, 0.13);
    --glass-shadow: 0 24px 60px -26px rgba(0, 0, 0, 0.5);
    --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.32);

    --text-1: #f3f1ee;
    --text-2: rgba(243, 241, 238, 0.72);
    --text-3: rgba(243, 241, 238, 0.48);

    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --radius-pill: 999px;

    --blur: 28px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, monospace;
}

:root[data-accent="cyan"] {
    --accent-1: #a9a29a;
    --accent-2: #b6b0a6;
    --accent-3: #d8d2c8;
}

:root[data-accent="rose"] {
    --accent-1: #8e887f;
    --accent-2: #9c968c;
    --accent-3: #c4bdb2;
}

:root[data-accent="mint"] {
    --accent-1: #cfc9be;
    --accent-2: #a9a29a;
    --accent-3: #e0dad0;
}

/* ---------- 2. 基础 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-1);
    background: #0a0a0b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    max-width: 100%;
}

/* 兜底层：视频未就绪前的底色与柔光，透明度交给视频层 */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -3;
    opacity: 0.34;
    background:
        radial-gradient(1200px 720px at 16% -8%, rgba(216, 210, 200, 0.38), transparent 60%),
        radial-gradient(1000px 620px at 88% 6%, rgba(169, 162, 154, 0.30), transparent 62%),
        radial-gradient(900px 700px at 62% 100%, rgba(142, 136, 127, 0.22), transparent 64%),
        linear-gradient(168deg, #101011 0%, #0b0b0c 46%, #131314 100%);
}

/* ---------- 背景视频层（柔光通透基调） ---------- */
.bg-video {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: #0a0a0b;
}

/* 首帧静态封面：在视频就绪前先撑住画面，避免白闪与空洞 */
.bg-video::before {
    content: "";
    position: absolute;
    inset: -4%;
    background: url("/assets/img/bg-poster.jpg?v=2") center / cover no-repeat;
}

.bg-video-el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.9s var(--ease), transform 1.4s var(--ease);
}

.bg-video.is-ready .bg-video-el {
    opacity: 1;
    transform: scale(1);
}

/* 柔光蒙版：把画面压到「可读但通透」的对比度区间 */
.bg-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(125% 95% at 50% 4%, rgba(10, 10, 11, 0.02), rgba(10, 10, 11, 0.30) 58%, rgba(8, 8, 9, 0.55) 100%),
        linear-gradient(180deg, rgba(12, 12, 13, 0.30), rgba(10, 10, 11, 0.10) 42%, rgba(8, 8, 9, 0.40));
    mix-blend-mode: normal;
    transition: opacity 0.9s var(--ease);
}

/* 视频就绪后蒙版略收，画面更通透 */
.bg-video.is-ready .bg-scrim {
    opacity: 0.72;
}

/* ---------- 背景路径 B：柔光渐变（老路径，后台可切换） ---------- */
:root[data-bg="gradient"] .bg-layer {
    opacity: 1;
}

:root[data-bg="gradient"] .bg-orb {
    opacity: 0.5;
}

.bg-orb {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.34;
    pointer-events: none;
    will-change: transform;
}

.orb-a {
    width: 520px;
    height: 520px;
    top: -180px;
    left: -120px;
    background: radial-gradient(circle at 34% 34%, rgba(216, 210, 200, 0.85), transparent 70%);
    animation: drift 22s var(--ease) infinite alternate;
}

.orb-b {
    width: 460px;
    height: 460px;
    top: 12%;
    right: -160px;
    background: radial-gradient(circle at 60% 40%, rgba(169, 162, 154, 0.8), transparent 70%);
    animation: drift 26s var(--ease) infinite alternate-reverse;
}

.orb-c {
    width: 560px;
    height: 560px;
    bottom: -240px;
    left: 38%;
    background: radial-gradient(circle at 50% 50%, rgba(142, 136, 127, 0.6), transparent 72%);
    animation: drift 30s var(--ease) infinite alternate;
}

/* 细腻噪点，压住大面积渐变的色带 */
.bg-grain {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.16;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(40px, 60px, 0) scale(1.12); }
}

/* ---------- 3. 玻璃构件 ---------- */
.glass {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow), var(--glass-inner);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(150%) brightness(1.14);
    backdrop-filter: blur(var(--blur)) saturate(150%) brightness(1.14);
}

/* 顶部高光，模拟玻璃边缘反光 */
.glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.16) 0%,
        rgba(255, 255, 255, 0.03) 34%,
        rgba(255, 255, 255, 0) 62%
    );
}

.glass > * {
    position: relative;
}

/* ---------- 4. 布局 ---------- */
.wrap {
    width: min(1180px, 92vw);
    margin: 0 auto;
}

.shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 34px 0 40px;
}

main {
    flex: 1;
}

/* ---------- 5. 顶栏 ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 22px;
    margin-bottom: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-meta {
    flex: 0 1 auto;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 15px;
    background: linear-gradient(140deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 10px 26px -10px rgba(216, 210, 200, 0.9), var(--glass-inner);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.04em;
    color: #151514;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub {
    margin: 1px 0 0;
    font-size: 12.5px;
    color: var(--text-3);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    background: var(--glass-bg-soft);
    border: 1px solid var(--glass-line-soft);
    font-size: 12.5px;
    color: var(--text-2);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.chip b {
    color: var(--text-1);
    font-weight: 650;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 12px var(--accent-2);
}

/* ---------- 6. Hero ---------- */
.hero {
    text-align: center;
    padding: 26px 8px 34px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4.4vw, 44px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: #f7f5f2;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.35);
}

.hero p {
    margin: 0 auto;
    max-width: 620px;
    font-size: 15.5px;
    color: var(--text-2);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6);
}

/* ---------- 7. 检索条 ---------- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    margin-bottom: 22px;
    border-radius: var(--radius-md);
}

.search {
    position: relative;
    flex: 1 1 260px;
    min-width: 0;
}

.search svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    stroke: var(--text-3);
    fill: none;
    stroke-width: 1.9;
    pointer-events: none;
}

.search input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 43px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-line-soft);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-1);
    font-size: 14.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search input::placeholder {
    color: var(--text-3);
}

.search input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(216, 210, 200, 0.16);
}

.selects {
    display: flex;
    gap: 10px;
    flex: none;
}

select.glass-select {
    height: 44px;
    padding: 0 34px 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-line-soft);
    background-color: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.55)' stroke-width='1.7' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    color: var(--text-1);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s var(--ease);
}

select.glass-select:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

select.glass-select option {
    background: #1a1a1c;
    color: var(--text-1);
}

/* ---------- 8. 列表 ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 18px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-line);
    box-shadow: var(--glass-shadow), var(--glass-inner);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(150%) brightness(1.14);
    backdrop-filter: blur(var(--blur)) saturate(150%) brightness(1.14);
    transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(420px 180px at 22% 0%, rgba(255, 255, 255, 0.13), transparent 68%);
    transition: opacity 0.28s var(--ease);
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.27);
    box-shadow: 0 30px 60px -26px rgba(0, 0, 0, 0.85), var(--glass-inner);
}

.card:hover::after {
    opacity: 1;
}

.card-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.card-cover {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    border: 1px solid var(--glass-line-soft);
    display: grid;
    place-items: center;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ext-badge {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-2);
    text-transform: uppercase;
}

.card-title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 650;
    line-height: 1.4;
    color: var(--text-1);
    word-break: break-word;
}

.card-desc {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 23px;
    padding: 0 9px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-line-soft);
    white-space: nowrap;
}

.tag.accent {
    color: #151514;
    background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
    border-color: transparent;
    font-weight: 650;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid var(--glass-line-soft);
    font-size: 12px;
    color: var(--text-3);
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.card-actions {
    display: flex;
    gap: 10px;
}

/* ---------- 9. 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-line);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-1);
    font-size: 14px;
    font-family: inherit;
    font-weight: 550;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    outline: none;
    transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.26);
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    box-shadow: 0 0 0 4px rgba(216, 210, 200, 0.28);
}

.btn-primary {
    flex: 1;
    color: #151514;
    font-weight: 680;
    border-color: transparent;
    background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 14px 30px -16px rgba(216, 210, 200, 0.95);
}

.btn-primary:hover {
    background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
    filter: brightness(1.07);
    border-color: transparent;
}

.btn-icon {
    flex: none;
    width: 42px;
    padding: 0;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-ghost {
    background: transparent;
}

/* ---------- 10. 空态 / 骨架 ---------- */
.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 68px 24px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--glass-line);
    background: var(--glass-bg-soft);
}

.empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-line-soft);
}

.empty-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--text-2);
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty h3 {
    margin: 0 0 6px;
    font-size: 16.5px;
    font-weight: 620;
}

.empty p {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-3);
}

/* ---------- 11. 页脚 ---------- */
.foot {
    margin-top: 38px;
    padding-top: 22px;
    border-top: 1px solid var(--glass-line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-3);
}

.foot-links {
    display: flex;
    gap: 18px;
}

.foot a {
    color: var(--text-3);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.foot a:hover {
    color: var(--text-1);
}

/* ---------- 12. Toast ---------- */
.toast-host {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

.toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    background: rgba(14, 14, 16, 0.82);
    border: 1px solid var(--glass-line);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(150%) brightness(1.14);
    backdrop-filter: blur(18px) saturate(150%) brightness(1.14);
    font-size: 13.5px;
    color: var(--text-1);
    animation: toast-in 0.32s var(--ease);
}

.toast.err {
    border-color: rgba(255, 130, 130, 0.42);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 13. 无障碍 / 动效偏好 ---------- */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(216, 210, 200, 0.3);
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    /* 尊重减少动效偏好：退化为静态封面 */
    .bg-video-el { display: none; }
    .bg-video::before { opacity: 1; }
}

@media (max-width: 720px) {
    .shell { padding: 20px 0 28px; }
    .topbar { padding: 14px 16px; margin-bottom: 22px; gap: 10px; }
    .brand { gap: 11px; }
    .brand-mark { width: 40px; height: 40px; border-radius: 13px; font-size: 16px; }
    .brand-title { font-size: 16.5px; }
    .brand-sub { display: none; }
    .topbar-meta .chip.hide-sm { display: none; }
    .topbar-meta .chip { padding: 0 11px; }
    .hero { padding: 14px 4px 26px; }
    .grid { grid-template-columns: 1fr; gap: 14px; }
    .card { padding: 17px; }
    .selects { width: 100%; }
    .selects .glass-select { flex: 1; min-width: 0; }
    .foot { flex-direction: column; align-items: flex-start; }
    /* 移动端收起光斑，把算力留给视频解码 */
    .bg-orb { display: none; }
    .bg-scrim {
        background:
            radial-gradient(130% 80% at 50% 0%, rgba(10, 10, 11, 0.22), rgba(10, 10, 11, 0.66) 64%, rgba(6, 6, 7, 0.82) 100%),
            linear-gradient(180deg, rgba(12, 12, 13, 0.44), rgba(10, 10, 11, 0.34) 46%, rgba(8, 8, 9, 0.66));
    }
}
