/*
 * 官网（templates/site/）浅色主题的补充样式。
 * 布局和间距用 Tailwind 工具类；这里只放 Tailwind 不好表达的：字体、毛玻璃浮层卡、
 * 缺图占位底、横向轮播、滚动渐显。色值与 tailwind.config.js 的 brand / ink 一致。
 */

/* ---------- 字体 ---------- */
/* 标题衬线体：Source Serif 4（OFL），自托管 latin + cyrillic 两个子集。中文无衬线字形，回退到系统黑体。 */
@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('/static/fonts/source-serif-4-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('/static/fonts/source-serif-4-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/*
 * Inter 正文。fonts.css 引用的 inter-var.woff2 其实是只有 Regular 一个字重的静态字体，却声明了
 * 100-900，浏览器以为有粗体，既不换字重也不合成加粗，拉丁字母的 font-semibold 全部不生效。
 * 官网改用 Google Fonts 的可变字体（latin + cyrillic 子集）。这里的声明在 fonts.css 之后，
 * 同字族同字符范围以后声明的为准。
 */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/inter-var-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/inter-var-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
    --brand-50: #f7f5ff;
    --brand-100: #efebff;
    --brand-200: #ddd5ff;
    --brand-500: #6d4aff;
    --brand-600: #5c3be7;
    --brand-900: #1b1340;
    --ink: #1b1340;
    --ink-soft: #4b4566;
    --mint: #2dd4bf;
    --ok: #10b981;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}

body.site {
    font-family: var(--sans);
    background: var(--brand-50);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.h-display {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', serif;
    font-weight: 400;
    font-optical-sizing: auto;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
/* 中文没有衬线网络字体可用（体积太大），标题改用系统黑体加粗，避免细体中文发虚 */
:lang(zh-CN) .h-display {
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.text-pretty { text-wrap: pretty; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .625rem;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25rem;
    padding: .875rem 1.5rem;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
    white-space: nowrap;
}
.btn-sm { padding: .625rem 1.125rem; font-size: .9375rem; }
.btn-primary { background: var(--brand-500); color: #fff; box-shadow: 0 1px 2px rgba(27, 19, 64, .12); }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(27, 19, 64, .14); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1px rgba(27, 19, 64, .3); background: #fff; }
.btn-light { background: #fff; color: var(--brand-900); }
.btn-light:hover { background: var(--brand-100); }
.btn-ghost-dark { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.btn-ghost-dark:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); }
.btn:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ---------- 图片容器与缺图占位 ---------- */
.media {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    isolation: isolate;
}
.media > img.media-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}
/* 实拍类占位：暗调，保证白色浮层卡可读 */
.media-dark {
    background:
        radial-gradient(90% 60% at 18% 12%, rgba(157, 133, 255, .55) 0%, transparent 60%),
        radial-gradient(70% 55% at 88% 92%, rgba(45, 212, 191, .28) 0%, transparent 60%),
        linear-gradient(160deg, #3a2f6e 0%, #1c1638 55%, #120c2e 100%);
}
/* 概念图类占位：浅色渐变 */
.media-light {
    background:
        radial-gradient(80% 60% at 15% 8%, #ffffff 0%, transparent 60%),
        radial-gradient(70% 60% at 90% 95%, rgba(45, 212, 191, .22) 0%, transparent 60%),
        radial-gradient(60% 50% at 80% 20%, rgba(109, 74, 255, .16) 0%, transparent 65%),
        linear-gradient(170deg, #f4f1ff 0%, #ebe6ff 60%, #e3f6f2 100%);
}
.media-overlay-bottom {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 1.25rem;
}

/* ---------- 毛玻璃浮层卡（叠在图片上的 UI 小卡） ---------- */
.glass {
    background: rgba(28, 24, 48, .52);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 1rem;
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 10px 30px rgba(10, 6, 30, .28);
}
.glass-light {
    background: rgba(255, 255, 255, .78);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 1rem;
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 12px 32px rgba(27, 19, 64, .14);
}
.glass .muted { color: rgba(255, 255, 255, .68); }
.glass-light .muted { color: var(--ink-soft); }

.dot { width: .5rem; height: .5rem; border-radius: 9999px; display: inline-block; flex-shrink: 0; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); }
.dot-brand { background: var(--brand-500); box-shadow: 0 0 0 4px rgba(109, 74, 255, .18); }
.dot-mint { background: var(--mint); box-shadow: 0 0 0 4px rgba(45, 212, 191, .2); }

.float-slow { animation: floatY 7s ease-in-out infinite; }
.float-slower { animation: floatY 9s ease-in-out infinite; animation-delay: -3s; }
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* App 截图窗口 */
.app-window {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 40px 80px -20px rgba(27, 19, 64, .45), 0 0 0 1px rgba(27, 19, 64, .08);
    background: #121029;
}
.app-window img { display: block; width: 100%; height: auto; }

/* ---------- 导航 ---------- */
.site-nav { transition: box-shadow .2s ease, background-color .2s ease; }
.site-nav.is-scrolled { box-shadow: 0 1px 0 rgba(27, 19, 64, .08), 0 8px 24px -12px rgba(27, 19, 64, .12); background: rgba(247, 245, 255, .92); }
.nav-dd { position: relative; }
.nav-dd-panel {
    position: absolute;
    top: 100%;
    left: -1rem;
    padding-top: .5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 60;
}
.nav-dd-panel.right { left: auto; right: -1rem; }
.nav-dd:hover .nav-dd-panel,
.nav-dd:focus-within .nav-dd-panel,
.nav-dd.is-open .nav-dd-panel { opacity: 1; visibility: visible; transform: none; }
.nav-dd .chev { transition: transform .18s ease; }
.nav-dd:hover .chev, .nav-dd.is-open .chev { transform: rotate(180deg); }

.mobile-panel { display: none; }
.mobile-panel.is-open { display: block; }
.mobile-panel details > summary { list-style: none; }
.mobile-panel details > summary::-webkit-details-marker { display: none; }
.mobile-panel details[open] .chev { transform: rotate(180deg); }

/* ---------- 横向轮播（scroll-snap，按钮翻页由 site.js 驱动） ---------- */
.carousel {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .25rem;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; flex-shrink: 0; }
.carousel-btn {
    width: 2.75rem; height: 2.75rem;
    border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(27, 19, 64, .14);
    transition: box-shadow .15s ease, opacity .15s ease;
}
.carousel-btn:hover { box-shadow: inset 0 0 0 1px rgba(27, 19, 64, .35); }
.carousel-btn[disabled] { opacity: .35; cursor: default; }

/* ---------- 折叠（FAQ / 了解详情） ---------- */
details.faq > summary { list-style: none; cursor: pointer; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq .plus { transition: transform .2s ease; }
details.faq[open] .plus { transform: rotate(45deg); }
details.more > summary { list-style: none; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] .chev { transform: rotate(180deg); }
details.more .chev { transition: transform .2s ease; }

/* ---------- 套餐月付 / 年付切换 ---------- */
.billing-toggle button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(27, 19, 64, .16); }
.plans[data-billing="yearly"] .show-monthly { display: none; }
.plans[data-billing="monthly"] .show-yearly { display: none; }

/* ---------- 滚动渐显：只在 JS 可用时隐藏，保证无 JS 时内容可见 ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 智能分流示意图的流动虚线 ---------- */
.flow-line { stroke-dasharray: 6 8; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }

@media (prefers-reduced-motion: reduce) {
    .float-slow, .float-slower, .flow-line { animation: none; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .carousel { scroll-behavior: auto; }
}
