/* ============================================================
   软文通 · 运营后台样式 — 深色侧栏 + 翡翠绿运营风
   ============================================================ */
:root {
  --primary: #059669;
  --primary-dark: #047857;
  --secondary: #0D9488;
  --accent: #ECFDF5;
  --accent-strong: #A7F3D0;
  --bg: #F3F6F5;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --muted: #F1F5F9;
  --fg: #0F172A;
  --muted-fg: #64748B;
  --success: #16A34A;
  --warning: #EA580C;
  --danger: #EF4444;
  --r: 14px;
  --grad: linear-gradient(90deg, #059669, #0D9488);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 6px 16px rgba(15,23,42,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'PingFang SC','Microsoft Yahei',-apple-system,BlinkMacSystemFont,'Helvetica Neue',Arial,sans-serif;
  font-size: 14px; color: var(--fg); background: var(--bg); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--primary); }

/* ============ 整体布局 ============ */
.layout { display: flex; min-height: 100vh; }

/* ============ 侧边栏（深色导航） ============ */
.sidebar {
  width: 230px;
  background: linear-gradient(180deg, #0F1B2D 0%, #15263B 100%);
  border-right: 1px solid #1E293B;
  position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto;
  z-index: 20;
}
.sidebar .brand {
  height: 64px; display: flex; align-items: center; gap: 10px;
  padding: 0 22px; font-size: 18px; font-weight: 700; color: #F1F5F9;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.menu-group { padding: 8px 12px; }
.menu-group-title {
  padding: 14px 12px 6px; font-size: 11px; color: #5B6B82;
  text-transform: uppercase; letter-spacing: 1px; font-weight: 500;
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 2px;
  color: #94A3B8; border-radius: 9px;
  font-weight: 500; transition: all .15s ease;
}
.menu-item .icon { font-size: 15px; width: 18px; text-align: center; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #E2E8F0; }
.menu-item.active {
  background: rgba(16,185,129,.15); color: #34D399;
  font-weight: 600;
}
.menu-item.active .icon { color: #34D399; }

/* ============ 主区域 ============ */
.main { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-width: 0; }

/* 顶栏 */
.topbar {
  height: 64px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.topbar .breadcrumb { color: var(--muted-fg); font-size: 14px; }
.topbar .user { display: flex; align-items: center; gap: 14px; }
.topbar .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.topbar .balance {
  background: #FEF3C7; color: #B45309; padding: 6px 14px;
  border-radius: 999px; font-size: 13px; font-weight: 500;
}
.topbar .logout { color: var(--muted-fg); font-size: 13px; }
.topbar .logout:hover { color: var(--danger); }

/* 内容区 */
.content { padding: 28px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 16px; font-weight: 600; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ============ 选项卡 ============ */
.tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.tabs .tab {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 18px; font-size: 14px; font-weight: 500; color: var(--muted-fg);
  cursor: pointer; user-select: none; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.tabs .tab:hover { color: var(--fg); }
.tabs .tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.tabs .tab .count { font-size: 12px; font-weight: 400; color: var(--muted-fg); }
.tabs .tab.active .count { color: var(--primary); }
.tabs .tab .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--warning);
  display: none;
}
.tabs .tab.has-pending .dot { display: inline-block; }

/* ============ 统计卡片 ============ */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px;
  position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--grad);
}
.stat-card.green::before { background: linear-gradient(180deg,#16A34A,#4ADE80); }
.stat-card.orange::before { background: linear-gradient(180deg,#EA580C,#FB923C); }
.stat-card.red::before { background: linear-gradient(180deg,#EF4444,#F87171); }
.stat-card .label { color: var(--muted-fg); font-size: 13px; }
.stat-card .num { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--fg); }

/* ============ 表格 ============ */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 16px; text-align: left; vertical-align: middle; }
.table th { white-space: nowrap; }
.table th {
  background: var(--muted); font-weight: 600; color: var(--muted-fg);
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.table tr { transition: background .15s; }
.table tbody tr:hover { background: #F8FAFC; }
.table td { border-bottom: 1px solid var(--border); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
/* 单元格内多行堆叠（标题+单号 / 姓名+手机号 / 时间+IP）保持统一的行距与左缘 */
.table td > div + div { margin-top: 3px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.form-group label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5,150,105,.13);
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-tip { font-size: 12px; color: var(--muted-fg); margin-top: 5px; line-height: 1.6; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s ease; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--fg); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============ 标签 ============ */
.tag {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.tag-green { background: #DCFCE7; color: #15803D; }
.tag-orange { background: #FED7AA; color: #C2410C; }
.tag-red { background: #FEE2E2; color: #B91C1C; }
.tag-blue { background: #DBEAFE; color: #1D4ED8; }
.tag-gray { background: var(--muted); color: var(--muted-fg); }

/* ============ 充值套餐 ============ */
.recharge-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.plan {
  border: 2px solid var(--border); border-radius: var(--r); padding: 22px 16px;
  text-align: center; cursor: pointer; transition: all .15s ease; background: #fff;
}
.plan:hover { border-color: var(--accent-strong); }
.plan.selected {
  border-color: var(--primary); background: var(--accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}
.plan .amount { font-size: 26px; font-weight: 700; color: var(--primary); }
.plan .bonus { color: var(--danger); font-size: 13px; margin-top: 6px; }

/* ============ 步骤条 ============ */
.steps {
  display: flex; margin-bottom: 24px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px 28px;
  box-shadow: var(--shadow-sm);
}
.steps .step {
  flex: 1; text-align: center; color: var(--muted-fg);
  position: relative; font-size: 13px;
}
.steps .step .dot {
  width: 34px; height: 34px; border-radius: 50%;
  background: #E2E8F0; color: var(--muted-fg);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; margin-bottom: 8px;
  transition: all .2s ease;
}
.steps .step .txt { font-weight: 500; }
.steps .step.done { color: var(--primary); }
.steps .step.done .dot { background: var(--grad); color: #fff; }
.steps .step.current { color: var(--primary); font-weight: 600; }
.steps .step.current .dot {
  background: #fff; color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(5,150,105,.13);
}
/* 连线 */
.steps .step:not(:last-child)::after {
  content: ""; position: absolute; top: 17px; left: calc(50% + 24px);
  width: calc(100% - 48px); height: 2px; background: var(--border);
}
.steps .step.done:not(:last-child)::after { background: var(--primary); }

/* ============ 欢迎卡 ============ */
.welcome-card {
  background: var(--grad); color: #fff; border-radius: var(--r);
  padding: 28px; margin-bottom: 20px; border: none;
}
.welcome-card h3 { font-size: 20px; margin-bottom: 6px; }
.welcome-card p { opacity: .9; font-size: 14px; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stat-row, .recharge-plans { grid-template-columns: repeat(2, 1fr); }
}

.ck-editor__editable { min-height: 500px !important; }

/* ============================================================
   后台专用补充样式（NeedIndex.Advertorial.Admin）
   ============================================================ */

/* 筛选条 */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .field { display: flex; align-items: center; gap: 6px; }
.filter-bar label { font-size: 13px; color: var(--muted-fg); }
.filter-bar input[type=text], .filter-bar select {
  height: 34px; padding: 0 10px; font-size: 13px; color: var(--fg);
  border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none;
}
.filter-bar input[type=text] { width: 220px; }
.filter-bar input[type=text]:focus, .filter-bar select:focus { border-color: var(--primary); }

/* 表格内的紧凑按钮 */
.btn-xs { padding: 3px 10px; font-size: 12px; border-radius: 6px; }
.table td .btn + .btn { margin-left: 6px; }
.table-wrap { overflow-x: auto; }
.text-muted { color: var(--muted-fg); }
.text-right { text-align: right; }
.text-center { text-align: center; }
/* .table th/td 自带 text-align:left，优先级高于单类工具类；
   这里提高优先级，保证单元格上的 .text-center/.text-right 能生效 */
.table th.text-center, .table td.text-center { text-align: center; }
.table th.text-right, .table td.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, Monaco, monospace; font-size: 12px; }

/* 空态与加载 */
.empty-tip { text-align: center; color: #9CA3AF; padding: 40px 0; font-size: 13px; }
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #A7F3D0; border-top-color: var(--primary);
  border-radius: 50%; margin-right: 8px; vertical-align: -2px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 统计卡（后台控制台） */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.kpi.warn::before { background: linear-gradient(180deg, #EA580C, #FB923C); }
.kpi.ok::before { background: linear-gradient(180deg, #16A34A, #4ADE80); }
.kpi.danger::before { background: linear-gradient(180deg, #EF4444, #F87171); }
.kpi .label { font-size: 13px; color: var(--muted-fg); }
.kpi .num { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.kpi .num small { font-size: 13px; font-weight: 400; color: var(--muted-fg); margin-left: 4px; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ECFDF5 0%, #F3F6F5 55%, #F0FDFA 100%);
}
.login-card {
  width: 380px; background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 34px 32px; box-shadow: 0 12px 40px rgba(15, 23, 42, .10);
}
.login-card .brand { text-align: center; margin-bottom: 6px; }
.login-card h1 { font-size: 19px; text-align: center; margin: 12px 0 4px; }
.login-card .sub { text-align: center; color: var(--muted-fg); font-size: 12.5px; margin-bottom: 24px; }
.login-card .form-item { margin-bottom: 14px; }
.login-card input[type=text], .login-card input[type=password] {
  width: 100%; height: 42px; padding: 0 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 10px; outline: none; background: #fff;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,.13); }
.login-card .btn-primary { width: 100%; height: 44px; font-size: 15px; margin-top: 6px; border-radius: 10px; }
.login-err {
  background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C;
  font-size: 13px; padding: 9px 12px; border-radius: 9px; margin-bottom: 14px;
}

/* 侧栏待办角标 */
.menu-item { justify-content: flex-start; }
.menu-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: none; align-items: center; justify-content: center;
  background: #EF4444; color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 999px; line-height: 1;
}

/* 稿件正文渲染（详情弹层） */
.article-body img { max-width: 100%; height: auto; }
.article-body p { margin: 0 0 14px; }
.article-body h1, .article-body h2, .article-body h3 { margin: 18px 0 10px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.article-body table td, .article-body table th { border: 1px solid var(--border); padding: 8px 10px; }
.article-body blockquote {
  margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--accent-strong);
  background: #F8FAFC; color: var(--muted-fg);
}
.article-body mark.marker { background: #FEF08A; padding: 0 2px; }
