/* ===========================================================
   SocialProof 控制台样式（无框架依赖）
   =========================================================== */
:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --accent: #4f46e5;
    --accent-soft: #eef2ff;
    --success: #16a34a;
    --success-soft: #ecfdf5;
    --error: #dc2626;
    --error-soft: #fef2f2;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    /* 顶栏高度。后台的吸顶栏（左侧栏、设置页子导航、标签栏）都按它算 top。
       第 42 轮顶栏能变两行，写死的 66px 会把吸顶栏塞进顶栏底下，
       所以真值由 layout.php 里的脚本量出来覆盖，这里只是没 JS 时的兜底。 */
    --nav-h: 66px;
}

/* 登录后顶栏换成「站点名一行 + 链接条一行」，两行共 104px。
   没 JS 时按这个值兜底，免得吸顶栏被顶栏压住。 */
html:has(.nav.has-subnav) { --nav-h: 104px; }

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75rem; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.wrap { flex-wrap: wrap; }

/* ---------- 布局 ---------- */
.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 10px 22px;
    flex-wrap: wrap;              /* 菜单是后台可配的，链接一多必须能换行，不能顶出横向滚动条 */
    min-height: 58px;             /* 单行时高度与以前一致（58px） */
}
.brand { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 10px 18px; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }

/* ---------- 手机端折叠菜单（第 38 轮）----------
   以前窄屏是把 .nav-links 换行铺开，站点菜单一多导航就撑成三五行。
   现在 900px 以内收进汉堡按钮，点开才展开。
   按钮默认 display:none，只有 JS 加上 data-nav-collapsed 才出现 ——
   所以关掉 JS 时仍然按老样子换行铺开，不会丢掉入口。 */
.nav-toggle { display: none; }
.nav-toggle-box {
    display: block; position: relative;
    width: 17px; height: 2px; border-radius: 2px; background: currentColor;
}
.nav-toggle-box::before, .nav-toggle-box::after {
    content: ""; position: absolute; left: 0;
    width: 17px; height: 2px; border-radius: 2px; background: currentColor;
}
.nav-toggle-box::before { top: -6px; }
.nav-toggle-box::after { top: 6px; }

/* 语言切换：两个紧凑的文本按钮，当前语言高亮 */
/* 后台设置卡片里的分组小标题（第 17 轮） */
.card h3 { margin: 24px 0 10px; font-size: 15px; letter-spacing: -.01em; }
.card h3:first-of-type { margin-top: 18px; }
.quick-code { margin: 4px 0 18px; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 10px; background: rgba(17, 24, 39, .02); }
.quick-code .field-row { margin-bottom: 10px; }
.quick-code .help { margin-top: 8px; }

/* ---------- 语言下拉（第 17 轮：取代原来那一排语言链接） ---------- */
.lang-select-form { display: inline-flex; align-items: center; gap: 6px; }
.lang-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding: 5px 26px 5px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--surface);
    /* 箭头用内联 SVG：不依赖任何图标字体，图片被禁用也不影响 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 10px 7px;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
    max-width: 168px;
    text-overflow: ellipsis;
}
.lang-select:hover { border-color: var(--accent); color: var(--text); }
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 品牌区：后台填了 logo 就用图，没填继续用文字 */
.brand-logo { display: block; height: 26px; width: auto; }

