/* app.css —— 清爽科技感 · 无边框 · 统一圆角体系 */
:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #FBFCFE;
  --ink: #141A2E;
  --ink-2: #414963;
  --muted: #7A819B;
  --line: rgba(20, 20, 60, .05);
  --p1: #7C5CFF;
  --p2: #2BB3FF;
  --grad: linear-gradient(120deg, #7C5CFF 0%, #2BB3FF 100%);
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 3px rgba(20, 20, 60, .06);
  --shadow-lg: 0 12px 32px rgba(28, 24, 80, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.num, .mono { font-family: "SF Mono", "JetBrains Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }

a { color: inherit; text-decoration: none; }

.ico {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.ico.fill { fill: currentColor; stroke: none; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  flex: none;
  background: var(--surface);
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 16px;
  box-shadow: 0 4px 12px rgba(124, 92, 255, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; font-weight: 600; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background .18s, color .18s;
  cursor: pointer;
}
.nav-item:hover { background: #F3F2FF; color: var(--ink); }
.nav-item.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 92, 255, .26);
}
.nav-item .ico { opacity: .9; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FFF4E0;
  color: #B77400;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  align-self: flex-start;
}
.mode-chip i { width: 6px; height: 6px; border-radius: 50%; background: #E5A100; }
.mode-chip.live { background: #E8F8EE; color: #137A3E; }
.mode-chip.live i { background: #17A64F; }
.side-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 0 2px; }

.main { flex: 1; min-width: 0; padding: 20px 20px 104px; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 20px;
}
.title-block h1 { margin: 0 0 4px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.title-block p { margin: 0; font-size: 12.5px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }

.account-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  box-shadow: var(--shadow);
}
.account-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #C9CEE0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 15px;
  border: 0; border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 255, .26); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(124, 92, 255, .34); }
.btn-ghost { background: #F0F1F7; color: var(--ink-2); }
.btn-ghost:hover { background: #E8EAF3; }
.btn-ghost-light { background: rgba(255,255,255,.16); color: #fff; }
.btn-light { background: #fff; color: #4326C9; font-weight: 600; }
.btn-line { background: transparent; color: var(--p1); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn-danger { background: #FDEBEC; color: #B3222A; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm); background: #F3F4FA; color: var(--ink-2); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card.big { border-radius: var(--r-lg); }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.metric {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.metric .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric .value { font-size: 28px; font-weight: 600; margin-top: 10px; letter-spacing: -.02em; }
.metric .value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.metric .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.metric::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,.08), transparent 70%);
}

.chart-card { margin-top: 15px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.chart-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chart-head span { font-size: 12px; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 15px; height: 160px; padding: 0 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-col .bar-val { font-size: 11px; color: var(--muted); }
.bar {
  width: 100%;
  max-width: 46px;
  border-radius: var(--r-sm) var(--r-sm) 4px 4px;
  background: linear-gradient(180deg, #8F74FF 0%, #35B6FF 100%);
  min-height: 4px;
  transition: height .4s ease;
  box-shadow: 0 4px 10px rgba(124, 92, 255, .16);
}
.bar-col .bar-lab { font-size: 11.5px; color: var(--muted); }

/* ---------- 表格 ---------- */
.table-wrap { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 14px 16px; background: #FAFBFE;
  white-space: nowrap;
}
td {
  padding: 15px 16px;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #F8F9FE; }
td.title-cell { color: var(--ink); font-weight: 500; max-width: 380px; }
td.title-cell .sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 5px;
  background: #EEF0F6;
  cursor: pointer;
  position: relative;
  flex: none;
}
input[type="checkbox"]:checked { background: var(--grad); }
input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: 1.6px solid #fff; border-top: 0; border-left: 0;
  transform: rotate(40deg);
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-pending { background: #FFF4E0; color: #B77400; }
.badge-done { background: #E8F8EE; color: #137A3E; }
.badge-fail { background: #FDEBEC; color: #B3222A; }
.badge-style { background: #F1EFFF; color: #5B3BE8; }
.badge-soft { background: #F0F2F8; color: var(--ink-2); }

/* ---------- 筛选条 ---------- */
.filterbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 0 12px;
  height: 36px;
  box-shadow: var(--shadow);
  flex: 1; min-width: 200px; max-width: 320px;
}
.search .ico { width: 16px; height: 16px; color: var(--muted); }
.search input {
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--ink);
  width: 100%; height: 100%;
}
.search input::placeholder { color: #A8AEC2; }

select, .select {
  height: 36px;
  border: 0; outline: 0;
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 0 12px;
  font-family: inherit; font-size: 13px; color: var(--ink-2);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.seg { display: flex; background: var(--surface); border-radius: var(--r-sm); padding: 3px; box-shadow: var(--shadow); }
.seg button {
  border: 0; background: transparent; font-family: inherit;
  font-size: 12.5px; color: var(--muted); padding: 6px 12px;
  border-radius: 6px; cursor: pointer;
}
.seg button.on { background: var(--grad); color: #fff; }

/* ---------- 批量条 ---------- */
.batchbar {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 80px);
  background: linear-gradient(120deg, #2A1E5C 0%, #1E2A55 100%);
  color: #fff;
  border-radius: 999px;
  padding: 10px 12px 10px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform .28s cubic-bezier(.22,1,.36,1), opacity .2s;
  z-index: 60;
}
.batchbar.show { transform: translate(-50%, 0); opacity: 1; }
.batch-count { font-size: 13px; }
.batch-count b { font-size: 16px; margin: 0 2px; }
.batch-sep { width: 1px; height: 18px; background: rgba(255,255,255,.16); }

/* ---------- 稿件详情 ---------- */
.detail-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.phone {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 18px 28px;
}
.phone-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.phone-head span { font-size: 11.5px; color: var(--muted); }
.pv-title { font-size: 19px; font-weight: 600; line-height: 1.45; margin: 0 0 12px; letter-spacing: -.01em; }
.pv-meta { display: flex; gap: 10px; font-size: 12px; color: #9AA1B5; margin-bottom: 16px; }
.pv-meta .nm { color: #5B6B8C; }
.pv-body { font-size: 15px; line-height: 1.85; color: #2C3142; }
.pv-body h2 { font-size: 16px; font-weight: 600; margin: 22px 0 10px; padding-left: 10px; border-left: 3px solid var(--p1); }
.pv-body p { margin: 0 0 14px; }
.pv-cover { width: 100%; border-radius: 8px; margin-bottom: 16px; display: block; }

.editor-card { position: sticky; top: 0; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  border: 0; outline: 0;
  background: #F7F8FC;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  line-height: 1.6;
  transition: box-shadow .2s;
}
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 2px rgba(124,92,255,.22); }
.field textarea { resize: vertical; min-height: 260px; font-family: "SF Mono", Consolas, monospace; font-size: 12.5px; }

/* ---------- 空态 ---------- */
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty h3 { margin: 12px 0 6px; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.empty p { margin: 0; font-size: 12.5px; }

/* ---------- 模态 ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(16, 18, 40, .34);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 80;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff;
  border-radius: var(--r-lg);
  width: 100%; max-width: 520px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform .22s;
  max-height: 88vh; overflow: auto;
}
.overlay.show .modal { transform: translateY(0); }
.modal h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.modal .desc { margin: 0 0 20px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- 进度 ---------- */
.progress-wrap { margin: 18px 0 6px; }
.progress-track { height: 6px; background: #F0F1F7; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .25s; }
.progress-text { font-size: 12px; color: var(--muted); margin-top: 10px; display: flex; justify-content: space-between; }
.push-list { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.push-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.push-row .st { margin-left: auto; font-size: 11.5px; }
.push-row.ok .st { color: #137A3E; }
.push-row.bad .st { color: #B3222A; }
.push-row.skip .st { color: #7A819B; }
.push-row.skip span:nth-child(2) { color: #9AA1B5; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: 24px;
  transform: translate(-50%, -16px);
  background: #1E2340; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #B3222A; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.settings-grid .card { display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.card-sub { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.hint-box {
  background: #FFF9EC;
  color: #8A6412;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.7;
}
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.switch {
  width: 44px; height: 26px; border-radius: 999px;
  background: #E6E8F1; position: relative; cursor: pointer; transition: background .2s;
}
.switch i {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.16);
}
.switch.on { background: var(--grad); }
.switch.on i { left: 21px; }
.switch.disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: 1fr; }
  .editor-card { position: static; }
  .phone { max-width: 400px; }
  .col-time { display: none; }
  th, td { padding: 13px 12px; }
  td.title-cell { max-width: 320px; }
  .table-wrap { overflow-x: hidden; }
}
.table-wrap { overflow-x: auto; }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }

  /* 侧栏转顶部横条，保证手机上能翻页 */
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    padding: 10px 15px 12px; gap: 10px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(20, 20, 60, .05);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { padding: 8px 12px; white-space: nowrap; font-size: 13px; }
  .nav-item .ico { width: 16px; height: 16px; }
  .main { padding: 16px 15px 96px; }

  .topbar { flex-wrap: wrap; gap: 12px; }
  .title-block h1 { font-size: 19px; }
  .top-actions { width: 100%; justify-content: flex-end; }
  .account-chip { display: none; }
  .btn { white-space: nowrap; }

  .bar-col .bar-lab { white-space: nowrap; font-size: 10.5px; }
  .bars { gap: 8px; }
  .col-media { display: none; }
  .card { padding: 16px; }
  .batchbar { left: 15px; right: 15px; transform: translate(0, 80px); justify-content: flex-end; }
  .batchbar.show { transform: translate(0, 0); }
  .batch-sep { display: none; }

  /* 稿件表在手机上保留全部列，改为容器内横向滑动 */
  .scrollable { overflow-x: auto; }
  .scrollable table { min-width: 760px; }
}

@media (max-width: 430px) {
  .nav-item .ico { display: none; }
  .nav-item { padding: 8px 11px; }
  .nav { gap: 2px; }
}
