/* ==========================================================================
   jiaen.tech 门户站样式
   --------------------------------------------------------------------------
   设计原则：
   - 浅色主题、低饱和、留白足
   - 全站零 JS：折叠用 <details>
   - RTL：布局全部用逻辑属性，dir="rtl" 时自动镜像
   ========================================================================== */

:root {
    --bg: #ffffff;
    --bg-tint: #f6f8fb;
    --ink: #16202b;
    --muted: #5c6b7c;
    --accent: #16202b;
    --accent-soft: #eef1f5;
    --line: #e4e9f0;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 30px rgba(16, 24, 40, .06);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
            "Hiragino Sans GB", "Helvetica Neue", "Segoe UI", Roboto,
            "Noto Sans", "Noto Sans Arabic", "Noto Sans JP", "Noto Sans KR",
            Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 .5em; }
h3 { font-size: 1.1rem; margin: 0 0 .35em; }

p { margin: 0 0 1em; }

.container { max-width: 1000px; margin-inline: auto; padding-inline: 22px; }
.container.narrow { max-width: 760px; }

/* 可访问性：键盘跳转链接 */
.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    top: 8px;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
}
.skip-link:focus { inset-inline-start: 8px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(1.4) blur(10px);
    border-block-end: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 58px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-weight: 650;
    font-size: 1.02rem;
}
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 7px; display: block; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-inline-start: auto;
}
.main-nav a { color: var(--muted); font-size: .95rem; }
.main-nav a:hover { color: var(--ink); text-decoration: none; }

.main-nav .nav-contact {
    color: #fff;
    background: var(--ink);
    padding: 7px 14px;
    border-radius: 999px;
    font-weight: 550;
}
.main-nav .nav-contact:hover { background: #000; color: #fff; }

/* 语言切换（<details>，零 JS） */
.lang-switcher { position: relative; }
.lang-switcher summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: .9rem;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
}
.lang-switcher summary::-webkit-details-marker { display: none; }
.lang-switcher[open] summary { background: var(--bg-tint); }
.lang-switcher .chevron { transition: transform .15s ease; }
.lang-switcher[open] .chevron { transform: rotate(180deg); }

.lang-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: grid;
    padding: 6px;
    min-width: 180px;
    z-index: 60;
}
.lang-menu a {
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--ink);
    font-size: .92rem;
    white-space: nowrap;
}
.lang-menu a:hover { background: var(--bg-tint); text-decoration: none; }
.lang-menu a[aria-current="page"] { font-weight: 650; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding-block: 62px 12px; text-align: center; }
.hero-copy { text-align: center; }
.hero-kicker {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-block-end: 10px;
}
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 36em; margin-inline: auto; }

/* --------------------------------------------------------------------------
   Section
   -------------------------------------------------------------------------- */
.section { padding-block: 28px 72px; }
.section-tinted { background: var(--bg-tint); }

/* 区标题刻意比 hero 的 h1 小一档：页面上只有一个主标题（「我们做的 App」），
   此处只当分区标签用，否则两个大标题读起来像同一句话说两遍。 */
.section-head { text-align: center; max-width: 640px; margin-inline: auto; margin-block-end: 22px; }
.section-head h2 { font-size: clamp(1.22rem, 2.1vw, 1.5rem); }
.section-head p { color: var(--muted); margin: 0; font-size: .96rem; }

/* --------------------------------------------------------------------------
   产品列表（一个产品一行，整行可点）

   ⚠️ 刻意不用多列网格：产品数会变，列数固定必然出现空位
      （2 个产品 / 3 列 = 右侧空一格）。行卡与产品数无关。

   宽度不再单独限宽，与 .container 取齐 —— 否则左缘和页眉/页脚对不齐。
   -------------------------------------------------------------------------- */
