/* ===========================================================
   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);
}

* { 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: 0 20px;
    display: flex;
    align-items: center;
    gap: 22px;
    height: 58px;
}
.brand { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 18px; flex: 1; }
.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; }

/* 语言切换：两个紧凑的文本按钮，当前语言高亮 */
.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; }

/* ---------- 按钮 ---------- */
.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; }
.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;
    overflow-x: auto; white-space: pre; margin: 0;
}

/* ---------- 空状态 ---------- */
.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; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 28px; }
    .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
}

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

.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; }

.admin-subnav-wrap { background: var(--surface); border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.admin-subnav { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 0; }
.admin-subnav a {
    padding: 6px 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; }

/* ===========================================================
   小部件编辑器：分组标签页 / 吸底操作栏 / 字段分组
   -----------------------------------------------------------
   用 :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: 66px; 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); }

.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;
}

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
    .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; }
}
