/* 蔚蓝时代官网后台 — 与主站同风格 */
:root {
    --blue: #0a5cff; --blue-dark: #0847c4; --blue-light: #e8f0ff;
    --ink: #0e0f13; --ink-2: #16181f;
    --steel: #4a5261; --steel-2: #8b93a3;
    --line: #e8eaef; --line-2: #d6dae2;
    --bg: #f5f6f8; --radius: 8px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); font-size: 14px; }
a { color: var(--blue); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); }
.login-card { width: 380px; background: #fff; border-radius: 12px; padding: 40px 36px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 20px; margin-top: 10px; letter-spacing: -.3px; }
.login-logo p { font-size: 12px; color: var(--steel-2); letter-spacing: 2px; margin-top: 4px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; color: var(--steel); margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 6px; }
.login-card input:focus { outline: none; border-color: var(--blue); }
.btn-primary { width: 100%; margin-top: 20px; padding: 12px; background: var(--blue); color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.login-err { color: #d33; font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }
.login-note { font-size: 11.5px; color: var(--steel-2); text-align: center; margin-top: 16px; line-height: 1.6; }

/* ---------- 框架 ---------- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: rgba(255,255,255,.75); padding: 18px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 10px; }
.side .brand b { color: #fff; font-size: 15px; }
.side .brand small { display: block; color: rgba(255,255,255,.4); font-size: 10.5px; letter-spacing: 1px; }
.side .group { font-size: 11px; letter-spacing: 1.5px; color: rgba(255,255,255,.35); padding: 14px 18px 6px; text-transform: uppercase; }
.side a.item { display: block; padding: 8px 18px; color: rgba(255,255,255,.72); font-size: 13.5px; border-left: 3px solid transparent; }
.side a.item:hover { color: #fff; background: rgba(255,255,255,.05); }
.side a.item.active { color: #fff; background: rgba(10,92,255,.18); border-left-color: var(--blue); }
.main { padding: 26px 34px 80px; max-width: 1080px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.topbar h2 { font-size: 21px; letter-spacing: -.3px; }
.topbar .acts { display: flex; gap: 10px; align-items: center; }
.btn { padding: 8px 16px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 600; color: var(--steel); }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: #c0392b; }
.btn.danger:hover { border-color: #c0392b; }
.btn:disabled { opacity: .55; cursor: wait; }

/* ---------- 编辑器 ---------- */
.searchbar { width: 100%; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); margin-bottom: 18px; }
.searchbar:focus { outline: none; border-color: var(--blue); }
.sec-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; cursor: pointer; user-select: none; }
.sec-head:hover { background: #fafbfc; }
.sec-head h3 { font-size: 14.5px; }
.sec-head .n { font-size: 12px; color: var(--steel-2); }
.sec-body { border-top: 1px solid var(--line); padding: 6px 18px 14px; display: none; }
.sec-card.open .sec-body { display: block; }
.unit { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.unit:last-child { border-bottom: none; }
.unit .lbl { font-size: 12px; color: var(--steel-2); padding-top: 8px; word-break: break-all; }
.unit .lbl .tag { display: inline-block; background: var(--blue-light); color: var(--blue); font-size: 10.5px; padding: 1px 6px; border-radius: 3px; margin-bottom: 4px; }
.unit .fields { display: flex; flex-direction: column; gap: 8px; }
.unit .fields .row { display: flex; gap: 8px; align-items: center; }
.unit .fields .row .flag { font-size: 11px; color: var(--steel-2); width: 24px; flex: none; text-align: center; }
.unit input[type=text], .unit textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; }
.unit textarea { min-height: 64px; resize: vertical; font-size: 13px; }
.unit textarea.html { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #fbfbfd; }
.unit input:focus, .unit textarea:focus { outline: none; border-color: var(--blue); }
.unit .save-col { padding-top: 4px; }
.unit.dirty input, .unit.dirty textarea { border-color: #e8a33d; }
.thumb-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.thumb-row img { width: 84px; height: 60px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #f0f1f4; flex: none; }
.thumb-row img:not([src]) { visibility: hidden; }
.thumb-row .path { font-size: 12px; color: var(--steel); word-break: break-all; flex: 0 1 auto; max-width: 420px; }
.thumb-row .btn { flex: none; }
.hint { font-size: 11.5px; color: #b26a00; background: #fff8e8; padding: 4px 8px; border-radius: 4px; }

/* ---------- 媒体库 ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; }
.media-item:hover { border-color: var(--blue); transform: translateY(-2px); }
.media-item .pv { aspect-ratio: 4/3; background: #f0f1f4 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--steel-2); font-size: 26px; position: relative; }
.media-item .play-badge { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(10,14,24,.72); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; padding-left: 2px; }
.media-item .nm { padding: 7px 9px; font-size: 11px; color: var(--steel); word-break: break-all; }
.media-item .nm small { color: var(--steel-2); }
.upload-zone { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--steel-2); margin-bottom: 18px; background: #fff; }
.upload-zone.drag { border-color: var(--blue); background: var(--blue-light); }

/* ---------- 表单页(新闻/设置/密码) ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--steel); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 6px; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); }
.field .sub { font-size: 11.5px; color: var(--steel-2); margin-top: 4px; }
.list-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-table th { text-align: left; font-size: 12px; color: var(--steel-2); padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.list-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-table tr:last-child td { border-bottom: none; }
.cat-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 3px; background: var(--blue-light); color: var(--blue); }

/* ---------- 板块管理:精细卡片行 ---------- */
.card-row { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.card-row:hover { border-color: var(--line-2); }
.card-row.open { border-color: var(--blue); box-shadow: 0 6px 22px rgba(10,92,255,.08); }
.card-row .head { display: flex; align-items: center; gap: 12px; padding: 9px 12px; }
.card-row .idx { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--steel-2); font-size: 11.5px; display: flex; align-items: center; justify-content: center; flex: none; }
.card-row .ct { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #f0f1f4; flex: none; }
.card-row .ct.ph { display: inline-block; }
.card-row .cl { flex: 1; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row .ops { display: flex; gap: 6px; flex: none; }
.mini { padding: 5px 10px; border-radius: 5px; border: 1px solid var(--line-2); background: #fff; font-size: 12px; font-weight: 600; color: var(--steel); transition: border-color .15s, color .15s, background .15s; }
.mini:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.mini.danger:hover { border-color: #c0392b; color: #c0392b; }
.mini:disabled { opacity: .35; cursor: default; }
.card-row .editor { display: none; border-top: 1px solid var(--line); padding: 4px 16px 12px; background: #fbfcfe; }
.card-row.open .editor { display: block; animation: vfade .22s ease both; }

/* 后台视图切换渐入 */
@keyframes vfade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.main .topbar, .main .panel, .main .sec-card, .main .list-table, .main .media-grid, .main .upload-zone, .main .searchbar { animation: vfade .22s ease both; }

/* ---------- 弹层/提示 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(10,14,24,.55); z-index: 100; display: none; align-items: center; justify-content: center; padding: 30px; }
.modal-mask.open { display: flex; }
.modal-box { background: #fff; border-radius: 10px; width: min(880px, 100%); max-height: 84vh; display: flex; flex-direction: column; }
.modal-box .mh { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal-box .mh h3 { font-size: 15px; }
.modal-box .mb { padding: 18px 20px; overflow-y: auto; }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: tin .2s ease; }
.toast.err { background: #c0392b; }
.toast.ok { background: #1e8e4e; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.empty { text-align: center; color: var(--steel-2); padding: 40px 0; }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; }
    .main { padding: 18px; }
    .unit { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
