:root {
    --ink: #07110f;
    --ink-2: #0c1916;
    --panel: #11211d;
    --panel-2: #152923;
    --line: #2a4039;
    --paper: #eaf0e5;
    --muted: #9eaea7;
    --lime: #c8ff45;
    --coral: #ff765f;
    --amber: #ffd166;
    --blue: #7cd9ff;
    --shadow: 10px 10px 0 rgba(0, 0, 0, .28);
    --radius: 5px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ink); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--paper);
    background: var(--ink);
    font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.signal-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .22;
    background-image:
        linear-gradient(rgba(200,255,69,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200,255,69,.07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto minmax(100px, 1fr);
    align-items: center;
    gap: 24px;
    min-height: 78px;
    padding: 12px clamp(18px, 4vw, 64px);
    border-bottom: 1px solid var(--line);
    background: rgba(7,17,15,.96);
    backdrop-filter: blur(10px);
}
.topbar > form { justify-self: end; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; width: fit-content; }
.brand-mark {
    display: grid; place-items: center; width: 45px; height: 45px;
    color: var(--ink); background: var(--lime); border: 1px solid var(--lime);
    font-weight: 900; font-size: 18px; box-shadow: 4px 4px 0 #3b551f;
}
.brand strong { display: block; font-size: 13px; letter-spacing: .16em; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.nav { display: flex; align-items: center; gap: 5px; }
.nav a { padding: 9px 16px; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.nav a:hover { color: var(--paper); border-color: var(--line); }
.nav a.active { color: var(--ink); background: var(--paper); border-color: var(--paper); font-weight: 700; }

.page-shell { position: relative; z-index: 1; width: min(1500px, calc(100% - 36px)); margin: 0 auto; padding: 50px 0 72px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-heading h1 { margin: 2px 0 0; font-family: "Palatino Linotype", "STSong", serif; font-size: clamp(36px, 5vw, 66px); font-weight: 400; line-height: 1; letter-spacing: -.035em; }
.page-heading > p { width: min(440px, 100%); margin: 0; padding-bottom: 5px; color: var(--muted); }
.eyebrow { color: var(--lime); font-family: Consolas, monospace; font-size: 11px; letter-spacing: .24em; }

.panel { position: relative; padding: clamp(22px, 3vw, 38px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-index { position: absolute; top: 14px; right: 17px; color: rgba(200,255,69,.18); font-family: Georgia, serif; font-size: 50px; line-height: 1; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 26px; padding-right: 55px; }
.panel-head h2 { margin: 0 0 3px; font-family: "Palatino Linotype", "STSong", serif; font-size: 27px; font-weight: 400; }
.panel-head p { margin: 0; color: var(--muted); font-size: 13px; }
.compose-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); gap: 26px; align-items: start; }
.preview-panel { position: sticky; top: 102px; max-height: calc(100vh - 126px); overflow-y: auto; }
.split-layout { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr); gap: 26px; align-items: start; }
.detail-layout { grid-template-columns: minmax(300px, .6fr) minmax(0, 1.4fr); }
.settings-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.narrow-panel { width: min(760px, 100%); }

.stack-form { display: grid; gap: 11px; }
label { color: #dce5da; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.optional { margin-left: 7px; color: var(--muted); font-weight: 400; }
input, textarea, select {
    width: 100%; color: var(--paper); background: #091512; border: 1px solid #395048;
    border-radius: 3px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,255,69,.1); }
input::placeholder, textarea::placeholder { color: #64756e; }
.field-help { margin: -4px 0 5px; color: var(--muted); font-size: 12px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.counter { color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.check-row { display: flex; align-items: center; gap: 9px; width: fit-content; margin: 4px 0 8px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--lime); }
.prefix-field { display: grid; grid-template-columns: 40px 1fr; }
.prefix-field span { display: grid; place-items: center; color: var(--lime); background: #1b3029; border: 1px solid #395048; border-right: 0; }
.prefix-field input { border-radius: 0 3px 3px 0; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.form-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 16px;
    width: fit-content; min-height: 43px; padding: 10px 18px; border: 1px solid transparent;
    border-radius: 2px; cursor: pointer; text-decoration: none; font-weight: 800;
    transition: transform .12s, box-shadow .12s, background .12s;
}
.button:hover { transform: translate(-2px, -2px); }
.button:disabled { cursor: wait; opacity: .68; transform: none; }
.button.primary { color: var(--ink); background: var(--lime); box-shadow: 4px 4px 0 #3b551f; }
.button.danger { color: #1b0906; background: var(--coral); box-shadow: 4px 4px 0 #6e2c22; }
.button.ghost { color: var(--paper); background: transparent; border-color: var(--line); }
.button.ghost:hover { border-color: var(--paper); }
.button.compact { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.button.wide { width: 100%; }
.button-row { display: flex; gap: 12px; }
.text-danger { padding: 0; color: var(--coral); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.delete-form { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

.notice { position: relative; z-index: 2; display: flex; align-items: flex-start; gap: 12px; margin: 0 0 24px; padding: 14px 17px; color: var(--paper); background: var(--panel); border: 1px solid var(--line); }
.notice > span { display: grid; place-items: center; flex: 0 0 23px; height: 23px; border-radius: 50%; font-weight: 900; }
.notice.success { border-left: 4px solid var(--lime); }
.notice.success > span { color: var(--ink); background: var(--lime); }
.notice.error { border-left: 4px solid var(--coral); }
.notice.error > span { color: var(--ink); background: var(--coral); }

.empty-state { display: grid; place-items: center; min-height: 390px; text-align: center; color: var(--muted); }
.empty-state strong { margin-top: 20px; color: var(--paper); font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.empty-state p { max-width: 320px; margin: 5px auto; }
.compact-empty { min-height: 180px; }
.radar { position: relative; width: 105px; height: 105px; border: 1px solid #385047; border-radius: 50%; box-shadow: inset 0 0 0 27px rgba(200,255,69,.025); }
.radar::before, .radar::after { content: ""; position: absolute; background: #385047; }
.radar::before { top: 50%; left: -12px; width: 127px; height: 1px; }
.radar::after { left: 50%; top: -12px; width: 1px; height: 127px; }
.radar span { position: absolute; top: 27px; right: 23px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 15px var(--lime); }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 25px; }
.metric { padding: 14px; background: #0a1713; border: 1px solid var(--line); }
.metric strong { display: block; font-family: Georgia, serif; font-size: 32px; font-weight: 400; line-height: 1; }
.metric span { color: var(--muted); font-size: 11px; }
.metric.good strong { color: var(--lime); }
.metric.warn strong { color: var(--coral); }
.preview-section { margin: 23px 0; }
.preview-section h3 { margin: 0 0 9px; color: var(--muted); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.number-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.number-list > div, .reason-row { padding: 9px 11px; background: #0a1713; border-left: 2px solid var(--line); }
.number-list code, .reason-row code { display: block; color: var(--paper); font-size: 12px; word-break: break-all; }
.number-list small, .reason-row span { display: block; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.danger-zone .reason-row { border-left-color: var(--coral); }
.message-proof { margin: 22px 0; padding: 15px; color: #1d2c27; background: #e1e7dc; border-left: 5px solid var(--lime); }
.message-proof span { display: block; margin-bottom: 5px; color: #53635c; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.message-proof p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-proof.large { min-height: 140px; }
.confirmation-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

.template-list { display: grid; gap: 11px; }
.template-card { padding: 18px; background: var(--ink-2); border: 1px solid var(--line); }
.template-card-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.template-card h3 { margin: 0; font-family: Georgia, serif; font-size: 18px; font-weight: 400; }
.template-card > p { margin: 14px 0 0; color: #b9c6c0; white-space: pre-wrap; }
.status-dot { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.status-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.status-dot.on { color: var(--lime); }.status-dot.on::before { background: var(--lime); }
.status-dot.off { color: var(--muted); }.status-dot.off::before { background: var(--muted); }

.filter-bar { display: grid; grid-template-columns: minmax(200px, 1fr) 190px auto; gap: 10px; margin-bottom: 22px; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 12px; color: var(--muted); border-bottom: 1px solid #496057; text-align: left; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: rgba(200,255,69,.025); }
td small { display: block; max-width: 290px; margin-top: 3px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
td code, .technical-list code { color: var(--blue); font-family: Consolas, monospace; font-size: 11px; word-break: break-all; }
.number-emphasis { color: var(--lime); font-family: Georgia, serif; font-size: 25px; }
.row-link { color: var(--lime); white-space: nowrap; text-decoration: none; }
.status-badge { display: inline-flex; padding: 4px 8px; border: 1px solid currentColor; font-family: Consolas, monospace; font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.status-pending { color: var(--amber); }.status-accepted { color: var(--blue); }
.status-delivered { color: var(--lime); }.status-partial { color: var(--amber); }
.status-failed, .status-undelivered { color: var(--coral); }.status-unknown { color: #c6a9ff; }
.pagination { display: flex; gap: 6px; margin: 24px 0 0; padding: 0; list-style: none; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 34px; min-height: 34px; padding: 5px 9px; color: var(--muted); background: #0b1714; border: 1px solid var(--line); text-decoration: none; }
.pagination .active span { color: var(--ink); background: var(--lime); border-color: var(--lime); }

.batch-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 26px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.batch-summary > div { min-height: 105px; padding: 18px; border-right: 1px solid var(--line); }
.batch-summary > div:last-child { border: 0; }
.batch-summary span:first-child { display: block; margin-bottom: 12px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.batch-summary strong:not(.status-badge) { font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.batch-summary code { color: var(--blue); font-size: 11px; word-break: break-all; }
.technical-list { margin: 25px 0 0; }
.technical-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 15px; padding: 10px 0; border-top: 1px solid var(--line); }
.technical-list dt { color: var(--muted); font-size: 11px; }.technical-list dd { margin: 0; font-size: 12px; }

.copy-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 11px; background: #08120f; border: 1px solid var(--line); }
.copy-field code { color: var(--blue); font-size: 11px; overflow-wrap: anywhere; }
.callout { margin: 24px 0; padding: 18px; color: #14201c; background: var(--amber); }
.callout strong { font-family: Georgia, serif; font-size: 18px; }.callout p { margin: 6px 0 0; }.callout code { color: #441f15; }
.checklist { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.checklist > div { display: grid; grid-template-columns: 42px 1fr; gap: 10px; padding: 14px; background: var(--ink-2); }
.checklist > div > span { color: var(--lime); font-family: Consolas, monospace; }
.checklist p { margin: 0; color: var(--muted); font-size: 12px; }.checklist strong { display: block; color: var(--paper); }

.footer { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 20px; padding: 22px clamp(18px, 4vw, 64px); color: #6e8178; border-top: 1px solid var(--line); font-family: Consolas, monospace; font-size: 10px; letter-spacing: .1em; }
.muted { color: var(--muted); }

.auth-body { display: grid; place-items: center; padding: 30px 18px; }
.auth-card { position: relative; z-index: 1; width: min(460px, 100%); padding: clamp(30px, 6vw, 54px); background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--lime); box-shadow: 14px 14px 0 rgba(0,0,0,.35); }
.auth-card-wide { width: min(680px, 100%); }
.auth-kicker { display: flex; align-items: center; gap: 9px; color: var(--lime); font-family: Consolas, monospace; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.auth-kicker span { width: 24px; height: 1px; background: var(--lime); }
.auth-card h1 { margin: 18px 0 10px; font-family: "Palatino Linotype", "STSong", serif; font-size: clamp(42px, 10vw, 62px); font-weight: 400; line-height: .95; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); }
.auth-card .notice { margin-top: 20px; }
.auth-foot { margin-top: 25px; color: #72847b; font-size: 11px; text-align: center; }
pre { padding: 18px; overflow-x: auto; color: var(--lime); background: #07100e; border: 1px solid var(--line); }

@media (max-width: 1050px) {
    .compose-layout, .split-layout, .settings-layout, .detail-layout { grid-template-columns: 1fr; }
    .preview-panel { position: relative; top: auto; max-height: none; }
    .batch-summary { grid-template-columns: repeat(2, 1fr); }
    .batch-summary > div:nth-child(2) { border-right: 0; }
    .batch-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
    .topbar { position: relative; grid-template-columns: 1fr auto; gap: 12px; }
    .nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; justify-content: space-between; }
    .nav a { flex: 1; padding: 8px 10px; text-align: center; }
    .page-shell { width: min(100% - 24px, 1500px); padding-top: 34px; }
    .page-heading { align-items: start; flex-direction: column; }
    .page-heading h1 { font-size: 44px; }
    .panel { padding: 22px 17px; box-shadow: 6px 6px 0 rgba(0,0,0,.28); }
    .number-list { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr; }
    .batch-summary { grid-template-columns: 1fr; }
    .batch-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .batch-summary > div:last-child { border-bottom: 0; }
    .metric { padding: 11px; }.metric strong { font-size: 26px; }
    .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
