/* 印记 · PC 超级后台 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #FF7A45;
    --primary-soft: #FFF2EC;
    --primary-deep: #EA6A34;
    --ink: #1A1D24;
    --ink2: #4A5160;
    --ink3: #8A93A3;
    --ink4: #AEB5C0;
    --line: #EDEFF3;
    --line2: #E3E7ED;
    --bg: #F6F7F9;
    --side: #15181E;
    --side2: #1C2028;
    --green: #12B76A;
    --amber: #F59E0B;
    --red: #F04438;
    --blue: #3B82F6;
    --violet: #8B5CF6;
    --r: 14px;
}

body {
    font: 13.5px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
button, input, select, textarea { font: inherit; outline: none; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.side {
    width: 228px; flex: none; background: var(--side); color: #A0A6B4;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.side::-webkit-scrollbar { width: 5px; }
.side::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.side-brand {
    display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.side-brand .lg {
    width: 32px; height: 32px; border-radius: 10px; flex: none;
    background: linear-gradient(150deg, #FF9F68, var(--primary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 15px;
}
.side-brand .nm { color: #fff; font-size: 14px; font-weight: 600; line-height: 1.3; }
.side-brand .sub { font-size: 10.5px; color: #6B7280; }

.nav { padding: 10px 0 20px; flex: 1; }
.grp {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 7px; font-size: 10.5px; letter-spacing: .06em;
    color: #5C6370; cursor: pointer; user-select: none; font-weight: 600;
}
.grp:hover { color: #8B93A3; }
.grp .ar { font-size: 8px; transition: transform .18s; }
.grp.closed .ar { transform: rotate(-90deg); }
.grp-body { overflow: hidden; transition: max-height .22s ease; }
.grp-body.closed { max-height: 0 !important; }

.nav a {
    display: flex; align-items: center; gap: 9px; padding: 8px 18px 8px 20px;
    font-size: 13px; color: #A0A6B4; border-left: 2px solid transparent;
    transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.04); color: #E5E7EB; }
.nav a.on {
    background: rgba(255,122,69,.13); color: #fff;
    border-left-color: var(--primary); font-weight: 500;
}
.nav a .ic { font-size: 14px; width: 18px; text-align: center; flex: none; }
.nav a .badge {
    margin-left: auto; font-size: 10px; background: var(--red); color: #fff;
    border-radius: 8px; padding: 1px 5px; font-weight: 600;
}

.side-foot {
    padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.06);
    font-size: 11px; color: #5C6370; display: flex; justify-content: space-between;
}

/* ---------------- 主区 ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
    height: 54px; background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; padding: 0 22px; gap: 14px;
    position: sticky; top: 0; z-index: 30;
}
.top h1 { font-size: 15.5px; font-weight: 600; letter-spacing: -.2px; }
.top .crumb { font-size: 12px; color: var(--ink3); }
.top .sp { flex: 1; }
.top .who {
    display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink2);
    padding: 5px 10px; border-radius: 9px; cursor: pointer;
}
.top .who:hover { background: var(--bg); }
.top .who .av {
    width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}

.page { padding: 20px 22px 60px; flex: 1; }

/* ---------------- 通用 ---------------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
    border-radius: 9px; border: 1px solid var(--line2); background: #fff;
    color: var(--ink2); font-size: 12.5px; cursor: pointer; transition: all .15s;
    white-space: nowrap;
}
.btn:hover { border-color: #CFD5DE; background: #FCFCFD; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.btn.pri:hover { background: var(--primary-deep); border-color: var(--primary-deep); }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { color: var(--red); border-color: #FBD5D2; }
.btn.danger:hover { background: #FEF3F2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.panel {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r);
    overflow: hidden; margin-bottom: 16px;
}
.panel .ph {
    display: flex; align-items: center; gap: 10px; padding: 13px 18px;
    border-bottom: 1px solid var(--line); background: #FCFCFD;
}
.panel .ph h3 { font-size: 13.5px; font-weight: 600; }
.panel .ph .r { margin-left: auto; font-size: 11.5px; color: var(--ink3); display: flex; gap: 8px; align-items: center; }
.panel .pb { padding: 16px 18px; }
.panel .pb.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1400px) { .g6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; } }

/* KPI */
.kpi {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r);
    padding: 15px 16px; position: relative; overflow: hidden;
}
.kpi .lb { font-size: 11.5px; color: var(--ink3); display: flex; align-items: center; gap: 5px; }
.kpi .vv { font-size: 23px; font-weight: 650; letter-spacing: -.6px; margin-top: 7px; line-height: 1.15; }
.kpi .vv small { font-size: 12px; font-weight: 400; color: var(--ink3); margin-left: 3px; }
.kpi .dt { font-size: 11.5px; margin-top: 6px; color: var(--ink3); display: flex; gap: 6px; align-items: center; }
.kpi .up { color: var(--red); }
.kpi .down { color: var(--green); }
.kpi .ico {
    position: absolute; right: 14px; top: 13px; font-size: 19px; opacity: .16;
}

