/* 后台管理 */
body { background: #f4f2ec; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 70% -10%, #2a2d35, #15171c 60%); }
.login-card { width: min(400px, 100%); background: var(--paper-2); border-radius: 18px; padding: 34px 34px 26px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.6); }
.login-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.login-card h1 { font-family: var(--serif); font-size: 26px; margin: 0 0 4px; }
.login-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 22px; }
.login-err { color: var(--brand); font-size: 12.5px; margin-top: 10px; min-height: 18px; }
.login-foot { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; font-size: 11.5px; color: var(--muted); }
.login-foot a { color: var(--brand); }

/* 框架 */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 224px; flex-shrink: 0; background: #16181d; color: #a9adb6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #f4f1e8; font-weight: 700; }
.side-name { font-family: var(--serif); font-size: 16px; letter-spacing: .02em; }
.side-nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  font-size: 13.5px; color: #a9adb6; position: relative;
}
.side-nav a span { width: 16px; text-align: center; opacity: .7; font-size: 13px; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.on { background: #2a2e37; color: #fff; font-weight: 600; }
.side-nav a.on span { opacity: 1; color: #e8b7a9; }
.side-group { font-size: 10.5px; letter-spacing: .16em; color: #5d626d; padding: 16px 12px 6px; }
.side-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); position: absolute; right: 12px; }
.side-foot { margin-top: auto; padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.side-foot a { color: #8f95a1; }
.side-foot a:hover { color: #fff; }
.who { display: flex; justify-content: space-between; margin-top: 10px; color: #6f7480; }
.who a { color: #8f95a1; }

.main { flex: 1; min-width: 0; }
.a-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 24px 30px 18px; border-bottom: 1px solid var(--line); background: #f7f5ef;
  position: sticky; top: 0; z-index: 20;
}
.a-crumb { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; margin-bottom: 2px; }
.a-top h1 { font-family: var(--serif); font-size: 23px; margin: 0; font-weight: 700; }
.a-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.a-view { padding: 24px 30px 60px; }

/* 按钮 */
.a-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-size: 13px;
  font-weight: 500; color: var(--ink-2); transition: .14s; white-space: nowrap;
}
.a-btn:hover { border-color: var(--ink-2); background: #fbfaf6; }
.a-btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.a-btn.dark:hover { background: #000; }
.a-btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.a-btn.brand:hover { background: var(--brand-2); }
.a-btn.danger { color: var(--brand); border-color: #e6c8c2; background: #fdf6f4; }
.a-btn.danger:hover { background: #f9e9e5; }
.a-btn.sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.a-btn[disabled] { opacity: .5; pointer-events: none; }

/* 卡片/统计 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  position: relative; overflow: hidden;
}
.stat .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1.3; margin-top: 4px; letter-spacing: -.01em; }
.stat .s { font-size: 11.5px; color: #9a9ea6; }
.stat .spark { position: absolute; right: 14px; top: 14px; font-size: 15px; opacity: .35; }
.stat.hl { background: #16181d; border-color: #16181d; }
.stat.hl .k, .stat.hl .s { color: #8f95a1; }
.stat.hl .v { color: #fff; }

.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; overflow: hidden; }
.panel-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-hd h3 { font-family: var(--serif); font-size: 15.5px; margin: 0; font-weight: 700; }
.panel-hd .hint { font-size: 11.5px; color: var(--muted); }
.panel-bd { padding: 18px; }
.panel-bd.flush { padding: 0; }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }

/* 表格 */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em;
  padding: 10px 12px; background: #faf9f4; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid #f1efe8; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fbfaf6; }
.tbl .t-title { font-weight: 600; color: var(--ink); display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .t-title:hover { color: var(--brand); }
.tbl .sub { font-size: 11.5px; color: var(--muted); }
.tbl .ops { display: flex; gap: 5px; justify-content: flex-end; white-space: nowrap; }
.tbl td.right, .tbl th.right { text-align: right; }
.tbl .chk { width: 34px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.b-published { background: #e6f4ec; color: #1f7a54; }
.b-pending { background: #fdf1dc; color: #9a6a1a; }
.b-offline { background: #eceef1; color: #6b707a; }
.b-ok { background: #e6f4ec; color: #1f7a54; }
.b-fail { background: #fbe9e6; color: #a5342a; }
.b-partial { background: #fdf1dc; color: #9a6a1a; }
.b-open { background: #fbe9e6; color: #a5342a; }
.b-resolved { background: #e6f4ec; color: #1f7a54; }
.b-processing { background: #fdf1dc; color: #9a6a1a; }
.b-rejected { background: #eceef1; color: #6b707a; }

/* 工具栏 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { height: 34px; width: auto; padding: 0 10px; font-size: 13px; }
.toolbar .search { width: 240px; }
.toolbar .spacer { flex: 1; }
.toolbar .count { font-size: 12px; color: var(--muted); }

/* 批量条 */
.batchbar {
  display: none; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 9px;
  background: #16181d; color: #fff; font-size: 12.5px; margin-bottom: 12px;
}
.batchbar.show { display: flex; }
.batchbar .a-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; height: 28px; }
.batchbar .a-btn:hover { background: rgba(255,255,255,.2); }

/* 分页 */
.page-bar { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.page-bar a, .page-bar span.pg { min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.page-bar a:hover { border-color: var(--ink-2); }
.page-bar .on { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-bar .dis { opacity: .35; pointer-events: none; }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 6px 4px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.chart .pv { font-family: var(--mono); font-size: 9.5px; color: #8b8f97; }
.chart .bar-area { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line-2); }
.chart .bar { width: 68%; max-width: 34px; background: linear-gradient(180deg, #c9573f, #8f2b21); border-radius: 4px 4px 2px 2px; min-height: 2px; transition: .3s; }
.chart .lbl { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart .bar:hover { filter: brightness(1.1); }
.dist { display: flex; flex-direction: column; gap: 10px; }
.dist .row { display: grid; grid-template-columns: 70px 1fr 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.dist .track { height: 7px; background: #eeebe2; border-radius: 99px; overflow: hidden; }
.dist .fill { height: 100%; border-radius: 99px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf6; transition: .15s; }
.quick b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.quick span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.quick:hover { border-color: var(--line-2); background: #fff; box-shadow: 0 6px 16px -10px rgba(21,23,28,.25); }

/* 表单/弹窗 */
.modal-lg { width: min(860px, 100%); }
.modal-mask .modal { position: relative; }
.m-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.m-head h3 { font-family: var(--serif); font-size: 19px; margin: 0; }
.m-head .x { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 15px; color: var(--muted); }
.m-body { max-height: 64vh; overflow: auto; padding-right: 4px; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field textarea.textarea { min-height: 90px; }
.field .input, .field .select { height: 38px; }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 16px; }
.check-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: #d9d5ca; position: relative; transition: .18s; outline: none; cursor: pointer; }
.switch input:checked { background: var(--green); }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .18s; }
.switch input:checked::after { left: 18px; }

/* 网盘编辑行 */
.nd-editor { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfaf6; }
.nd-row { display: grid; grid-template-columns: 108px 1fr 90px 28px; gap: 8px; margin-bottom: 8px; align-items: center; }
.nd-row .input, .nd-row .select { height: 34px; font-size: 12.5px; padding: 0 8px; }
.nd-row .del { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: #999; }
.nd-row .del:hover { color: var(--brand); border-color: #e6c8c2; }
.nd-help { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* 采集源 */
.src-list { display: flex; flex-direction: column; gap: 12px; }
.src-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 18px; align-items: center; }
.src-card:hover { border-color: var(--line-2); }
.src-main { min-width: 0; }
.src-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.src-line { font-size: 12px; color: var(--muted); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-line code { font-family: var(--mono); font-size: 11px; background: #f4f2ea; padding: 1px 6px; border-radius: 4px; }
.src-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px 16px; flex-wrap: wrap; line-height: 1.7; }
.src-status { font-size: 11.5px; color: #6e727c; margin-top: 6px; }
.src-status.err { color: #a5342a; }
.src-ops { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.src-ops .a-btn { justify-content: center; }
.type-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 1px 7px; border-radius: 4px; background: #eceff4; color: #4b5563; }
.type-tag.rss { background: #fdf0e2; color: #9a5b12; }
.type-tag.json { background: #e8f2fd; color: #1b5fa8; }
.type-tag.html { background: #eef0e6; color: #55622a; }

.preview-box { margin-top: 14px; border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; background: #faf9f4; font-size: 12.5px; }
.preview-box .pi { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.preview-box .pi:last-child { border: none; }
.preview-box .pi b { display: block; font-size: 13px; }
.preview-box .pi span { color: var(--muted); font-size: 11.5px; }

/* 空/加载 */
.a-empty { text-align: center; padding: 54px 20px; color: var(--muted); font-size: 13px; }
.a-empty .ico { font-size: 28px; opacity: .5; margin-bottom: 8px; }
.a-loading { padding: 50px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .side { width: 64px; }
  .side-name, .side-nav a:not(.on) span + *, .side-group, .side-foot { display: none; }
  .side-nav a { justify-content: center; font-size: 0; }
  .side-nav a span { font-size: 16px; }
  .a-view { padding: 18px 16px 50px; }
  .a-top { padding: 16px 16px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .nd-row { grid-template-columns: 96px 1fr 28px; }
  .nd-row .code { grid-column: 1 / -1; }
}