/* 极客外链 · 后台样式 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --border: #e7e9ee;
    --text: #1f2329;
    --muted: #8a919f;
    --primary: #07c160;
    --primary-dark: #06a552;
    --dark: #1b1f24;
    --dark-2: #22272e;
    --danger: #e5484d;
    --warn: #f5a623;
    --radius: 10px;
}

html, body { margin: 0; padding: 0; height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); outline: none; }
img { display: block; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 212px;
    flex: 0 0 212px;
    background: var(--dark);
    color: #c8ced8;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.logo {
    padding: 22px 20px 18px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
}
.logo span { color: var(--primary); }
.nav { flex: 1; padding: 6px 0; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #a8b0bd;
    border-left: 3px solid transparent;
    transition: .15s;
}
.nav-item:hover { background: var(--dark-2); color: #e6eaf0; }
.nav-item.active { background: var(--dark-2); color: #fff; border-left-color: var(--primary); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #4a5260; }
.nav-item.active .nav-dot { background: var(--primary); }
.nav-sep { height: 1px; background: #2b3138; margin: 10px 16px; }
.side-foot { padding: 14px 20px 20px; font-size: 12px; color: #6b7280; border-top: 1px solid #2b3138; }
.side-user { color: #e6eaf0; font-size: 13px; margin-bottom: 8px; word-break: break-all; }
.side-actions { display: flex; gap: 12px; }
.side-actions a { color: #8f98a6; cursor: pointer; }
.side-actions a:hover { color: #fff; }
.side-ver { margin-top: 10px; color: #5f6875; font-size: 11px; letter-spacing: .3px; }

.main { flex: 1; min-width: 0; padding: 22px 28px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.page-title { font-size: 20px; font-weight: 600; margin: 0; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------------- 通用组件 ---------------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 36px; padding: 0 16px; border-radius: 8px;
    border: 1px solid var(--border); background: #fff; cursor: pointer;
    transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cfd4dc; background: #fafbfc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: #f3c9ca; background: #fff5f5; }
.btn-danger:hover { background: #ffe9e9; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.input, .select, .textarea {
    width: 100%; height: 36px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7,193,96,.12); }
.field { margin-bottom: 16px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4e5969; margin-bottom: 7px; }
.field-label .req { color: var(--danger); }
.field-tip { font-size: 12px; color: var(--muted); margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; background: #f2f4f7; color: #4e5969; }
.chip-douyin { background: #fff1f3; color: #e3274b; }
.chip-kuaishou { background: #fff4e8; color: #e07b1a; }
.chip-xiaohongshu { background: #ffeef0; color: #d63b4a; }
.chip-channels { background: #eef6ff; color: #2a7de1; }
.chip-on { background: #eefaf0; color: var(--primary-dark); }
.chip-off { background: #f3f4f6; color: #8a919f; }
.chip-ban { background: #fff1f0; color: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; background: #fafbfc; }
tr:hover td { background: #fcfdfe; }
.table-wrap { overflow-x: auto; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------------- 概览 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }

/* ---------------- 卡片编辑 ---------------- */
.editor { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.form-section { margin-bottom: 22px; }
.form-section h3 { font-size: 14px; margin: 0 0 14px; padding-left: 9px; border-left: 3px solid var(--primary); line-height: 1; }
.preview-wrap { position: sticky; top: 22px; }
.phone {
    width: 320px; margin: 0 auto; border-radius: 22px; background: #10141a;
    padding: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.16);
}
.phone-screen { background: #f5f6f8; border-radius: 14px; overflow: hidden; min-height: 520px; }
.phone-inner { padding: 16px 14px 22px; }
.pv-cover { width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #e9edf2; margin-bottom: 12px; }
.pv-cover img { width: 100%; height: 100%; object-fit: cover; }
.pv-title { font-size: 16px; font-weight: 600; line-height: 1.45; margin: 0 0 6px; word-break: break-all; }
.pv-desc { font-size: 12px; color: #666; line-height: 1.6; margin: 0 0 16px; word-break: break-all; }
.pv-panel { background: #fff; border-radius: 10px; padding: 14px 12px; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.pv-label { font-size: 11px; color: #8a919f; text-align: center; margin-bottom: 4px; }
.pv-value { font-size: 17px; font-weight: 600; text-align: center; margin-bottom: 12px; word-break: break-all; }
.pv-qr { text-align: center; margin-bottom: 10px; }
.pv-qr img { width: 130px; height: 130px; margin: 0 auto; object-fit: contain; }
.pv-btn { display: block; width: 100%; padding: 12px; border-radius: 9px; color: #fff; font-size: 14px; font-weight: 600; text-align: center; border: 0; }
.pv-btn + .pv-btn { margin-top: 8px; }
.pv-btn-ghost { background: #fff; color: #1f2329; border: 1px solid #e3e6eb; }
.pv-tip { font-size: 11px; color: #8a919f; text-align: center; margin-top: 10px; }
.preview-tools { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* ---------------- 上传 ---------------- */
.uploader {
    display: flex; align-items: center; gap: 14px; padding: 12px;
    border: 1px dashed var(--border); border-radius: 10px; background: #fbfcfd;
}
.uploader-thumb { width: 92px; height: 58px; border-radius: 8px; overflow: hidden; background: #eef1f5; flex: 0 0 92px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.uploader-thumb img { width: 100%; height: 100%; object-fit: cover; }
.uploader-main { flex: 1; min-width: 0; }
.uploader-actions { display: flex; gap: 8px; margin-top: 8px; }
.uploader-hint { font-size: 12px; color: var(--muted); }

/* ---------------- 登录 ---------------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; background: linear-gradient(140deg, #1b1f24 0%, #2a313a 100%); }
.auth-box { width: 400px; max-width: 100%; background: #fff; border-radius: 16px; padding: 34px 32px 30px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.auth-logo { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-logo span { color: var(--primary); }
.auth-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 22px; margin-bottom: 22px; font-size: 15px; }
.auth-tabs a { color: var(--muted); cursor: pointer; padding-bottom: 6px; border-bottom: 2px solid transparent; }
.auth-tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.auth .btn-primary { width: 100%; height: 42px; font-size: 15px; margin-top: 6px; }
.auth-foot { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------------- 提示 ---------------- */
.toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item { background: rgba(31,35,41,.92); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: fadein .18s; }
.toast-item.err { background: rgba(229,72,77,.96); }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 120; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 420px; max-width: 100%; padding: 24px 24px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 18px; font-size: 17px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.notice-bar { background: #fffbe6; border: 1px solid #ffe8a3; color: #8a6d3b; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.notice-bar b { margin-right: 8px; }

.empty { text-align: center; padding: 46px 10px; color: var(--muted); font-size: 13px; }

.tutorial-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tutorial-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.tutorial-item h4 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.tutorial-item .muted { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.tutorial-item .btn { margin-right: 8px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); background: #fff; border: 1px solid var(--border); }
.tab.active { color: #fff; background: var(--dark); border-color: var(--dark); }

.chart-box { width: 100%; height: 240px; position: relative; }
.chart-box canvas { width: 100%; height: 100%; display: block; }

.url-box { display: flex; gap: 8px; align-items: center; }
.url-box .input { background: #fafbfc; font-family: Consolas, Monaco, monospace; font-size: 12px; }

@media (max-width: 1100px) {
    .editor { grid-template-columns: 1fr; }
    .preview-wrap { position: static; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: relative; }
    .nav { display: flex; overflow-x: auto; padding: 0 8px 8px; }
    .nav-item { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 10px 12px; }
    .nav-item.active { border-left: 0; border-bottom-color: var(--primary); }
    .nav-sep, .nav-dot { display: none; }
    .side-foot { display: none; }
    .main { padding: 16px; }
}

.tutorial-steps { margin: 0 0 12px; padding-left: 18px; font-size: 12.5px; line-height: 1.75; color: #4a5260; }
.tutorial-steps li { margin-bottom: 6px; }

/* ---------- 二维码海报（V1.9） ---------- */
.qr-stage { display: flex; justify-content: center; padding: 18px 0 6px; }
.qr-poster {
    width: 300px; border-radius: 18px; padding: 20px 16px 22px;
    background: linear-gradient(180deg, #eafbf0 0%, #d8f3e2 100%);
    box-shadow: 0 10px 30px rgba(60,140,90,.16);
    text-align: center;
}
.qp-cap {
    background: linear-gradient(90deg, #a9e34b, #6fd33c);
    color: #fff; font-size: 19px; font-weight: 700; letter-spacing: 1px;
    padding: 13px 8px; border-radius: 999px; margin-bottom: 14px;
}
.qp-frame {
    background: #fff; border: 3px solid #d6ecc8; border-radius: 14px;
    padding: 12px; display: flex; justify-content: center;
}
.qp-frame #qrBox { width: 200px; height: 200px; }
.qp-frame #qrBox canvas, .qp-frame #qrBox img { width: 200px !important; height: 200px !important; }
.qp-arrow {
    width: 0; height: 0; margin: 0 auto; border-left: 9px solid transparent;
    border-right: 9px solid transparent; border-bottom: 10px solid #e7f9dc;
}
.qp-tip {
    background: #e7f9dc; color: #3f7a1e; font-size: 14px; font-weight: 600;
    padding: 12px 8px; border-radius: 999px; margin-top: -1px;
}