/* 表格 */
table.tb { font-size: 12.8px; }
table.tb th {
    text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink3);
    padding: 9px 14px; background: #FCFCFD; border-bottom: 1px solid var(--line);
    white-space: nowrap; letter-spacing: .02em;
}
table.tb td { padding: 10px 14px; border-bottom: 1px solid #F5F6F8; vertical-align: middle; }
table.tb tr:last-child td { border-bottom: none; }
table.tb tbody tr:hover { background: #FCFCFD; }
table.tb tr.click { cursor: pointer; }
table.tb tr.sel { background: var(--primary-soft); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--ink3); }
.amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.amt.out { color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }

/* 标签 */
.tag {
    display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
    padding: 2px 7px; border-radius: 6px; background: var(--bg); color: var(--ink2);
    border: 1px solid var(--line); white-space: nowrap;
}
.tag.g { background: #ECFDF3; color: #027A48; border-color: #D1FADF; }
.tag.a { background: #FFFAEB; color: #B54708; border-color: #FEF0C7; }
.tag.r { background: #FEF3F2; color: #B42318; border-color: #FEE4E2; }
.tag.b { background: #EFF8FF; color: #175CD3; border-color: #D1E9FF; }
.tag.v { background: #F5F3FF; color: #5B21B6; border-color: #EDE9FE; }

/* 表单 */
.form { display: flex; flex-direction: column; }
.frow {
    display: flex; align-items: flex-start; gap: 18px; padding: 13px 0;
    border-bottom: 1px solid #F5F6F8;
}
.frow:last-child { border-bottom: none; }
.frow .lab { width: 210px; flex: none; padding-top: 3px; }
.frow .lab .t { font-size: 13px; font-weight: 500; }
.frow .lab .d { font-size: 11.5px; color: var(--ink3); margin-top: 2px; line-height: 1.5; }
.frow .ctl { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.inp, select.inp, textarea.inp {
    height: 32px; padding: 0 11px; border: 1px solid var(--line2); border-radius: 9px;
    font-size: 12.8px; color: var(--ink); background: #fff; width: 100%; max-width: 340px;
    transition: border-color .15s, box-shadow .15s;
}
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,122,69,.12); }
.inp.s { max-width: 120px; }
textarea.inp { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; max-width: 100%; }

.sw {
    width: 38px; height: 21px; border-radius: 11px; background: #DDE1E7; border: none;
    position: relative; cursor: pointer; transition: background .18s; flex: none;
}
.sw::after {
    content: ''; position: absolute; width: 17px; height: 17px; border-radius: 50%;
    background: #fff; top: 2px; left: 2px; transition: transform .18s;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.sw.on { background: var(--green); }
.sw.on::after { transform: translateX(17px); }
.swrow { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink3); }

/* 分面筛选 */
.facets {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    padding: 12px 18px; border-bottom: 1px solid var(--line); background: #FCFCFD;
}
.facets select, .facets input {
    height: 30px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 8px;
    font-size: 12.3px; background: #fff; color: var(--ink2);
}
.facets input { width: 190px; }
.facets .sp { flex: 1; }

/* 抽屉 */
.drawer-mask {
    position: fixed; inset: 0; background: rgba(16,24,40,.34); z-index: 80;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; top: 0; right: 0; width: 620px; max-width: 94vw; height: 100vh;
    background: #fff; z-index: 90; transform: translateX(100%); transition: transform .24s cubic-bezier(.3,.8,.3,1);
    display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(16,24,40,.12);
}
.drawer.on { transform: translateX(0); }
.drawer .dh {
    padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.drawer .dh h3 { font-size: 14.5px; font-weight: 600; }
.drawer .dh .x {
    margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: none;
    background: var(--bg); cursor: pointer; color: var(--ink3); font-size: 15px;
}
.drawer .db { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer .df { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

/* 其他 */
.empty { text-align: center; padding: 40px 0; color: var(--ink4); font-size: 12.5px; }
.note {
    background: #FCFCFD; border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 13px; font-size: 12px; color: var(--ink3); line-height: 1.7;
}
.note b { color: var(--ink2); }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #F0F2F5; font-size: 12.5px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--ink3); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }

.progress { height: 6px; border-radius: 4px; background: #F0F2F5; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }

.rank { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.rank .ic {
    width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center;
    justify-content: center; font-size: 13px; flex: none;
}
.rank .nm { flex: 1; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .bar { width: 90px; height: 5px; border-radius: 3px; background: #F0F2F5; overflow: hidden; }
.rank .bar i { display: block; height: 100%; border-radius: 3px; }
.rank .vv { width: 74px; text-align: right; font-size: 12.3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank .pc { width: 42px; text-align: right; font-size: 11.5px; color: var(--ink3); }

.toast {
    position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
    background: #1A1D24; color: #fff; font-size: 12.8px; padding: 10px 18px;
    border-radius: 10px; z-index: 200; opacity: 0; transition: all .22s;
    box-shadow: 0 8px 24px rgba(0,0,0,.2); pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 登录 */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: #14171C;
    background-image: radial-gradient(700px 400px at 20% 0%, rgba(255,122,69,.16), transparent 60%),
                      radial-gradient(600px 400px at 90% 100%, rgba(59,130,246,.12), transparent 55%);
}
.login-card {
    width: 360px; background: #fff; border-radius: 18px; padding: 30px 28px 26px;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.login-card .lg {
    width: 46px; height: 46px; border-radius: 14px; margin-bottom: 16px;
    background: linear-gradient(150deg, #FF9F68, var(--primary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 21px; font-weight: 700;
}
.login-card h2 { font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.login-card .sub { font-size: 12.5px; color: var(--ink3); margin: 4px 0 22px; }
.login-card .fld { margin-bottom: 12px; }
.login-card .fld label { font-size: 12px; color: var(--ink2); display: block; margin-bottom: 6px; }
.login-card .fld input {
    width: 100%; height: 38px; border: 1px solid var(--line2); border-radius: 10px;
    padding: 0 12px; font-size: 13.5px;
}
.login-card .fld input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,122,69,.13); }
.login-card .btn.pri { width: 100%; height: 38px; justify-content: center; margin-top: 8px; font-size: 13.5px; }
.login-card .err {
    background: #FEF3F2; color: #B42318; font-size: 12px; padding: 8px 11px;
    border-radius: 8px; margin-bottom: 12px;
}
.login-card .tip { font-size: 11.5px; color: var(--ink4); text-align: center; margin-top: 14px; }

/* 图表小件 */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars .b { flex: 1; background: var(--primary-soft); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.bars .b i { position: absolute; inset: 0; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .85; }

.heat { display: grid; grid-template-columns: 40px repeat(24, 1fr); gap: 2px; font-size: 9.5px; }
.heat .hd { color: var(--ink4); text-align: center; }
.heat .rl { color: var(--ink3); text-align: right; padding-right: 5px; line-height: 16px; }
.heat .c { height: 16px; border-radius: 2px; background: #F1F3F6; }

/* ================= 折叠设置区 / 外部 API / 外观预览 ================= */

.panel .ph .sp { flex: 1; }

.h5 { font-size: 12.5px; font-weight: 600; color: var(--ink2); }

/* 折叠面板 */
.sec {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r);
    margin-bottom: 12px; overflow: hidden;
}
.sec > summary {
    list-style: none; cursor: pointer; padding: 15px 20px;
    display: flex; align-items: center; gap: 11px;
    border-bottom: 1px solid transparent;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:hover { background: #FCFCFD; }
.sec[open] > summary { border-bottom-color: var(--line); }
.sec[open] > summary::after { content: '收起'; margin-left: auto; font-size: 11.5px; color: var(--ink4); }
.sec:not([open]) > summary::after { content: '展开'; margin-left: auto; font-size: 11.5px; color: var(--primary); }
.sec .si {
    width: 30px; height: 30px; border-radius: 9px; flex: none; background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.sec .st { font-size: 13.5px; font-weight: 600; }
.sec .sd { font-size: 11.5px; color: var(--ink3); flex: 1; min-width: 0; }

/* 外部 API 卡片 */
.api-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.api-card { display: flex; flex-direction: column; }
.api-card .ph h3 { display: flex; align-items: center; gap: 6px; }
.api-why {
    font-size: 12px; color: var(--ink3); line-height: 1.7; background: #FAFBFC;
    border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 4px;
}
.api-card .frow { padding: 9px 0; }
.api-card .frow .lab .t { font-size: 12.5px; }
.api-card .inp { max-width: 100%; font-size: 12.2px; }
.api-foot {
    display: flex; align-items: center; gap: 8px; padding: 12px 18px;
    border-top: 1px solid var(--line); background: #FCFCFD;
}
.api-foot .sp { flex: 1; }
.api-res { font-size: 11.5px; color: var(--ink4); max-width: 190px; text-align: right; line-height: 1.4; }
.api-res.ok { color: var(--green); }
.api-res.bad { color: var(--red); }

/* 有序步骤 */
.steps { margin: 0; padding-left: 20px; font-size: 12.8px; color: var(--ink2); line-height: 1.9; }
.steps li { margin-bottom: 4px; }
.steps li b { color: var(--ink); font-weight: 600; }

/* 引用块（工单详情） */
.quote {
    font-size: 13px; color: var(--ink); line-height: 1.8; background: #FAFBFC;
    border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; padding: 11px 14px;
    white-space: pre-wrap;
}

/* 主色预设 */
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 6px; }
.preset {
    text-align: left; background: #fff; border: 1.5px solid var(--line2); border-radius: 11px;
    padding: 10px 11px; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; gap: 3px;
}
.preset:hover { border-color: var(--ink4); }
.preset.on { border-color: var(--primary); background: var(--primary-soft); }
.preset .dot { width: 14px; height: 14px; border-radius: 5px; display: block; }
.preset .pn { font-size: 12.5px; font-weight: 600; }
.preset .pd { font-size: 10.5px; color: var(--ink3); line-height: 1.45; }

/* 手机预览 */
.phone {
    width: 268px; height: 540px; border-radius: 34px; background: #101318;
    padding: 9px; box-shadow: 0 18px 44px rgba(16,19,24,.24);
}
.ph-top {
    height: 30px; display: flex; align-items: center; justify-content: center;
    position: relative; background: #fff; border-radius: 26px 26px 0 0;
}
.ph-notch {
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 62px; height: 5px; border-radius: 4px; background: #E6E9EE;
}
.ph-title { font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.ph-body {
    --pv: #FF7A45; --pv-r: 18px;
    background: #F6F7F9; height: calc(100% - 30px); border-radius: 0 0 26px 26px;
    padding: 14px 12px; position: relative; overflow: hidden;
}
.ph-hero {
    background: var(--pv);
    background: linear-gradient(140deg, var(--pv), color-mix(in srgb, var(--pv) 62%, #fff));
    border-radius: var(--pv-r); padding: 15px 16px; color: #fff; margin-bottom: 12px;
}
.ph-hi { font-size: 10.5px; opacity: .88; }
.ph-big { font-size: 25px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; }
.ph-big small { font-size: 13px; font-weight: 500; opacity: .85; }
.ph-sub { font-size: 10px; opacity: .82; margin-top: 2px; }

.ph-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.ph-body[data-card="soft"] .ph-card { box-shadow: 0 2px 8px rgba(16,19,24,.07); border: none; }
.ph-body[data-card="flat"] .ph-card { box-shadow: none; border: none; }
.ph-body[data-card="outline"] .ph-card { box-shadow: none; border: 1px solid var(--line2); }
.ph-card {
    background: #fff; border-radius: var(--pv-r); padding: 9px 7px; text-align: center;
}
.ph-card .ph-ic { font-size: 15px; line-height: 1.3; }
.ph-card .ph-cn { font-size: 9.5px; color: var(--ink3); }
.ph-card .ph-amt { font-size: 10.5px; font-weight: 600; color: var(--ink); }

.ph-goal {
    background: #fff; border-radius: var(--pv-r); padding: 12px 13px;
}
.ph-body[data-card="soft"] .ph-goal { box-shadow: 0 2px 8px rgba(16,19,24,.07); }
.ph-body[data-card="outline"] .ph-goal { border: 1px solid var(--line2); }
.ph-gl { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 600; }
.ph-gl b { color: var(--pv); }
.ph-prog { height: 5px; border-radius: 4px; background: #F0F2F5; margin: 7px 0 5px; overflow: hidden; }
.ph-prog i { display: block; height: 100%; border-radius: 4px; background: var(--pv); }
.ph-gs { font-size: 9.5px; color: var(--ink3); }

.ph-fab {
    position: absolute; right: 16px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%;
    background: var(--pv); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 19px; box-shadow: 0 8px 18px rgba(26, 29, 36, .18);
}

@media (max-width: 1200px) {
    .api-grid { grid-template-columns: 1fr; }
    .presets { grid-template-columns: repeat(2, 1fr); }
}
