/* ==========================================================
   fuliba.de 前台样式（首页 / 验证页 / 微信提示页 共用）
   - 移动优先；>=768 平板，>=1024 电脑双栏
   - 主题：默认跟随系统；html[data-theme] 为用户手动选择
   - 不依赖任何外部字体 / 框架
   ========================================================== */

:root {
    --brand: #00c250;
    --brand-ink: #00873a;          /* 白底上的品牌色文字（对比度达标） */
    --brand-soft: rgba(0, 194, 80, 0.10);
    --brand-line: rgba(0, 194, 80, 0.28);

    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-2: #f6f8fa;
    --border: #e4e8ec;
    --text: #17202a;
    --text-2: #4f5b67;
    --text-3: #8792a0;

    --ok: #16a34a;
    --slow: #d97706;
    --bad: #dc2626;
    --idle: #a3adb8;

    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -16px rgba(16, 24, 40, 0.18);
    --radius: 16px;
    --radius-sm: 12px;
    color-scheme: light;
}

/* 暗色变量：系统为暗色且用户未手动选浅色，或用户手动选了暗色 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand-ink: #3ddc84;
        --brand-soft: rgba(61, 220, 132, 0.12);
        --brand-line: rgba(61, 220, 132, 0.30);
        --bg: #0d1117;
        --surface: #161b22;
        --surface-2: #1c232c;
        --border: #262e38;
        --text: #e6edf3;
        --text-2: #a9b4c0;
        --text-3: #76828f;
        --ok: #3fb950;
        --slow: #e3a008;
        --bad: #f85149;
        --idle: #5d6875;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -18px rgba(0, 0, 0, 0.8);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --brand-ink: #3ddc84;
    --brand-soft: rgba(61, 220, 132, 0.12);
    --brand-line: rgba(61, 220, 132, 0.30);
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1c232c;
    --border: #262e38;
    --text: #e6edf3;
    --text-2: #a9b4c0;
    --text-3: #76828f;
    --ok: #3fb950;
    --slow: #e3a008;
    --bad: #f85149;
    --idle: #5d6875;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 页面骨架 ---------- */
.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 12px calc(28px + env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
}

/* ---------- 顶部品牌区 ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(16px + env(safe-area-inset-top)) 4px 14px;
}
.logo { width: 42px; height: 42px; border-radius: 11px; flex: none; box-shadow: 0 6px 16px -8px rgba(0, 160, 70, 0.7); }
.brand { min-width: 0; }
.brand-title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: 0.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-domain {
    display: inline-block;
    margin-top: 3px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    border-radius: 999px;
}
.icon-btn {
    margin-left: auto;
    width: 40px;
    height: 40px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-2);
    cursor: pointer;
}
.icon-btn:hover { color: var(--text); }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
    :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

/* ---------- 检测状态条 ---------- */
.status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 14px;
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 13.5px;
    color: var(--text-2);
}
.status .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15); flex: none; }
.status.is-checking .pulse { background: var(--idle); box-shadow: none; animation: blink 1s ease-in-out infinite; }
.status b { color: var(--text); font-weight: 600; }
.status-text { flex: 1; min-width: 0; }
.btn-ghost {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
}
.btn-ghost svg.i { width: 15px; height: 15px; }
@keyframes blink { 50% { opacity: 0.35; } }
@media (max-width: 479px) { .hide-sm { display: none; } }

/* 欢迎语（后台开启时显示） */
.notice {
    margin: 0 0 12px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
}