/* 顶部公告条（后台可选） */
.site-notice {
    background: #111827; color: #f9fafb;
    font-size: 13px; line-height: 1.5;
    padding: 9px 18px; text-align: center;
}
.site-notice a { color: #fff; text-decoration: underline; }

.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(17, 24, 39, .06); }
.lang-switch a { padding: 3px 9px; border-radius: 999px; font-size: 12px; line-height: 1.4; color: var(--muted); text-decoration: none; white-space: nowrap; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.narrow { max-width: 460px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
}
.card.tight { padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat-sub { color: var(--muted); font-size: 12px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfd; }
.table-wrap { overflow-x: auto; }
/* 表格里的长串（服务器路径、密钥、URL）允许断行，否则一样会把页面撑宽 */
.table th, .table td { overflow-wrap: anywhere; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
    background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; text-decoration: none; white-space: nowrap;
    transition: filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: #f9fafb; filter: none; }
.btn.danger { background: var(--error); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; padding: 6px 8px; }
.btn.ghost:hover { color: var(--text); background: #f3f4f6; filter: none; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.input.sm, .select.sm { padding: 6px 9px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.input, .select, .textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
    font-size: 14px; font-family: inherit; color: var(--text); background: var(--surface);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 90px; resize: vertical; }
.input[type="color"] { padding: 3px; height: 38px; cursor: pointer; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ---------- 徽标 ---------- */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px;
    font-weight: 600; background: #f3f4f6; color: var(--muted);
}
.badge.on { background: var(--success-soft); color: var(--success); }
.badge.off { background: var(--error-soft); color: var(--error); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

/* ---------- 提示 ---------- */
.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; }
.alert.success { background: var(--success-soft); color: #166534; border: 1px solid #bbf7d0; }
.alert.error { background: var(--error-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 220px; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ---------- 代码块 ---------- */
.code {
    background: #0f172a; color: #e2e8f0; padding: 13px 15px; border-radius: 9px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
    /* 折行而不是横向滚动（第 37 轮）：安装代码里是一整条带 key 的 URL，
       nowrap 会把 380px 的右栏撑出滚动条，首尾都被切掉看不全。 */
    overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
}

/* 标签 / 值成对的一行（安装代码卡里的 «Conversion webhook + 长 URL»）：
   flex 子项默认 min-width:auto，长 URL 断不开就会把左侧标签压成一列一个字。 */
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kv-row > * { min-width: 0; }
.kv-row > .mono { overflow-wrap: anywhere; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 30px; margin-bottom: 8px; }

/* ---------- 首页 ---------- */
.hero { padding: 70px 20px 50px; text-align: center; }
.hero h1 { font-size: 38px; letter-spacing: -.03em; margin-bottom: 14px; }
.hero p { font-size: 17px; color: var(--muted); max-width: 620px; margin: 0 auto 26px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature .ico { font-size: 24px; margin-bottom: 8px; }

/* ---------- 预览 ---------- */
.preview-frame {
    width: 100%; height: 560px; border: 1px solid var(--border); border-radius: var(--radius);
    background: #fff;
}

/* ---------- 分栏 ---------- */
.split { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
/* 网格子项默认 min-width:auto，里面只要有一个不可断行的东西（代码块、
   长密钥、nowrap 的标签栏），整列就会按「最小内容宽度」撑开，
   窄屏直接整页横向滚动：/notifications/{id} 在 390px 上被撑到 764px。 */
.split > * { min-width: 0; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- 导航换行（平板 / 窄窗口 / 手机） ----------
   两个都不能少：
     1. 以前窄屏直接把 .nav-links 藏了，等于手机上没有任何入口；
     2. 720~900 这一段（768 的平板最典型）一行放不下，会把
        「Start free / 用户名」挤出屏幕，出现横向滚动条。
   所以从 900px 起就允许换行：品牌 + 账号区一行，导航链接铺第二行。 */
@media (max-width: 900px) {
    .nav-inner {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        row-gap: 4px;
        padding: 8px 16px;
    }
    .nav-links {
        order: 3;
        flex: 1 0 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px 14px;
        font-size: 13px;
    }
    .nav-links a { padding: 2px 0; }
    .nav-user { margin-left: auto; }

    /* 折叠态：链接整块收起，按钮接管 */
    .nav[data-nav-collapsed] .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        flex: 0 0 auto; width: 34px; height: 34px;
        margin-left: 2px; padding: 0;
        border: 1px solid var(--border); border-radius: 9px;
        background: var(--surface); color: var(--text); cursor: pointer;
    }
    .nav[data-nav-collapsed] .nav-toggle:hover { background: var(--bg); }
    .nav[data-nav-collapsed] .nav-links { display: none; }
    .nav[data-nav-collapsed].nav-open .nav-links {
        display: flex; flex-direction: column; flex-wrap: nowrap;
        align-items: stretch; justify-content: flex-start;
        gap: 0; padding-top: 6px;
        border-top: 1px solid var(--border);
    }
    .nav[data-nav-collapsed].nav-open .nav-links a {
        padding: 10px 8px; border-radius: 9px; font-size: 15px;
    }
    .nav[data-nav-collapsed].nav-open .nav-links a:hover,
    .nav[data-nav-collapsed].nav-open .nav-links a.active { background: var(--bg); color: var(--text); }
}

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
    .hero h1 { font-size: 28px; }
    .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
    /* 窄屏只剩 3 列，宽度够：不让表头拆词（overflow-wrap:anywhere 会把 STATUS 断成 STATU / S）。
       宽屏不加这条 —— 7 列全开时 nowrap 会把表格的最小宽度顶大，反而撑破页面。 */
    .table th { white-space: nowrap; }
    /* 嵌入代码里有很长的 URL，窄屏折行比横向滚动好读 */
    pre.code { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* ===========================================================
   套餐 / 定价 / 配额
   =========================================================== */

.hero { padding: 18px 0 6px; }
.hero h1 { font-size: 26px; }

.plans-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
    align-items: stretch;
    margin-top: 6px;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-flag { position: absolute; top: -11px; right: 16px; }
.plan-name { font-size: 17px; font-weight: 650; }
.plan-price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.plan-price small { font-size: 13px; font-weight: 500; opacity: .6; }

.plan-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.plan-features li { display: flex; gap: 8px; align-items: flex-start; }
.plan-features .tick { color: var(--success); font-weight: 700; flex: 0 0 auto; }
.plan-cta { margin-top: auto; }

.price-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    margin-top: 8px;
}
.price-toggle a { padding: 7px 16px; border-radius: 999px; font-size: 13px; color: inherit; }
.price-toggle a:hover { text-decoration: none; }
.price-toggle a.active { background: var(--accent); color: #fff; }

.usage-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.usage-bar { height: 8px; border-radius: 999px; background: rgba(127, 127, 127, .16); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.usage-full { color: var(--error); font-weight: 600; }

/* ---------- 区间选择条（第 37 轮：统计页自定义时间） ---------- */
.range-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.range-bar .range-field { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
/* .input 默认 width:100%，日期框会把整条撑开 */
.range-bar .input { width: auto; }

/* ===========================================================
   后台外壳：左侧固定导航栏 + 右侧内容（第 37 轮）
   -----------------------------------------------------------
   后台有 24 个入口，之前平铺在顶栏，1024~1440 一律换成两行，
   再窄一点就三行，把正文顶下去一大截。
   宽屏改成左侧竖栏；窄屏退回「一条可横向滚动的横条」，
   比换行堆叠好找，也不占高度。
   =========================================================== */

.admin-shell {
    display: grid;
    grid-template-columns: 226px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.admin-rail { position: sticky; top: calc(var(--nav-h) + 12px); max-height: calc(100vh - var(--nav-h) - 30px); overflow-y: auto; }
.admin-rail-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); font-weight: 700; margin: 0 0 8px 12px;
}

.admin-subnav {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.admin-subnav a {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--muted);
}
.admin-subnav a:hover { background: var(--bg); text-decoration: none; }
.admin-subnav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- 设置页子导航（第 38 轮）----------
   设置页有二十多张卡片。宽屏让标签换行会占掉三四行，吸顶就太占高度，
   所以一律「单行 + 横向滚动」，当前节由脚本高亮并自动滚进可视区。 */
.settings-nav {
    position: sticky; top: calc(var(--nav-h) + 12px); z-index: 30;
    display: flex; gap: 6px; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    padding: 8px 10px; margin: 0 0 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    /* 二十多个标签排成一条，装不下就横滚。系统滚动条会在吸顶栏底下压出一条
       灰杠（看着像被盖住了），所以整条隐藏，交给脚本把当前项滚进视野。 */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* 左右还有内容时压一层渐隐，提示还能滚；class 由脚本按滚动位置切 */
    --toc-fade-l: 0px;
    --toc-fade-r: 0px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--toc-fade-l), #000 calc(100% - var(--toc-fade-r)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--toc-fade-l), #000 calc(100% - var(--toc-fade-r)), transparent 100%);
}
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav.can-left { --toc-fade-l: 26px; }
.settings-nav.can-right { --toc-fade-r: 26px; }
.settings-nav a {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--muted);
    white-space: nowrap;
}
.settings-nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.settings-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* 点锚点跳过去时，别让目标卡片被顶部导航和这条吸顶栏盖住。
   留白 = 顶栏高度 + 吸顶栏自身（约 60px，含横向滚动条）+ 一点余量。 */
.settings-nav ~ .card { scroll-margin-top: calc(var(--nav-h) + 96px); }

.admin-main { min-width: 0; }
/* 后台正文自己不带 container（外壳已经给了内边距和宽度） */
.admin-main > main { padding: 0; margin: 0; max-width: none; }

@media (max-width: 1000px) {
    .admin-shell { grid-template-columns: 1fr; gap: 14px; padding: 16px 20px 50px; }
    /* min-width:0 不能少：格子项默认 min-width:auto，横条的 max-content 宽度
       （26 个子菜单一行）会把整格撑到 1600 多像素，手机上一屏只能看到左上角。 */
    .admin-rail { position: static; max-height: none; overflow: hidden; min-width: 0; }
    .admin-rail-title { display: none; }
    .admin-subnav {
        flex-direction: row; flex-wrap: nowrap; gap: 4px;
        overflow-x: auto; padding: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .admin-subnav a { white-space: nowrap; flex: 0 0 auto; }
}

/* ===========================================================
   小部件编辑器：分组标签页 / 吸底操作栏 / 字段分组
   -----------------------------------------------------------
   用 :checked 做纯 CSS 标签页，不依赖 JS：
   面板始终在 DOM 里，所以提交时所有字段都会带上，
   没有 JS 也不会丢数据。
   =========================================================== */

.tab-radio { position: absolute; opacity: 0; pointer-events: none; }

.tabs-bar {
    display: flex; gap: 4px; flex-wrap: wrap;
    padding: 4px; margin-bottom: 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; box-shadow: var(--shadow);
    position: sticky; top: calc(var(--nav-h) + 12px); z-index: 20;
}
.tabs-bar label {
    flex: 1 1 auto; text-align: center; cursor: pointer;
    padding: 8px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: var(--muted);
    white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.tabs-bar label:hover { color: var(--text); background: var(--bg); }
.tabs-bar .tab-count { font-weight: 500; opacity: .65; margin-left: 4px; }

.tab-panel { display: none; }

#tab-basic:checked ~ .tabs-bar label[for="tab-basic"],
#tab-content:checked ~ .tabs-bar label[for="tab-content"],
#tab-display:checked ~ .tabs-bar label[for="tab-display"],
#tab-appearance:checked ~ .tabs-bar label[for="tab-appearance"] {
    background: var(--accent); color: #fff;
}
#tab-basic:checked ~ .tab-panels > .tab-panel[data-tab="basic"],
#tab-content:checked ~ .tab-panels > .tab-panel[data-tab="content"],
#tab-display:checked ~ .tab-panels > .tab-panel[data-tab="display"],
#tab-appearance:checked ~ .tab-panels > .tab-panel[data-tab="appearance"] {
    display: block;
}

/* 没有 JS 时也能看到全部内容：CSS 若被禁用则所有面板本来就可见 */

/* 内容分组：把 12 个字段拆成「文案 / 素材 / 数据池 / 行为 / 链接」 */
.field-group { margin-bottom: 22px; }
.field-group:last-child { margin-bottom: 0; }
.field-group > h3 {
    font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); margin: 0 0 10px; padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
}

/* 吸底操作栏：长表单滚到哪都能保存 */
.action-bar {
    position: sticky; bottom: 0; z-index: 30;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 4px 0 20px; padding: 12px 16px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 -1px 12px rgba(16, 24, 40, .07);
}
.action-bar .spacer { flex: 1 1 auto; }

/* 预览卡片头部的小按钮 */
.preview-tools { display: flex; gap: 6px; align-items: center; }

/* textarea / 素材 / 池子类字段内容长，横跨整行更易读 */
.field-grid > .field.wide { grid-column: 1 / -1; }

/* 类型选择卡：选中时整张卡高亮，不用去找那个小圆点 */
.feature:has(input[type="radio"]:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow);
    background: var(--accent-soft);
}
.feature:has(input[type="radio"]) { transition: border-color .15s ease, background .15s ease; }
.feature:hover { border-color: #c7cbd4; }

/* 字段较多的类型：两列排布，减少滚动 */
@media (min-width: 700px) {
    .field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
}

/* 登出按钮等需要 POST 表单包装的位置，让它与其他导航项对齐 */
.inline-form {
    display: inline-flex;
    margin: 0;
}
.inline-form button {
    font: inherit;
}

/* ===========================================================
   公开落地页（未登录首页 / 营销页）
   =========================================================== */

.landing-hero { padding: 74px 20px 44px; text-align: center; }
.landing-hero h1 { font-size: 40px; letter-spacing: -.03em; margin-bottom: 14px; line-height: 1.15; }
.landing-hero p { font-size: 17px; color: var(--muted); max-width: 640px; margin: 0 auto 26px; }

.public-nav .nav-links { justify-content: center; }

.trust-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    text-align: center;
}
.trust-bar > div { display: flex; flex-direction: column; gap: 2px; }
.trust-bar strong { font-size: 18px; letter-spacing: -.01em; }

.section-title { font-size: 26px; letter-spacing: -.02em; margin-bottom: 6px; }
.section-sub { color: var(--muted); font-size: 15px; margin-bottom: 22px; max-width: 760px; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13px;
}
.chip.on { border-color: #c7d2fe; background: var(--accent-soft); }
.chip .muted { margin-left: 4px; }

.cta-band {
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 24px 26px;
}
.cta-band h2 { margin: 0 0 4px; }
.cta-band.final { background: var(--accent-soft); border-color: #c7d2fe; }

.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: 8px; }
.faq p { margin: 0; color: var(--muted); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 44px; }
.site-footer .container { padding: 34px 20px 26px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.footer-grid a { display: block; padding: 3px 0; font-size: 13px; color: var(--text); }
.footer-grid a:hover { color: var(--accent); }
.footer-grid .brand { display: inline-block; margin-bottom: 8px; }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--border); margin-top: 26px; padding-top: 16px;
}

/* ---------- 博客 / 独立页面（前台） ---------- */
.blog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.blog-head h1 { font-size: 30px; letter-spacing: -.02em; }

.post-shell { max-width: 720px; margin: 0 auto; }   /* 正文单栏居中，1440 下不会贴在左边 */
.post-crumbs a { color: var(--muted); }
.post-title { font-size: 32px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
.post-lede { font-size: 17px; color: var(--muted); margin: 0 0 10px; }
.post-meta { margin: 0 0 18px; }
.post-cover { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 4px; }

/* 正文：Markdown 渲染出来的元素只有这几种，逐一给样式就够了 */
.post-body { font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.post-body > * + * { margin-top: 1em; }
.post-body h2 { font-size: 22px; letter-spacing: -.01em; margin-top: 1.5em; }
.post-body h3 { font-size: 18px; margin-top: 1.3em; }
.post-body ul, .post-body ol { padding-left: 22px; }
.post-body li + li { margin-top: .35em; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.post-body blockquote { margin: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--border); color: var(--muted); }
.post-body code { background: rgba(17, 24, 39, .07); padding: 1px 5px; border-radius: 5px; font-size: 14px; }
.post-body pre.code { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; }
.post-body pre.code code { background: none; color: inherit; padding: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--border); }

.post-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.post-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    color: inherit;
}
.post-card:hover { text-decoration: none; border-color: #c7cbd4; }
.post-thumb {
    flex: 0 0 auto;
    height: 150px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #fce7f3);
    font-size: 40px; font-weight: 700; color: var(--accent);
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.post-card-body h2 { font-size: 17px; letter-spacing: -.01em; margin: 0; }
.post-card-body p { margin: 0; }
.post-card.featured { display: grid; grid-template-columns: 1.05fr 1fr; margin-bottom: 20px; }
.post-card.featured .post-thumb { min-height: 210px; height: 100%; font-size: 56px; }
.post-card.featured h2 { font-size: 22px; }

.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 26px; }
.pager a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px; font-size: 13px; }
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 编辑器里的译文卡片：折叠时一行，展开后是一个逐字段对照的表单 */
.lang-block { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.lang-block summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.lang-block[open] summary { margin-bottom: 10px; }
.lang-block form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }

/* 预览 iframe 里的顶部提示条 */
.preview-bar { position: sticky; top: 0; z-index: 5; background: #111827; color: #fff; font-size: 12px; padding: 7px 14px; text-align: center; }

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
    .post-title { font-size: 25px; }
    .post-lede { font-size: 15px; }
    .post-card.featured { grid-template-columns: 1fr; }
    .post-card.featured .post-thumb { min-height: 150px; font-size: 44px; }
    .landing-hero { padding: 44px 18px 30px; }
    .landing-hero h1 { font-size: 30px; }
    .section-title { font-size: 21px; }
    .cta-band { flex-direction: column; align-items: flex-start; }
}

/* ---------- growth: inbox, badges, payouts ---------- */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    margin-left: 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.inbox-list { display: block; }
.inbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.inbox-item:last-child { border-bottom: 0; }
.inbox-item.unread { background: var(--accent-soft); }
.inbox-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--border);
}
.inbox-dot.on { background: var(--accent); }
.inbox-body { flex: 1 1 auto; min-width: 0; }
.inbox-title { font-weight: 600; }
.inbox-text { color: var(--text); font-size: 13px; }
.inbox-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

.usage-row { display: flex; align-items: center; gap: 10px; }
.usage-row .usage-bar { flex: 1 1 auto; }

/* ---------- Round 23: email marketing, reports and logs ---------- */
.stack { display: flex; flex-direction: column; gap: 18px; }
.badge.warn { background: #fef3c7; color: #92400e; }
.alert.info { background: var(--accent-soft); color: #1e3a8a; border: 1px solid #bfdbfe; }
.alert.warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Honeypot field: bots fill it in, people never see it. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.footer-subscribe {
    border-top: 1px solid var(--border);
    margin-top: 22px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-subscribe h4 { margin: 0 0 2px; }
.footer-subscribe form { margin: 0; }
.footer-subscribe .input { min-width: 220px; }

/* Activity log detail column */
.log-detail { color: var(--muted); font-size: 12px; word-break: break-word; }

/* ---------------------------------------------------------------- round 24
   Browser push: footer opt-in strip, the notification mock-up shown while an
   admin writes a campaign, and a couple of small helpers. */

.footer-push {
    border-top: 1px solid var(--border);
    margin-top: 22px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
/* The newsletter strip above already draws the divider. */
.footer-subscribe + .footer-push { border-top: 0; margin-top: 10px; padding-top: 0; }
.footer-push h4 { margin: 0 0 2px; }
.footer-push [data-push-status] { max-width: 260px; }

.btn.is-busy { opacity: .6; pointer-events: none; }
.stat-value.small-value { font-size: 20px; }

.push-preview {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
}
.push-preview-icon {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 9px;
    background: var(--accent, #4f46e5);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.push-preview-icon img { width: 100%; height: 100%; object-fit: cover; }
.push-preview-dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.push-preview-body { min-width: 0; }
.push-preview-title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.push-preview-text { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.push-preview-host { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ===== Round 25: taxes, invoices & credit notes ===== */
.mt-0 { margin-top: 0; }
.tax-country {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.tax-country > label { font-size: 13px; color: var(--muted); }
.tax-country select { max-width: 260px; width: auto; }
.tax-line { font-size: 12px; margin-top: 2px; }
.invoice-totals { max-width: 340px; margin: 18px 0 0 auto; }
.invoice-totals .totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.invoice-totals .totals-row.total {
    font-weight: 700;
    font-size: 16px;
    border-top: 2px solid var(--border);
    border-bottom: 0;
    color: var(--accent);
    padding-top: 10px;
}
.invoice-totals .totals-row span:last-child { white-space: nowrap; }
.item-row .item-qty { max-width: 92px; }
.item-row .item-unit { max-width: 132px; }
.item-row .item-amount { font-variant-numeric: tabular-nums; }
.item-remove { line-height: 1; padding: 4px 9px; }
table .invoice-totals { margin-top: 10px; }
@media (max-width: 640px) {
    .invoice-totals { max-width: none; margin-left: 0; }
}

/* ===========================================================
   第 27 轮：入门清单（Spotlight）与 PWA
   =========================================================== */
.center-text { text-align: center; }
.ml-1 { margin-left: .35rem; }

/* 进度条 */
.progress {
    height: 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    background: var(--accent);
    transition: width .3s ease;
}

/* 入门清单 */
.spotlight-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-top: .85rem;
}
.spotlight-steps {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: .25rem;
}
.spotlight-steps li {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .5rem .25rem;
    border-top: 1px solid var(--border);
}
.spotlight-steps li:first-child { border-top: 0; }
.spotlight-steps .tick {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
}
.spotlight-steps li.done .tick {
    background: var(--success-soft);
    border-color: var(--success);
    color: var(--success);
}
.spotlight-steps li.done a { color: var(--muted); text-decoration: line-through; }
.spotlight-body { flex: 1 1 auto; }
.spotlight-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.spotlight-steps li.done .spotlight-state { color: var(--success); }
.spotlight-restore {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
    padding: .35rem .75rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* PWA 安装提示：只在浏览器主动给出安装机会时出现 */
.pwa-prompt {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: min(560px, calc(100vw - 24px));
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 60;
}
.pwa-prompt-body { display: flex; flex-direction: column; }
.pwa-prompt-actions { display: flex; gap: .5rem; }

/* 离线页 */
.offline-card { max-width: 520px; margin: 3rem auto; }
.offline-icon { font-size: 42px; line-height: 1; }

/* ===========================================================
   Cookie 同意横幅（第 30 轮）
   =========================================================== */
.sp-consent {
    position: fixed;
    z-index: 2147482000;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 18px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(16, 24, 40, .16);
    font-size: 13px;
    line-height: 1.55;
}
.sp-consent[hidden] { display: none; }
.sp-consent-text { flex: 1 1 320px; min-width: 0; }
.sp-consent-text p { margin: 0; }
.sp-consent-link { display: inline-block; margin-top: 4px; font-size: 12px; }
.sp-consent-actions { display: flex; gap: 8px; flex: 0 0 auto; margin-left: auto; }

/* 左下 / 右下：窄卡片，不横跨整屏 */
.sp-consent-bottom_left,
.sp-consent-bottom_right { max-width: 460px; }
.sp-consent-bottom_left { right: auto; }
.sp-consent-bottom_right { left: auto; }

@media (max-width: 640px) {
    .sp-consent,
    .sp-consent-bottom_left,
    .sp-consent-bottom_right {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
        padding: 12px 14px;
    }
    .sp-consent-actions { width: 100%; margin-left: 0; }
    .sp-consent-actions .btn { flex: 1 1 auto; }
}


/* ===========================================================
   第 32 轮：社交登录 / 站内公告 / 广告位
   =========================================================== */

/* ---- 社交登录按钮 ---- */
.social-auth { margin-top: 18px; }
.social-auth-or {
    display: flex; align-items: center; gap: 10px;
    color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    margin: 4px 0 12px;
}
.social-auth-or::before,
.social-auth-or::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.social-auth-list { display: grid; gap: 8px; }

.social-btn { display: flex; align-items: center; gap: 10px; text-align: left; }
.social-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px; flex: none;
    background: var(--brand, #4f46e5); color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: -.02em;
}

/* ---- 账户中心：已连接的账号 ---- */
.social-links { display: grid; gap: 10px; }
.social-link-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg);
}
.social-link-name { flex: 1; display: flex; flex-direction: column; line-height: 1.35; font-weight: 600; }
.social-link-name .muted { font-weight: 400; }

/* ---- 站内公告 ---- */
.announcement {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 10px 18px; font-size: 13px; color: #fff; background: #2563eb;
}
.announcement-inner {
    flex: 1; max-width: 1180px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.announcement-text { text-align: center; }
.announcement-link { color: #fff; text-decoration: underline; font-weight: 600; white-space: nowrap; }
.announcement-close {
    background: transparent; border: 0; color: #fff; cursor: pointer;
    font-size: 20px; line-height: 1; padding: 0 4px; opacity: .75;
}
.announcement-close:hover { opacity: 1; }
.announcement-info { background: #2563eb; }
.announcement-success { background: #059669; }
.announcement-warning { background: #d97706; }
.announcement-promo { background: linear-gradient(90deg, #4f46e5, #9333ea 55%, #db2777); }

/* ---- 广告位 ---- */
.ad-slot { max-width: 1180px; margin: 0 auto 18px; padding: 0 20px; }
.ad-slot-bottom { margin: 24px auto 0; }
.ad-slot img, .ad-slot iframe { max-width: 100%; }

/* ---- 后台：公告译文分组 ---- */
.translation-block { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.translation-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

/* ---------- 第 36 轮：长列表页的固定动作条 ----------
   部件选型页有 30+ 张类型卡片，按钮固定在视口底部，
   不用滚到最后一行才知道要点哪里。 */
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .94);
    border-top: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -1px 2px rgba(16, 24, 40, .04);
    backdrop-filter: blur(6px);
}
@media (max-width: 640px) {
    .sticky-actions { padding: 10px 12px; }
}


/* ---------- 顶栏的子导航形态（第 39 轮）----------
   站长在「菜单」页把顶栏切成子导航后：Logo 行只留站点名和账号区，
   链接下移成一条独立的横条，单行不换行 —— 链接再多也不会把账号区挤到第二行。
   手机端（900px 以内）链接本来就收进汉堡按钮里，这里只负责把整条横条一起收起。 */
.nav.has-subnav .nav-inner { flex-wrap: nowrap; }

.subnav {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.subnav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 7px 20px;
    display: flex;
    align-items: center;
}

.subnav .nav-links {
    flex: 1 1 auto;
    flex-wrap: nowrap;              /* 横条只有一行，装不下就横向滚，不换行 */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;          /* 滚动条本身不用露出来，能滑就行 */
    -ms-overflow-style: none;
    font-size: 14px;
    gap: 4px 18px;
}

.subnav .nav-links::-webkit-scrollbar { height: 0; }
.subnav .nav-links a { padding: 4px 0; white-space: nowrap; }

/* 单选项：和 .checkbox 一套皮肤，只是字多、要能对齐第一行 */
/* 选择项：.field label 是 display:block（0,1,1），所以这里写成 .field .radio（两个类）
   才盖得住它 —— 不然圆点会自己占一行，文字被挤到下一行。 */
.field .radio { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.field .radio input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.field .radio strong { font-weight: 600; }
.field .radio > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* 小笔记本（1024~1200）：字号和间距收一点，14 个链接也能装进一条横条不用横滑 */
@media (max-width: 1200px) {
    .subnav-inner { padding: 7px 16px; }
    .subnav .nav-links { font-size: 13px; gap: 4px 13px; }
}

@media (max-width: 900px) {
    /* 窄屏还是要能换行，否则账号区会被挤出屏幕（第 37 轮的教训） */
    .nav.has-subnav .nav-inner { flex-wrap: wrap; }

    /* 折叠态：整条子导航跟着链接一起收起，展开时才出现 */
    .nav[data-nav-collapsed] .subnav { display: none; }
    .nav[data-nav-collapsed].nav-open .subnav { display: block; }
    .nav[data-nav-collapsed].nav-open .subnav .nav-links {
        border-top: 0;
        padding-top: 0;
        overflow: visible;          /* 展开后是竖排列表，不需要横向滚 */
    }
}
