/* 永恒之塔怀中怀行情 · 后台管理样式（与前台同一套深色/金色视觉） */

:root {
    --bg:          #070b18;
    --panel:       rgba(18, 27, 50, 0.78);
    --panel-solid: #121b32;
    --line:        rgba(120, 152, 214, 0.18);
    --line-strong: rgba(140, 175, 240, 0.34);
    --text:        #e8eefc;
    --muted:       #93a4c6;
    --gold:        #e9c46a;
    --gold-dim:    rgba(233, 196, 106, 0.14);
    --up:          #ff6b81;
    --down:        #2fd18a;
    --blue:        #5b9bff;
    --radius:      16px;
    --radius-sm:   10px;
    --shadow:      0 18px 44px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.adm-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(1100px 520px at 12% -10%, rgba(91, 155, 255, 0.14), transparent 60%),
        radial-gradient(900px 480px at 90% 0%, rgba(233, 196, 106, 0.10), transparent 62%);
    z-index: 0;
}

.adm-wrap { width: min(1180px, 94vw); margin: 0 auto; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: rgba(120, 152, 214, 0.12);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 12.5px;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.dim { color: var(--muted); }
.ok { color: var(--down); }
.warn { color: var(--gold); }
.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 顶栏 ---------------- */

.adm-header {
    position: relative;
    z-index: 2;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 11, 24, 0.86);
    backdrop-filter: blur(8px);
}
.adm-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.adm-header h1 { margin: 0; font-size: 19px; letter-spacing: 0.5px; }
.adm-sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.adm-header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.adm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--line-strong);
}
.adm-badge.on  { color: var(--down); background: rgba(47, 209, 138, 0.10); }
.adm-badge.off { color: var(--muted); background: rgba(120, 152, 214, 0.10); }

/* ---------------- 主体 ---------------- */

.adm-main { position: relative; z-index: 1; padding: 22px 0 40px; display: grid; gap: 18px; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
}
.card-narrow { max-width: 460px; }
.card-plain { background: rgba(18, 27, 50, 0.5); }
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.card-head h2 { margin: 0; }

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13.5px;
    border: 1px solid var(--line-strong);
}
.alert-ok   { background: rgba(47, 209, 138, 0.10); color: #b7f4d6; border-color: rgba(47, 209, 138, 0.35); }
.alert-warn { background: rgba(233, 196, 106, 0.12); color: #ffe6ae; border-color: rgba(233, 196, 106, 0.38); }

.facts { margin: 0; padding-left: 18px; color: var(--muted); }
.facts li { margin: 6px 0; }
.facts b { color: var(--text); }

.code {
    margin: 12px 0 8px;
    padding: 12px 14px;
    background: #0a1022;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: #cfe0ff;
}

/* ---------------- 表单 ---------------- */

.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.field input[type="text"],
.field input[type="password"],
.field input[type="file"] {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: rgba(7, 11, 24, 0.75);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
}
.field input:focus { outline: 2px solid rgba(91, 155, 255, 0.45); outline-offset: 1px; }
.file-field { margin-top: 10px; }
.file-field input { padding: 7px 10px; }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 10px 0; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--gold); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: rgba(120, 152, 214, 0.12);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
}
.btn:hover { background: rgba(120, 152, 214, 0.22); }
.btn-primary {
    background: linear-gradient(180deg, #f0d489, #e9c46a);
    color: #241c05;
    border-color: rgba(233, 196, 106, 0.7);
    font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.adm-inline { display: inline-flex; }

/* ---------------- 状态卡 ---------------- */

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 8px 0 16px;
}
.stat {
    background: rgba(7, 11, 24, 0.55);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: grid;
    gap: 4px;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 600; letter-spacing: 0.4px; }
.stat-value.small { font-size: 13.5px; font-weight: 500; }
.stat-foot { font-size: 12px; color: var(--muted); }

.src-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.src-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    border: 1px solid var(--line-strong);
    background: rgba(7, 11, 24, 0.55);
}
.src-chip.on  { color: var(--down); }
.src-chip.off { color: var(--muted); }
.src-chip em { font-style: normal; color: var(--muted); font-size: 11.5px; }

/* ---------------- 表格 ---------------- */

.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th,
.adm-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.adm-table th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
.adm-table .empty { text-align: center; color: var(--muted); padding: 22px; }

/* ---------------- 开关 ---------------- */

.toggle-row { display: grid; gap: 12px; margin: 12px 0 16px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: rgba(120, 152, 214, 0.22);
    border: 1px solid var(--line-strong);
    transition: background 0.18s ease;
}
.switch-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #cfd8ea;
    transition: transform 0.18s ease;
}
.switch input:checked + .switch-ui { background: rgba(47, 209, 138, 0.55); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); background: #eafff5; }
.switch input:focus-visible + .switch-ui { outline: 2px solid rgba(91, 155, 255, 0.6); outline-offset: 2px; }
.switch-text { display: grid; gap: 1px; }
.switch-text em { font-style: normal; color: var(--muted); font-size: 12px; }

/* ---------------- 广告位 ---------------- */

.ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 8px; }
.ad-edit {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: rgba(7, 11, 24, 0.5);
}
.ad-edit.is-off { opacity: 0.72; }
.ad-edit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.ad-preview {
    height: 92px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    overflow: hidden;
    margin-bottom: 12px;
    background: rgba(18, 27, 50, 0.5);
}
.ad-preview img { max-width: 100%; max-height: 92px; display: block; }
.ad-preview-empty { color: var(--muted); font-size: 12px; }

.ad-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------------- 页脚 ---------------- */

.adm-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--line);
    padding: 16px 0 28px;
    color: var(--muted);
    font-size: 12.5px;
}

@media (max-width: 620px) {
    .adm-header h1 { font-size: 17px; }
    .stat-value { font-size: 17px; }
    .card { padding: 16px; }
}