/* ---------- 主体布局 ---------- */
.layout { display: grid; gap: 12px; }
.main, .aside { display: grid; gap: 12px; align-content: start; min-width: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 4px;
}
.card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--brand); }
.card-meta { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* ---------- 地址行 ---------- */
.rows { list-style: none; margin: 0; padding: 4px 6px 6px; }
.row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.row + .row::before {           /* 行间分隔线，从序号右侧开始 */
    content: "";
    position: absolute;
    top: 0;
    left: 58px;
    right: 10px;
    border-top: 1px solid var(--border);
}
.row:hover { background: var(--surface-2); }
.row:hover::before, .row:hover + .row::before { border-color: transparent; }

.row-no {
    width: 36px;
    height: 36px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}
.row-main { flex: 1; min-width: 0; }
.row-link { color: inherit; display: block; }
.row-link:hover { text-decoration: none; }
.row-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-sm); z-index: 0; } /* 整行可点 */
/* 名称可换行，标签跟在文字后面自然流动（窄屏不再把名称截成"福利吧永…"） */
.row-name {
    display: block;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    overflow-wrap: anywhere;
}
.row-name .tag { display: inline-block; margin-left: 6px; vertical-align: 1px; }
.row-url {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row:hover .row-name .t { color: var(--brand-ink); }

.tag {
    flex: none;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    border-radius: 6px;
    white-space: nowrap;
}
.tag-rec { color: #fff; background: var(--brand); }
.tag-note { color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); line-height: 16px; }

/* 延迟：圆点 + 文字，点击重新检测 */
.ping {
    position: relative;
    z-index: 1;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 72px;
    height: 32px;
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ping .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.ping.is-checking { color: var(--text-3); }
.ping.is-checking .dot { animation: blink 1s ease-in-out infinite; }
.ping.is-ok .dot { background: var(--ok); }
.ping.is-slow { color: var(--slow); }
.ping.is-slow .dot { background: var(--slow); }
.ping.is-bad { color: var(--bad); }
.ping.is-bad .dot { background: var(--bad); }

.copy {
    position: relative;
    z-index: 1;
    flex: none;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.copy:hover { color: var(--brand-ink); border-color: var(--brand-line); }
.copy.is-done { color: #fff; background: var(--brand); border-color: var(--brand); opacity: 1 !important; }
.copy svg.i { width: 16px; height: 16px; }

/* ---------- 侧栏：APP 下载 / 联系方式 / 使用指南 ---------- */
.list { list-style: none; margin: 0; padding: 6px 8px 8px; }
.item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 8px;
    font-size: 14px;
    color: var(--text-2);
    border-radius: 10px;
    overflow-wrap: anywhere;
}
.item + .item { border-top: 1px solid var(--border); border-radius: 0; }
.item-ic {
    width: 30px;
    height: 30px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border-radius: 9px;
}
.item-ic svg.i { width: 16px; height: 16px; }
.item-body { min-width: 0; flex: 1; padding-top: 4px; }
.item-label { color: var(--text); font-weight: 600; }
.item-body a { font-weight: 500; word-break: break-all; }

details.card > summary {
    list-style: none;
    cursor: pointer;
    padding-bottom: 12px;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .chev { transition: transform 0.2s ease; color: var(--text-3); }
details.card[open] > summary .chev { transform: rotate(180deg); }
details.card[open] > summary { padding-bottom: 4px; }
.guide { margin: 0; padding: 4px 16px 6px 34px; font-size: 14px; color: var(--text-2); }
.guide li { margin: 6px 0; }
.guide li::marker { color: var(--brand); }
.keys {
    display: grid;
    gap: 6px;
    margin: 6px 16px 16px;
    padding: 12px;
    font-size: 13px;
    color: var(--text-2);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.keys b { color: var(--text); font-weight: 600; margin-right: 6px; }
kbd {
    display: inline-block;
    min-width: 22px;
    padding: 0 5px;
    font: 600 12px/20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-align: center;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
}

.foot {
    padding: 22px 8px 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-3);
}
.foot a { color: var(--text-2); }

/* ---------- 入场动画 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.status, .notice, .card { animation: rise 0.35s ease backwards; }
.main > :nth-child(2) { animation-delay: 0.04s; }
.main > :nth-child(3) { animation-delay: 0.08s; }
.main > :nth-child(n+4) { animation-delay: 0.12s; }
.aside > * { animation-delay: 0.1s; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 小屏手机（<=359px） ---------- */
@media (max-width: 359px) {
    .row { gap: 9px; padding: 9px 6px; }
    .row-no { display: none; }
    .row + .row::before { left: 10px; }
    .ping { min-width: 58px; font-size: 12px; }
    .brand-title { font-size: 17px; }
}

/* ---------- 平板（>=768px） ---------- */
@media (min-width: 768px) {
    .page { padding-left: 24px; padding-right: 24px; }
    .topbar { padding: 32px 4px 20px; gap: 14px; }
    .logo { width: 52px; height: 52px; border-radius: 14px; }
    .brand-title { font-size: 24px; }
    .layout, .main, .aside { gap: 16px; }
    .status { margin-bottom: 16px; }
    .card-head { padding: 18px 20px 6px; }
    .rows { padding: 4px 10px 10px; }
    .row { padding: 12px 12px; gap: 14px; }
    .row + .row::before { left: 62px; right: 12px; }
    .ping { min-width: 84px; }
}

/* ---------- 电脑（>=1024px）：左侧地址，右侧信息栏 ---------- */
@media (min-width: 1024px) {
    .layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
    .aside { position: sticky; top: 16px; }
    .copy { opacity: 0.55; }
    .row:hover .copy, .copy:focus-visible { opacity: 1; }
}

/* ==========================================================
   验证页 / 微信提示页
   ========================================================== */
.center-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.panel {
    width: 100%;
    max-width: 400px;
    padding: 28px 22px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.panel .logo { width: 56px; height: 56px; border-radius: 15px; margin: 0 auto 14px; display: block; }
.panel h1 { margin: 0 0 6px; font-size: 20px; }
.panel .sub { margin: 0 0 22px; font-size: 13.5px; color: var(--text-3); }
.panel .err { margin: -10px 0 14px; font-size: 13px; color: var(--bad); }
.center-page .domain { margin-top: 16px; font-size: 12.5px; color: var(--text-3); }

.slider {
    position: relative;
    height: 52px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
}
.slider-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--brand-soft); }
.slider-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text-3); pointer-events: none; }
.slider-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 46px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    border-radius: 11px;
    box-shadow: 0 4px 12px -4px rgba(0, 160, 70, 0.7);
    cursor: grab;
}
.slider-thumb:active { cursor: grabbing; }
.slider.is-passed .slider-fill { width: 100%; }
.slider.is-passed .slider-text { color: var(--brand-ink); font-weight: 600; }

/* 微信提示页 */
.wx-arrow { position: fixed; top: calc(6px + env(safe-area-inset-top)); right: 14px; width: 84px; height: 84px; color: var(--brand); animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translate(5px, -5px); } }
.steps { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 15px; background: var(--surface-2); border-radius: var(--radius-sm); }
.steps .n { width: 26px; height: 26px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 50%; }
.dots { display: inline-block; padding: 0 7px; font-weight: 800; letter-spacing: 1px; line-height: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.urlbox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.urlbox code { flex: 1; min-width: 0; font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn svg.i { width: 16px; height: 16px; }
.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--text-3); }

/* ---------- 运行时状态（设计稿之外的补充） ---------- */
.status.is-bad .pulse { background: var(--bad); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15); }
.btn-ghost:disabled { opacity: 0.55; cursor: default; }
.btn-ghost:disabled svg.i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.copy.is-fail { color: var(--bad); border-color: var(--bad); opacity: 1 !important; }
span.ping { cursor: default; }
.row-link:not([href]) { cursor: default; }
.row-link:not([href])::after { display: none; }
[hidden] { display: none !important; }
