:root {
    --side-bg: #151b26;
    --side-text: #c5cdd8;
    --side-active: #ffffff;
    --accent: #2f6fed;
    --accent-soft: #eaf1ff;
    --bg: #eef1f6;
    --panel: #ffffff;
    --line: #e4e8ef;
    --text: #1c2430;
    --muted: #738093;
    --ok: #14804a;
    --err: #d14343;
    --warn: #c47d0e;
    --call: #2f6fed;
    --radius: 12px;
    --side: 248px;
    --shadow: 0 1px 2px rgba(21, 27, 38, 0.04), 0 8px 24px rgba(21, 27, 38, 0.04);
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --pad-x: clamp(16px, 2.4vw, 40px);
    --pad-y: clamp(12px, 1.6vw, 28px);
    --content-gap: clamp(12px, 1.2vw, 18px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #1f56c9; }

/* ===== Layout ===== */
.shell { display: flex; min-height: 100vh; background: var(--bg); }

.side {
    width: var(--side);
    flex-shrink: 0;
    background: var(--side-bg);
    color: var(--side-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
}
.side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 20px;
    text-decoration: none !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
}
.logo-copy { display: flex; flex-direction: column; min-width: 0; }
.logo-name { color: #fff; font-weight: 700; font-size: 17px; line-height: 1.2; }
.logo-en { color: #8090a5; font-size: 11px; margin-top: 3px; letter-spacing: .04em; }

.side-nav { padding: 16px 12px; flex: 1; overflow: auto; }
.side-label {
    margin: 18px 12px 8px;
    font-size: 11px;
    color: #6b7a90;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
}
.side-link {
    display: block;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--side-text) !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.side-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff !important;
}
.side-link.is-active {
    background: rgba(47, 111, 237, .18);
    color: #fff !important;
}

.side-user {
    margin: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.05);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}
.side-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: #2a3548; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.side-user-meta strong { display: block; color: #fff; font-size: 13px; }
.side-user-meta span { color: #7d8b9f; font-size: 11px; }
.side-exit { color: #8b98ab !important; font-size: 12px; }
.side-exit:hover { color: #fff !important; }

.side-mask { display: none; position: fixed; inset: 0; background: rgba(15, 20, 30, .45); z-index: 40; }

.stage {
    flex: 1;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.top {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: var(--pad-y) var(--pad-x);
    width: 100%;
    background: rgba(238, 241, 246, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.top-copy { flex: 1; min-width: 0; }
.top-copy h1 {
    margin: 0;
    font-size: clamp(20px, 1.6vw, 28px);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.02em;
}
.top-copy p { margin: 4px 0 0; color: var(--muted); font-size: clamp(13px, 1vw, 15px); }
.top-actions { margin-left: auto; flex-shrink: 0; }
.icon-btn {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
    color: var(--text);
}
.main {
    display: block !important;
    flex: 1;
    width: 100%;
    max-width: none;
    padding: 8px var(--pad-x) clamp(40px, 5vw, 72px);
    box-sizing: border-box;
}

/* ===== Components ===== */
.page-head { display: none; }
.detail-head.page-head { display: block !important; margin-bottom: 18px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; }
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.back:hover { color: var(--text); }
.back.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 10px 16px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 650;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    text-decoration: none !important;
}
.back.back-btn:hover {
    color: var(--accent);
    border-color: #c9d4e8;
    background: #f7f9fc;
}

.panel, .login-card, .stat, .m-card, .flow-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel {
    padding: clamp(18px, 1.6vw, 28px) clamp(18px, 1.8vw, 32px);
    margin-bottom: var(--content-gap);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.panel h2 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.panel h3 { margin: 18px 0 8px; font-size: 14px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 16px;
    border-radius: 10px; border: 1px solid var(--line);
    background: #fff; color: var(--text);
    font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none !important;
    transition: .15s ease;
}
.btn:hover { background: #f7f8fb; border-color: #d5dbe6; }
.btn-primary,
.btn-lime {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff !important;
}
.btn-primary:hover,
.btn-lime:hover {
    background: #1f56c9;
    border-color: #1f56c9;
    color: #fff !important;
}
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-danger {
    background: var(--err);
    border-color: var(--err);
    color: #fff !important;
}
.btn-danger:hover { background: #b53636; border-color: #b53636; }
.btn-danger:disabled,
.btn-danger[disabled] {
    opacity: .45;
    cursor: not-allowed;
}
.btn-danger-outline {
    background: #fff;
    border-color: #f5c9c9;
    color: var(--err) !important;
}
.btn-danger-outline:hover {
    background: #fdecec;
    border-color: #efb0b0;
}
.btn-danger-outline:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.batch-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check-col { width: 42px; text-align: center !important; }
.check-col input { width: auto; min-height: 0; margin: 0; cursor: pointer; }
.m-card-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    text-decoration: none !important;
    color: inherit !important;
}
.m-card-check { display: flex; padding-top: 4px; cursor: pointer; }
.m-card-check input { width: auto; min-height: 0; margin: 0; }
.m-card-body { flex: 1; min-width: 0; color: inherit !important; text-decoration: none !important; }
.btn-call {
    width: 100%; min-height: 46px; margin-bottom: 14px;
    background: var(--call); border-color: var(--call);
    color: #fff !important; font-size: 15px; font-weight: 700;
}

label {
    display: block; margin: 14px 0 6px;
    font-size: 13px; font-weight: 600; color: #4b5568;
}
input[type="text"], input[type="password"], input[type="search"], input[type="number"],
input[type="tel"], input[type="email"], input[type="file"],
select, textarea {
    width: 100%; min-height: 40px; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 10px;
    font: inherit; background: #fff; color: var(--text);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
textarea { min-height: 104px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #93b4f8;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, .12);
}

.toast {
    padding: 12px 14px; border-radius: 10px; margin-bottom: 14px;
    font-size: 14px; font-weight: 500;
}
.toast-ok { background: #e8f7ef; color: var(--ok); border: 1px solid #cfe9da; }
.toast-err { background: #fdecec; color: var(--err); border: 1px solid #f5c9c9; }

/* 操作后轻提示：不打断滚动位置 */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    z-index: 320;
    max-width: min(92vw, 420px);
    padding: 11px 16px;
    border-radius: 999px;
    background: #1f2937;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 28px rgba(15, 22, 36, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.app-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.app-toast.is-ok { background: #176b45; }
.app-toast.is-err { background: #b42318; }
.merchant-card.is-leaving,
tr.is-leaving,
.m-card.is-leaving {
    opacity: .35;
    transform: scale(.98);
    transition: opacity .18s ease, transform .18s ease;
}

/* ===== 中屏弹窗 ===== */
body.modal-open { overflow: hidden; }
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(15, 22, 36, .48);
    backdrop-filter: blur(2px);
}
.modal-root[hidden] { display: none !important; }
.modal-root.is-open { display: flex; }
.modal-dialog {
    width: min(560px, 92vw);
    max-height: min(80vh, 720px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 64px rgba(15, 22, 36, .22);
    overflow: hidden;
    animation: modalIn .18s ease;
}
.modal-dialog.is-ok { border-top: 3px solid var(--ok); }
.modal-dialog.is-err { border-top: 3px solid var(--err); }
.modal-dialog.is-warn { border-top: 3px solid var(--warn); }
.modal-dialog.is-info { border-top: 3px solid var(--accent); }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 16px 18px 10px;
}
.modal-head h3 {
    margin: 0; font-size: 17px; font-weight: 750; color: var(--text);
}
.modal-x {
    border: 0; background: #f1f4f8; color: #5b6575;
    width: 32px; height: 32px; border-radius: 8px;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-x:hover { background: #e6ebf2; color: var(--text); }
.modal-body {
    padding: 8px 18px 6px;
    overflow: auto;
    flex: 1;
    min-height: 0;
}
.modal-msg {
    margin: 0; font-size: 15px; line-height: 1.65; color: #334155;
    white-space: pre-wrap; word-break: break-word;
}
.modal-foot {
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
    padding: 14px 18px 18px;
}
.row-click { cursor: pointer; }
.row-click:hover { background: #f3f7ff !important; }
.m-card-btn {
    width: 100%; text-align: left; font: inherit; cursor: pointer;
    border: 1px solid var(--line); background: #fff;
}
.m-card-btn:hover { border-color: #c9d4e5; }
.m-card-btn-plain {
    flex: 1; min-width: 0; text-align: left; font: inherit; cursor: pointer;
    border: 0; background: transparent; padding: 0; color: inherit;
}
.m-card-row .btn { flex-shrink: 0; align-self: center; }
.follow-detail-head strong { font-size: 18px; color: var(--text); }
.follow-note {
    margin: 0; padding: 12px 14px; background: #f7f9fc;
    border: 1px solid var(--line); border-radius: 10px;
    font-size: 14px; line-height: 1.6; white-space: pre-wrap;
}

/* 采集条数汇总 */
.crawl-summary { margin-bottom: var(--content-gap); }
.crawl-summary-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.crawl-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.crawl-stat-grid-page { margin-bottom: 14px; }
.crawl-stat-grid-modal { margin-top: 4px; }
.crawl-stat {
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
}
.crawl-stat.is-ok { background: #eefaf3; border-color: #cfe9da; }
.crawl-stat.is-info { background: #eaf1ff; border-color: #d5e3ff; }
.crawl-stat.is-warn { background: #fff6e8; border-color: #f0dfc0; }
.crawl-stat-num {
    font-size: clamp(22px, 2.4vw, 32px);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
    line-height: 1.1;
}
.crawl-stat.is-ok .crawl-stat-num { color: var(--ok); }
.crawl-stat.is-info .crawl-stat-num { color: var(--accent); }
.crawl-stat.is-warn .crawl-stat-num { color: var(--warn); }
.crawl-stat-label {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.num-ok { color: var(--ok); font-weight: 700; }
.sample-list {
    margin: 0; padding: 0; list-style: none;
    border: 1px solid var(--line); border-radius: 10px;
    background: #f7f9fc; max-height: 160px; overflow: auto;
}
.sample-list li {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.sample-list li:last-child { border-bottom: 0; }
@media (max-width: 700px) {
    .crawl-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Dashboard */
.hero {
    display: grid;
    grid-template-columns: 1.35fr .9fr;
    gap: 14px;
    margin-bottom: 16px;
}
.hero-card {
    padding: 28px;
    border-radius: 16px;
    background: linear-gradient(145deg, #1a2334 0%, #24324a 55%, #2a3d5c 100%);
    color: #fff;
    border: 0;
    box-shadow: var(--shadow);
    min-height: 200px;
}
.hero-card .eyebrow {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,.1);
    color: #d7e0ef;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
}
.hero-card h2 {
    margin: 14px 0 8px;
    font-size: 26px;
    line-height: 1.3;
    font-weight: 700;
    color: #fff;
    max-width: 14em;
}
.hero-card p {
    margin: 0;
    color: rgba(255,255,255,.68);
    font-size: 14px;
    max-width: 36em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-actions .btn {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.12);
    color: #fff !important;
}
.hero-actions .btn-lime,
.hero-actions .btn-primary {
    background: #fff;
    border-color: #fff;
    color: #1a2334 !important;
}
.hero-actions .btn-lime:hover,
.hero-actions .btn-primary:hover {
    background: #eef2ff;
    color: #1a2334 !important;
}

.flow-card { padding: 22px; }
.flow-card h3 { margin: 0 0 14px; font-size: 15px; }
.flow-steps { list-style: none; margin: 0; padding: 0; }
.flow-steps li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    margin-bottom: 14px;
    align-items: start;
}
.flow-num {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px;
}
.flow-steps strong { display: block; font-size: 14px; margin-bottom: 2px; }
.flow-steps span { color: var(--muted); font-size: 12px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.stat {
    padding: 18px 18px 16px;
    border-top: 3px solid var(--accent);
}
.stat-kicker {
    font-size: 11px; color: var(--muted);
    font-weight: 700; letter-spacing: .06em;
}
.stat-num {
    margin-top: 8px;
    font-size: 28px; font-weight: 800;
    color: var(--text); letter-spacing: -.03em;
}
.stat-label { margin-top: 4px; color: var(--muted); font-size: 13px; }
.stat.success { border-top-color: var(--ok); }
.stat.success .stat-num { color: var(--ok); }
.stat.danger { border-top-color: var(--err); }
.stat.danger .stat-num { color: var(--err); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.region-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.region-row select { width: 100%; }
.crawl-panel,
.settings-panel,
.import-panel {
    width: 100%;
    max-width: none;
}
.region-box {
    margin: 14px 0 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f7f9fc;
}
.region-box-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}
.region-level {
    font-size: 12px; font-weight: 700;
    padding: 4px 8px; border-radius: 6px;
    background: #eef1f6; color: #5b6575;
}
.region-level.is-city { background: #eaf1ff; color: #2f6fed; }
.region-level.is-district { background: #e8f7ef; color: #14804a; }
.region-level.is-town { background: #fff3e0; color: #c56a00; }
.region-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (min-width: 1100px) {
    .region-steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.region-step-label {
    font-size: 12px; font-weight: 700; color: #738093; margin-bottom: 6px;
}
.region-step.is-required .region-step-label::after {
    content: "（必选）";
    color: #d14343;
}
.region-summary {
    margin-top: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
}
.region-summary code {
    background: #eef1f6; padding: 1px 6px; border-radius: 4px; font-size: 12px;
}
.precision-opt {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 12px 0 0; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fff; cursor: pointer; font-weight: 500;
}
.precision-opt input { margin-top: 3px; }
.precision-opt strong { color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip {
    border: 1px solid var(--line); background: #fff; color: var(--text);
    border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600;
    cursor: pointer;
}
.chip:hover { border-color: #93b4f8; color: #2f6fed; background: #eaf1ff; }

@media (max-width: 700px) {
    .region-row, .region-steps { grid-template-columns: 1fr; }
}

/* Filters / table */
.filters {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.master-search-panel { padding: 16px 18px; }
.master-search-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.master-search-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.master-search-main input[type="search"] {
    flex: 1 1 280px;
    min-width: 200px;
    min-height: 42px;
    font-size: 15px;
}
.master-search-extra {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.filters-master-more {
    grid-template-columns: 1fr 1fr auto;
}
@media (max-width: 900px) {
    .master-search-extra { grid-template-columns: 1fr 1fr; }
}
.list-meta {
    display: flex; justify-content: space-between;
    margin-bottom: 10px; color: var(--muted); font-size: 13px;
}

.table-shell { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td {
    text-align: left; padding: 13px 16px;
    border-bottom: 1px solid var(--line); vertical-align: middle;
}
.table th {
    background: #f7f9fc;
    color: #738093;
    font-size: 12px;
    font-weight: 700;
}
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-name { font-weight: 700; color: var(--text); }

.tag, .status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: #eef1f6;
    color: #4b5568;
}
.tag-wholesaler { background: #eaf1ff; color: #2f6fed; }
.tag-veg_wholesaler { background: #e8f7ef; color: #14804a; }
.tag-fresh { background: #e7f8f2; color: #0f766e; }
.tag-supermarket { background: #eef6ff; color: #2563eb; }
.tag-restaurant { background: #fff6e8; color: #c47d0e; }
.tag-unknown { background: #eef1f6; color: #6b7280; }
.status-success { background: #e8f7ef; color: var(--ok); }
.status-rejected { background: #fdecec; color: var(--err); }
.status-pending { background: #eef1f6; color: #5b6575; }
.status-following { background: #eaf1ff; color: #2f6fed; }
.status-callback { background: #fff6e8; color: var(--warn); }
.status-invalid { background: #f3eef8; color: #7c3aed; }

.kv-list { list-style: none; padding: 0; margin: 0; }
.kv-list li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid #f0f2f6; font-size: 14px;
}
.kv-list li:last-child { border-bottom: 0; }
.kv-list li span { color: var(--muted); }
.kv-list li strong { text-align: right; font-weight: 650; color: var(--text); }

.detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.detail-head h1 { margin: 0 0 8px; font-size: 24px; font-weight: 750; color: var(--text); }
.m-card-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.scope { white-space: pre-wrap; color: var(--muted); font-size: 13px; line-height: 1.55; }
.phone-link { font-size: 18px; font-weight: 800; color: var(--text) !important; }
.kv-phones strong { text-align: right; }
.phone-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.phone-list .phone-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
}
.phone-list .phone-link em {
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: #eef4ff;
    padding: 1px 6px;
    border-radius: 999px;
}
.merchant-edit-form label { margin-top: 10px; }
.merchant-edit-form label:first-of-type { margin-top: 0; }
.edit-grid-2, .edit-grid-3 {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}
.edit-grid-2 { grid-template-columns: 1fr 1fr; }
.edit-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) {
    .edit-grid-2, .edit-grid-3 { grid-template-columns: 1fr; }
}
.call-phone-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 4px;
}
.btn-call-alt,
.dc-call-alt {
    background: #fff7ed !important;
    color: #c2410c !important;
    border: 1px solid #fdba74;
}
.dc-call-alt:hover { filter: brightness(.98); }

.field-label {
    display: block; margin: 14px 0 6px;
    font-size: 13px; font-weight: 600; color: #4b5568;
}
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.result-opt {
    display: flex; align-items: center; gap: 8px; margin: 0;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
    background: #fafbfd; font-weight: 600; cursor: pointer; font-size: 13px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 44px;
    box-sizing: border-box;
}
.result-opt input {
    width: 18px; height: 18px; min-height: 0; margin: 0; flex-shrink: 0;
    accent-color: var(--accent);
    pointer-events: none;
}
.result-opt span { pointer-events: none; }
.result-opt:active { transform: scale(.98); }
.result-opt.is-on,
.result-opt:has(input:checked) {
    border-color: #93b4f8;
    background: var(--accent-soft);
}
.inline-form {
    margin-top: 14px;
    display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end;
}
.inline-form label { grid-column: 1 / -1; margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }

.card-list { display: grid; gap: 10px; }
.m-card { display: block; padding: 16px; color: inherit !important; }
.m-card:hover { border-color: #c9d4e5; }
.m-card-title { font-weight: 750; margin-bottom: 6px; color: var(--text); }
.m-card-line { font-size: 13px; margin-top: 2px; }

.merchant-card-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.merchant-card {
    position: relative;
    display: flex;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.merchant-card:hover {
    border-color: #b8c7e0;
    box-shadow: 0 4px 14px rgba(31, 45, 72, .07);
}
.merchant-card-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    padding: 0;
    border-right: 1px solid #eef1f6;
    background: #fafbfd;
    cursor: pointer;
}
.merchant-card-link {
    display: flex;
    align-items: center;
    gap: 16px 22px;
    flex: 1;
    min-width: 0;
    padding: 16px 18px;
    min-height: 72px;
    color: inherit !important;
    text-decoration: none !important;
    cursor: pointer;
}
.merchant-card-main {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 360px;
}
.merchant-card .m-card-title {
    margin: 0 0 6px;
    padding: 0;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.4;
    color: var(--text);
}
.merchant-card-addr {
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
}
.merchant-card .m-card-meta {
    margin: 0;
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.merchant-card-phone,
.merchant-card-city {
    flex: 0 0 auto;
    min-width: 96px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.merchant-card-city {
    font-weight: 500;
    color: #4b5568;
}
.merchant-card-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
    padding: 12px 16px 12px 8px;
}
.merchant-card-push {
    flex: 0 0 auto;
    text-align: right;
    min-width: 88px;
}
.merchant-card-transfer,
.merchant-card-lock {
    display: flex;
    align-items: center;
    margin: 0;
}
.lock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-width: 64px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #c9d4e5;
    border-radius: 8px;
    background: #fff;
    color: #5b6472;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.lock-btn:hover {
    background: #f6f7f9;
    border-color: #9aa8bc;
}
.lock-btn.is-on {
    background: #fff4e8;
    border-color: #e8b87a;
    color: #9a5b10;
}
.lock-btn.is-on:hover {
    background: #ffedd5;
}
.lock-btn:disabled {
    opacity: .65;
    cursor: wait;
}
.transfer-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-width: 72px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #c9d4e5;
    border-radius: 8px;
    background: #fff;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
}
.transfer-btn:hover {
    background: #f3f7ff;
    border-color: var(--accent);
}
.transfer-btn-text {
    pointer-events: none;
}
.transfer-btn select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    border: 0;
    min-height: 0;
    font-size: 14px;
}
.transfer-box {
    margin-top: 8px;
    padding-top: 4px;
    border-top: 1px solid #eef1f6;
}
.transfer-form {
    align-items: end;
}
.merchant-card-empty {
    margin: 8px 0;
    padding: 20px;
}
@media (max-width: 900px) {
    .merchant-card-link {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .merchant-card-main {
        flex: 1 1 100%;
        max-width: none;
    }
    .merchant-card-side {
        width: 100%;
        margin-left: 0;
        padding: 0 12px 12px;
        justify-content: space-between;
        border-top: 1px solid #eef1f6;
    }
    .merchant-card-push {
        text-align: left;
    }
}
.batch-all-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}
.batch-all-label input {
    width: auto;
    min-height: 0;
    margin: 0;
}

/* ===== 外呼工作台（简洁手机端）===== */
.dk { max-width: 720px; margin: 0 auto; }
.dk-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin-bottom: 12px;
}
.dk-count { font-size: 14px; color: var(--muted); }
.dk-count b { color: var(--text); font-size: 20px; font-weight: 750; margin-left: 4px; }
.dk-clear { font-size: 13px; font-weight: 600; }

.dk-tabs {
    display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 0 0 14px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(21, 27, 38, .04);
    scrollbar-width: none;
}
.dk-tabs::-webkit-scrollbar { display: none; }
.dk-tab {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 14px;
    border-radius: 10px;
    background: #f3f5f9;
    border: 1px solid transparent;
    color: #5c6b82 !important;
    font-size: 13px; font-weight: 700;
    text-decoration: none !important;
}
.dk-tab em {
    font-style: normal;
    font-size: 12px;
    font-weight: 750;
    color: #8b95a8;
}
.dk-tab.is-on {
    background: var(--accent-soft);
    border-color: #c8daf8;
    color: var(--accent) !important;
}
.dk-tab.is-on em { color: var(--accent); }

.dk-search { margin-bottom: 12px; }
.dk-search input[type="search"] {
    min-height: 42px;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
}

.dk-list { display: grid; gap: 8px; }
.dk-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 14px 14px 16px;
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    color: inherit !important;
    text-decoration: none !important;
    transition: border-color .15s ease;
}
.dk-row:active { border-color: #c5d4f0; background: #fafcff; }
.dk-row-body { flex: 1; min-width: 0; }
.dk-row-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 8px; margin-bottom: 4px;
}
.dk-row-top h3 {
    margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35;
    color: var(--text); word-break: break-word;
}
.dk-chip {
    flex-shrink: 0;
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 700;
}
.dk-row-phone {
    font-size: 15px; font-weight: 700; color: #243044; letter-spacing: .01em;
}
.dk-row-sub {
    margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.4;
}
.dk-row-go {
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; min-height: 36px; padding: 0 12px;
    border-radius: 9px;
    background: var(--accent); color: #fff;
    font-size: 13px; font-weight: 700;
}
.dk-empty {
    padding: 40px 20px; text-align: center;
    background: #fff; border: 1px dashed var(--line); border-radius: 12px;
}
.dk-empty-lg { padding: 64px 24px; margin-top: 24px; }
.dk-empty strong { display: block; font-size: 18px; margin-bottom: 8px; }
.dk-empty p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.dk-one-meta {
    font-size: 12px; color: var(--muted); margin: 0 0 10px; font-weight: 600;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.dk-lock-tip {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 999px;
    background: #e8f7ef; color: #14804a;
    font-size: 11px; font-weight: 700;
}
.dk-one .dc-home { padding-bottom: 8px; }
.dialer-app .dc.dc-home {
    padding-bottom: calc(24px + 56px + env(safe-area-inset-bottom, 0px));
}

/* 外呼详情 */
.dc { max-width: 560px; margin: 0 auto; padding-bottom: 92px; }
.dc-back {
    display: inline-flex; align-items: center;
    min-height: 32px; margin-bottom: 12px;
    color: var(--muted) !important; font-size: 14px; font-weight: 600;
}
.dc-card {
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    padding: 18px 16px 16px;
    margin-bottom: 14px;
}
.dc-name {
    margin: 0 0 8px; font-size: 20px; font-weight: 750;
    line-height: 1.3; word-break: break-word;
}
.dc-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.dc-addr { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.dc-call {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 50px;
    border-radius: 12px;
    background: #ff7a1a; color: #fff !important;
    font-size: 17px; font-weight: 750;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(255, 122, 26, .28);
}
.dc-call:hover { color: #fff !important; background: #ed6a0c; }
.dc-alt { margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* 外呼端：微信分享卡片 */
.wx-share {
    margin: 12px 0 0;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.wx-share-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.wx-share-label { font-size: 14px; font-weight: 750; }
.wx-share-hint { font-size: 11px; color: var(--muted); }
.wx-chat {
    background: #ededed;
    border-radius: 10px;
    padding: 14px 12px;
}
.wx-bubble {
    max-width: 92%;
    margin-left: auto;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    position: relative;
}
.wx-bubble::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 12px;
    width: 0; height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #fff;
}
.wx-link-card {
    display: block;
    padding: 10px 10px 8px;
    color: inherit !important;
    text-decoration: none !important;
}
.wx-link-title {
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
    color: #111;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wx-link-main {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.wx-link-desc {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wx-link-thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 3px;
    background: #1aad19 center/cover no-repeat;
}
.wx-link-source { display: none; }
.wx-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.wx-share-actions .btn { min-height: 34px; }
.dc-no-tel {
    margin: 0; padding: 12px; border-radius: 10px;
    background: #fdecec; color: var(--err); font-size: 14px; font-weight: 600;
}
.dc-form {
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}
.dc-form .dc-label {
    display: block; margin: 0 0 8px;
    font-size: 13px; font-weight: 700; color: #4b5568;
}
.dc-form textarea {
    min-height: 72px; font-size: 16px; margin-bottom: 14px;
    width: 100%;
}
.dc-results {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin: 0 0 10px;
    position: relative;
    z-index: 5;
}
.dc-results-2 { grid-template-columns: 1fr 1fr; }
button.dc-opt {
    display: flex; align-items: center; justify-content: center;
    margin: 0; min-height: 52px; width: 100%;
    padding: 0 12px;
    border: 1px solid var(--line); border-radius: 12px;
    background: #f7f8fb;
    color: var(--text);
    font: inherit; font-weight: 750; font-size: 16px;
    cursor: pointer;
    -webkit-appearance: none; appearance: none;
    -webkit-tap-highlight-color: rgba(47, 111, 237, .15);
    touch-action: manipulation;
    position: relative;
    z-index: 6;
}
button.dc-opt:active { transform: scale(.98); }
button.dc-opt.dc-opt-ok.is-on {
    border-color: #14804a;
    background: #e8f7ef;
    color: #14804a;
    box-shadow: inset 0 0 0 1px #14804a;
}
button.dc-opt.dc-opt-fail.is-on {
    border-color: #d14343;
    background: #fdecec;
    color: #d14343;
    box-shadow: inset 0 0 0 1px #d14343;
}
button.dc-opt.is-on {
    border-color: #2f6fed;
    background: #eaf1ff;
    color: #1f56c9;
}
.dc-result-tip {
    margin: 0 0 12px;
    color: var(--err);
    font-size: 13px;
    font-weight: 600;
}
.dc-submit {
    display: block !important;
    visibility: visible !important;
    margin-top: 4px;
    min-height: 50px !important;
    font-size: 16px !important;
    width: 100%;
    position: relative;
    z-index: 7;
}
.dc-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
    box-shadow: 0 -6px 20px rgba(21, 27, 38, .06);
}
.shell .dc-bar { left: var(--side); }
.dc-bar .btn { min-height: 48px; font-size: 16px; }
.dc-hist {
    margin-top: 16px; padding: 12px 14px;
    background: #fff; border: 1px solid #e8ecf2; border-radius: 12px;
}
.dc-hist summary {
    cursor: pointer; font-weight: 700; font-size: 14px;
    min-height: 34px; display: flex; align-items: center;
}
.dc-hist .timeline { margin-top: 8px; }

/* 外呼端 App：底部导航 */
.dialer-app .side,
.dialer-app .side-mask,
.dialer-app .icon-btn { display: none !important; }
.shell-dialer {
    display: block;
    min-height: 100vh;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.dialer-app .stage { width: 100%; min-width: 0; }
.dialer-app .main-dialer {
    padding: 12px 14px 88px;
    overflow: visible;
}
.dialer-app.dialer-call-page .shell-dialer {
    padding-bottom: 0;
}
.top-dialer {
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.top-dialer .top-copy h1 { font-size: 18px; }

.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 65;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid #e8ecf2;
    box-shadow: 0 -4px 16px rgba(21, 27, 38, .04);
}
.entry-app .tabbar {
    grid-template-columns: repeat(2, 1fr);
}
.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #8b95a8 !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 650;
    -webkit-tap-highlight-color: transparent;
}
.tabbar-ico {
    font-size: 18px;
    line-height: 1;
    font-style: normal;
}
.tabbar-item.is-on {
    color: var(--accent) !important;
}

.mine { max-width: 560px; margin: 0 auto; }
.mine-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 16px;
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    margin-bottom: 12px;
}
.mine-avatar {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
    font-size: 22px; font-weight: 750;
}
.mine-info strong { display: block; font-size: 18px; }
.mine-info span { color: var(--muted); font-size: 13px; }
.mine-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-bottom: 14px;
}
.mine-stats div {
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
}
.mine-stats b { display: block; font-size: 20px; font-weight: 750; }
.mine-stats span { font-size: 12px; color: var(--muted); }
.mine-link {
    display: flex; align-items: center;
    min-height: 48px; padding: 0 16px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    color: var(--text) !important;
    text-decoration: none !important;
    font-weight: 650; font-size: 15px;
}
.mine-exit { color: var(--err) !important; }

.dialer-app .main-dialer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* 外呼人员管理 */
.staff-create-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}
.staff-create-action { padding-bottom: 2px; }
.staff-list { display: grid; gap: 12px; }
.staff-card h2 { margin: 0; }
.staff-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}
.staff-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.staff-card-grid label { margin-top: 0; }
.staff-card-meta {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin: 0 0 12px;
    font-size: 12px; color: var(--muted);
}
@media (max-width: 980px) {
    .staff-create-grid,
    .staff-card-grid { grid-template-columns: 1fr; }
}

/* 推送面板 */
.push-panel h2 { margin: 0 0 6px; }
.push-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 14px;
}
.push-actions {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.btn-push-one {
    min-height: 44px;
    min-width: 120px;
    font-size: 15px;
}

/* 匹配信息中 */
.match-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(238, 241, 246, .92);
    backdrop-filter: blur(6px);
    transition: opacity .28s ease;
    pointer-events: auto;
}
.match-overlay.is-done {
    opacity: 0;
    pointer-events: none !important;
    visibility: hidden;
}
.match-card {
    text-align: center;
    padding: 28px 32px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-width: min(280px, 86vw);
}
.match-card strong {
    display: block;
    margin-top: 14px;
    font-size: 18px;
}
.match-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.match-spin {
    width: 36px; height: 36px; margin: 0 auto;
    border: 3px solid #d7e2f8;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: match-spin .8s linear infinite;
}
@keyframes match-spin { to { transform: rotate(360deg); } }

.import-overlay[hidden] { display: none !important; }
.import-overlay {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    background: rgba(238, 241, 246, .92);
    backdrop-filter: blur(6px);
}
.import-overlay-card {
    text-align: center;
    padding: 28px 32px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-width: min(280px, 86vw);
}
.import-overlay-card strong {
    display: block;
    margin-top: 14px;
    font-size: 18px;
}
.import-overlay-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.import-spin {
    width: 36px; height: 36px; margin: 0 auto;
    border: 3px solid #d7e2f8;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: match-spin .8s linear infinite;
}
body.is-importing { overflow: hidden; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pager a {
    min-width: 34px; text-align: center; padding: 6px 8px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--text) !important; font-weight: 600;
}
.pager a.active {
    background: var(--accent); border-color: var(--accent); color: #fff !important;
}

.desktop-only { display: block; }
.mobile-only { display: none; }

.settings-h2 {
    margin: 28px 0 12px; padding-top: 20px;
    border-top: 1px solid var(--line); font-size: 16px;
}
.guide-box {
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.guide-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.guide-list {
    margin: 0;
    padding-left: 20px;
    color: #4b5568;
    font-size: 13px;
    line-height: 1.7;
}
.guide-list li { margin-bottom: 6px; }
.guide-list a { word-break: break-all; }
.guide-list code {
    display: inline-block;
    margin-top: 2px;
    padding: 2px 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
    color: #334155;
    word-break: break-all;
}
.guide-ul { list-style: disc; }
.guide-ul ul { margin: 6px 0 0; padding-left: 18px; }
.key-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.test-result { margin-top: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.test-result.ok { background: #e8f7ef; color: var(--ok); }
.test-result.err { background: #fdecec; color: var(--err); }
.test-params { margin-top: 16px; }
.status-dot {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.status-dot.on { background: #e8f7ef; color: var(--ok); }
.status-dot.off { background: #eef1f6; color: var(--muted); }
.status-dot.lock { background: #fff4e8; color: #9a5b10; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Login */
.login-body { min-height: 100vh; background: var(--bg); }
.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
}
.login-visual {
    padding: 48px;
    display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(160deg, #151b26 0%, #1e2a3d 50%, #24344d 100%);
    color: #fff;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .logo-mark { width: 44px; height: 44px; font-size: 18px; }
.login-brand strong { display: block; font-size: 22px; font-weight: 750; }
.login-brand span { color: #93a0b5; font-size: 12px; }
.login-quote {
    margin: 0;
    font-size: 40px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -.03em;
    max-width: 7em;
}
.login-quote em {
    font-style: normal;
    color: #8eb2ff;
}
.login-foot {
    color: #93a0b5;
    max-width: 28em;
    line-height: 1.6;
    font-size: 14px;
}
.login-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 28px;
    background:
        radial-gradient(500px 280px at 100% 0%, #dfeaff 0%, transparent 55%),
        var(--bg);
}
.login-card {
    width: 100%; max-width: 400px;
    padding: 32px 28px;
}
.login-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 750;
    color: var(--text);
}
.login-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 20px;
    padding: 4px;
    background: #f0f3f8;
    border-radius: 12px;
}
.login-tab {
    display: flex; align-items: center; justify-content: center;
    min-height: 40px;
    border-radius: 10px;
    font-size: 14px; font-weight: 700;
    color: var(--muted) !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}
.login-tab.is-active {
    background: #fff;
    color: var(--text) !important;
    box-shadow: 0 1px 3px rgba(20, 30, 50, .08);
}
.login-switch { margin-top: 16px; text-align: center; }
.login-switch a {
    display: inline-block;
    padding: 6px 4px;
    font-weight: 700;
    min-height: 36px;
    line-height: 24px;
}
.auth-form .auth-submit { margin-top: 16px; min-height: 44px; }
.auth-form .auth-submit:disabled {
    opacity: .72;
    cursor: wait;
}
.pw-field {
    position: relative;
    display: block;
}
.pw-field input {
    padding-right: 64px;
}
.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    min-height: 36px;
    min-width: 52px;
    padding: 0 8px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.pw-toggle:hover,
.pw-toggle[aria-pressed="true"] { color: var(--accent); }

@media (min-width: 1400px) {
    :root { --side: 268px; }
    .stat-num { font-size: 32px; }
    .hero-card h2 { font-size: 30px; max-width: none; }
    .hero-card p { max-width: 48em; }
    .filters {
        grid-template-columns: 1.6fr repeat(4, minmax(120px, 1fr)) auto;
    }
}

@media (min-width: 1680px) {
    .stat-grid { gap: 16px; }
    .hero { gap: 18px; }
    .two-col, .detail-grid { gap: 18px; }
}

@media (max-width: 980px) {
    .side {
        position: fixed; left: 0; top: 0;
        transform: translateX(-105%);
        transition: transform .2s ease;
        width: min(280px, 86vw);
        box-shadow: 12px 0 40px rgba(0,0,0,.25);
    }
    body.nav-open .side { transform: translateX(0); }
    body.nav-open .side-mask { display: block; }
    .icon-btn { display: inline-flex; }
    .hero, .two-col, .detail-grid, .stat-grid, .login-screen { grid-template-columns: 1fr; }
    .login-visual {
        min-height: 0;
        padding: 22px 22px 18px;
        gap: 14px;
    }
    .login-quote { font-size: 22px; max-width: none; }
    .login-foot { display: none; }
    .login-panel { padding: 18px 14px 32px; align-items: flex-start; }
    .login-card { padding: 22px 18px; box-shadow: none; }
    .filters { grid-template-columns: 1fr 1fr; }
    .desktop-only { display: none !important; }
    .mobile-only { display: grid; }
    .main { padding: 12px 14px 40px; }
    .top { padding: 14px; background: #fff; border-bottom: 1px solid var(--line); }
    .key-row { grid-template-columns: 1fr; }
    .call-panel { position: sticky; bottom: 8px; z-index: 10; }
    .shell .dc-bar { left: 0; }
    .dialer-app .dc-bar { left: 0; }
    .top-copy p { display: none; }
}

/* ===== 手工端 / 端入口 ===== */
.entry-page {
    max-width: 440px;
    margin: 0 auto;
    padding: 8px 0 24px;
}
.entry-hero {
    margin-bottom: 18px;
    text-align: left;
}
.entry-hero h1 {
    margin: 0 0 6px;
    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.2;
}
.entry-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}
.entry-card {
    background: #fff;
    border: 1px solid #e8ecf2;
    border-radius: 16px;
    padding: 20px 18px 22px;
    box-shadow: 0 8px 24px rgba(21, 27, 38, .04);
}
.entry-field {
    margin-bottom: 16px;
}
.entry-field label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}
.entry-input,
.entry-form input,
.entry-card input[type="text"],
.entry-card input[type="tel"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid #d7dde8;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text);
    font-size: 17px !important; /* 避免 iOS 聚焦自动放大 */
    font-weight: 500;
    line-height: 1.3;
    -webkit-appearance: none;
    appearance: none;
}
.entry-input:focus,
.entry-card input:focus {
    outline: none;
    background: #fff;
    border-color: #7aa2f5;
    box-shadow: 0 0 0 4px rgba(47, 111, 237, .14);
}
.entry-submit {
    margin-top: 8px;
    min-height: 52px !important;
    font-size: 17px !important;
    font-weight: 750;
    border-radius: 12px;
}
.entry-app .entry-page {
    padding: 4px 2px 20px;
}
.entry-app .main-dialer {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.entry-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border, #e6e9ef);
}
.entry-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.entry-list-main {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}
.entry-list-main strong { font-size: 15px; }
.entry-list-main span { font-size: 14px; color: var(--text); }
.entry-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    align-items: center;
}
.portal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.portal-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--border, #e6e9ef);
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfcfe 0%, #f3f6fb 100%);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.portal-card:hover {
    border-color: #9eb6e0;
    transform: translateY(-1px);
}
.portal-card strong { font-size: 15px; font-weight: 750; }
.portal-card span { font-size: 12px; color: var(--muted); line-height: 1.45; }
@media (max-width: 860px) {
    .portal-grid { grid-template-columns: 1fr; }
}