.product-list {
    display: grid;
    gap: 14px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 26px 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.product-row:hover {
    text-decoration: none;
    border-color: #cdd7e3;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* 产品图标＝App 的真实图标。
   ⛔ 不要加 border-radius / 投影：macOS 图标的圆角与投影已烘焙在 PNG 的
      alpha 通道里，再套一层 CSS 圆角会把正确的形状切掉。
   来源与刷新方式见 tools/make_site_icons.py。 */
.product-icon {
    flex: none;
    display: block;
    width: 58px;
    height: 58px;
}

/* 兜底：只有当 config 里没给 icon 时才走这里（浅底 + 产品色字母）。
   --pc 由模板内联给出（config products.*.color）。
   先写不依赖 color-mix 的两条兜底，再用 color-mix 覆盖。 */
.product-badge {
    flex: none;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 15px;
    background: var(--accent-soft);
    background: color-mix(in srgb, var(--pc, #16202b) 13%, #fff);
    color: #16202b;
    color: var(--pc, #16202b);
    font-weight: 700;
    font-size: 1.06rem;
    letter-spacing: .02em;
}

.product-info { flex: 1; min-width: 0; }

.product-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-block-end: 5px;
}
.product-title h3 { margin: 0; font-size: 1.18rem; }
.product-platform { color: var(--muted); font-size: .82rem; }
.product-tagline { color: var(--muted); font-size: .96rem; margin: 0; }

/* 右侧圆形箭头：常态给一层浅底（否则 1px 浅边在白卡上几乎看不见），hover 填充 */
.product-go {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: var(--bg-tint);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.product-row:hover .product-go {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.product-external {
    font-size: .74rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 8px;
}

/* --------------------------------------------------------------------------
   常见问题（<details> 折叠，零 JS）

   同时也是首页 FAQPage 结构化数据的可见正文 —— 爬虫读到的是这里的文字，
   所以不要用 CSS 把它藏起来（display:none 的内容不会被当作可见内容）。
   -------------------------------------------------------------------------- */
.faq-list {
    display: grid;
    gap: 10px;
}

.faq-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 15px 18px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .98rem;
    list-style: none;
    /* 用 flex 而不是 float: inline-end —— 逻辑值的 float 支持面还太窄，
       flex + space-between 在 RTL 下会自动把加号换到另一侧。 */
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    color: var(--muted);
    font-weight: 400;
    line-height: 1;
    transition: transform .15s ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--muted); font-size: .94rem; margin: 10px 0 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    border-block-start: 1px solid var(--line);
    background: var(--bg-tint);
    padding-block: 40px 26px;
    margin-block-start: 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.4fr;
    gap: 30px;
}
.footer-name { font-weight: 650; margin: 0 0 4px; }
.footer-tagline { color: var(--muted); font-size: .94rem; margin: 0 0 10px; }
.footer-privacy { color: var(--muted); font-size: .85rem; margin: 0; max-width: 30em; }
.footer-col { display: grid; gap: 8px; align-content: start; }
.footer-col a { color: var(--muted); font-size: .92rem; }

/* 语言列表：10 种语言平铺会把页脚拉高一大截，排成两列；
   RTL 下 column 会增加方向，这里用 grid 的自动流，两边表现一致。 */
.footer-lang-list { display: grid; gap: 8px; }
@media (min-width: 700px) {
    .footer-lang-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}
.footer-col a:hover { color: var(--ink); text-decoration: none; }
.footer-col a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.footer-title { font-weight: 600; font-size: .9rem; margin: 0 0 4px; color: var(--ink); }
.footer-bottom {
    margin-block-start: 34px;
    padding-block-start: 18px;
    border-block-start: 1px solid var(--line);
}
.footer-bottom p { color: var(--muted); font-size: .85rem; margin: 0; }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .section { padding-block: 32px 42px; }
    .footer-grid { grid-template-columns: 1fr; }
    .main-nav { gap: 12px; }
    .main-nav a:not(.nav-contact) { display: none; }
    .hero { padding-block-start: 42px; }

    /* 行卡在窄屏收紧；箭头按钮保留（它是「可进入」的唯一暗示） */
    .product-row { padding: 16px; gap: 12px; }
    .product-icon { width: 46px; height: 46px; }
    .product-badge { width: 46px; height: 46px; border-radius: 12px; font-size: .9rem; }
    .product-title h3 { font-size: 1.08rem; }
    .product-tagline { font-size: .92rem; }
    .product-go { width: 34px; height: 34px; }
}

/* RTL 微调（布局已用逻辑属性自动镜像） */
[dir="rtl"] .hero-kicker { letter-spacing: 0; }
