/* 乾乾天文 · 内容管理后台 样式
 * 品牌取自前台（article.js 分享页）：深绿 #0A5C2A / 主绿 #0B6B31 / 点缀金 #E23A20 */
:root {
  --brand-dark: #0A5C2A;
  --brand: #0B6B31;
  --brand-hover: #0A5C2A;
  --accent: #E23A20;
  --bg: #FBF9F3;
  --card: #FFFFFF;
  --border: #EDE4D2;
  --text: #2A2318;
  --muted: #7D7263;
  --danger: #E23A20;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ───────── 登录 ───────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0A5C2A 0%, #0B6B31 55%, #0B6B31 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { font-size: 40px; line-height: 1; }
.login-brand h1 { font-size: 22px; color: var(--brand-dark); margin-top: 8px; letter-spacing: 2px; }
.login-brand p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 10px; text-align: center; }

/* ───────── 顶栏 ───────── */
.topbar {
  height: 56px;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { font-size: 20px; }
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-link { color: #DCCFB0; font-size: 13px; text-decoration: none; }
.topbar-link:hover { color: var(--accent); }
.topbar-user { color: var(--accent); font-size: 13px; }

/* ───────── 布局 ───────── */
.layout { display: flex; align-items: flex-start; min-height: calc(100vh - 56px); }
.sidenav {
  width: 180px;
  flex: 0 0 180px;
  padding: 16px 12px;
  position: sticky;
  top: 56px;
}
.navitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 4px;
}
.navitem:hover { background: #F0EDE6; }
.navitem.active { background: var(--brand); color: #fff; font-weight: 600; }
.content { flex: 1; min-width: 0; padding: 16px 20px 40px 8px; }

/* ───────── 面板 ───────── */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font-size: 17px; color: var(--brand-dark); }
.panel-head-actions { display: flex; gap: 8px; }

/* ───────── 状态分栏 ───────── */
.status-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  border: none;
  background: none;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ───────── 工具条 ───────── */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }

/* ───────── 表单控件 ───────── */
.input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(62, 123, 39, .12); }
.input-select { min-width: 130px; cursor: pointer; }
.input-sm { height: 32px; font-size: 13px; }

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 40px; margin-top: 6px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: #FBF7EC; }
.btn-ghost { background: #F0EDE6; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #EDE4D2; }
.btn-danger { background: #fff; color: var(--danger); border-color: #DCCFB0; }
.btn-danger:hover { background: #FDEBE7; }
.btn-mini { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }

/* ───────── 表格 ───────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  background: #FBF7EC;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #F0EDE6; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FBF7EC; }
.table .empty { text-align: center; color: var(--muted); padding: 40px 0; }
.cell-title { display: flex; align-items: center; gap: 6px; }
.cell-title .t { font-weight: 500; }
.cell-title a { color: inherit; text-decoration: none; }
.cell-title a:hover { color: var(--brand); text-decoration: underline; }
.pin-flag { color: var(--accent); flex: 0 0 auto; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ───────── 徽标 ───────── */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.badge-published { background: #F0EDE6; color: #0A5C2A; }
.badge-pending   { background: #FDEBE7; color: #9E2A14; }
.badge-draft     { background: #F0EDE6; color: #453B2C; }
.badge-rejected  { background: #FDEBE7; color: #B22A14; }

/* ───────── 分页 ───────── */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.pager-info { color: var(--muted); font-size: 13px; }
.pager-btns { display: flex; gap: 8px; }
.pager-btns .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ───────── 弹窗 ───────── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.modal-lg { max-width: 760px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; color: var(--brand-dark); }
.modal-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}
.modal-msg { flex: 1; font-size: 13px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-span2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; color: var(--muted); }
.field input[type=text], .field input[type=search], .field input[type=password],
.field input[type=number], .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(62, 123, 39, .12);
}
.field textarea { line-height: 1.55; }
.field textarea#fContent { font-family: ui-monospace, Consolas, 'Courier New', monospace; font-size: 13px; }
.req { color: var(--danger); }
.checks { flex-direction: row; gap: 20px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* ───────── Toast ───────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(20, 56, 31, .94);
  color: #fff;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(165, 40, 26, .95); }

/* ───────── 小屏 ───────── */
/* ═════════════════════════════════════════════════════
 * 2026-09-11 多模块控制台扩展样式
 * ═════════════════════════════════════════════════════ */

/* ───────── 模块容器（每个模块自己是一张卡） ───────── */
.module {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}
.panel-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.panel.soft {
  background: #FBF7EC;
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.panel-head h3 { font-size: 15px; color: var(--brand-dark); }

/* ───────── 指标卡 ───────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.card.stat { border-left: 4px solid var(--brand); }
.stat-k { font-size: 12.5px; color: var(--muted); }
.stat-v { font-size: 24px; font-weight: 700; line-height: 1.25; margin: 2px 0; color: var(--brand-dark); word-break: break-word; }
.stat-v i { font-size: 13px; font-weight: 500; color: var(--muted); font-style: normal; }
.stat-h { font-size: 12px; color: #A99E8E; }
.tone-green { border-left-color: #0B6B31; } .tone-green .stat-v { color: #0A5C2A; }
.tone-blue  { border-left-color: #2E6DB4; } .tone-blue  .stat-v { color: #2E9B4E; }
.tone-gold  { border-left-color: var(--accent); } .tone-gold .stat-v { color: #9E2A14; }
.tone-red   { border-left-color: var(--danger); } .tone-red  .stat-v { color: #B22A14; }
.card.skeleton { opacity: .55; }

/* ───────── 两栏 / 网格 ───────── */
.grid-2col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }

/* ───────── 迷你列表（概览页） ───────── */
.mini-list { font-size: 13.5px; }
.mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid #F0EDE6;
}
.mini-row:last-child { border-bottom: none; }
.mini-id { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; }
.mini-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-tag { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.mini-amt { font-weight: 600; color: var(--brand-dark); flex: 0 0 auto; }
.mini-list .empty { text-align: center; color: var(--muted); padding: 26px 0; }

/* ───────── 定义列表 ───────── */
.deflist { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13.5px; }
.deflist dt { color: var(--muted); white-space: nowrap; }
.deflist dd { color: var(--text); word-break: break-all; }
.deflist.compact { gap: 5px 12px; font-size: 13px; }

/* ───────── 标签 / 代码 ───────── */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.tag-gold { background: #FDEBE7; color: #9E2A14; }
.tag-blue { background: #FCF2D6; color: #2E9B4E; }
.tag-grey { background: #F0EDE6; color: #453B2C; }
/* 2026-09-11 新增：提现模式=已关闭 红色标 */
.tag-red { background: #FDEBE7; color: #B22A14; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.code {
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  background: #F0EDE6; padding: 1px 6px; border-radius: 4px;
  font-size: 12.5px; color: #2A2318;
}
.code-lg { font-size: 14px; letter-spacing: .5px; }
.code-block { display: block; padding: 12px; word-break: break-all; line-height: 1.5; }
.code-list { display: flex; flex-wrap: wrap; gap: 8px; }

.badge-approved { background: #FCF2D6; color: #2E9B4E; }

/* ───────── 表格补充 ───────── */
.cell-sub { color: #A99E8E; font-size: 12px; margin-top: 2px; }
.cell-sub.inline { display: inline-block; margin: 0 0 0 6px; }
.table-sm th, .table-sm td { padding: 6px 8px; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.amt-plus { color: #0A5C2A; font-weight: 600; }
.amt-minus { color: #B22A14; font-weight: 600; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.5; }
.warn-text { color: #B22A14; font-weight: 600; }

/* ───────── 提示条 ───────── */
.notice {
  background: #FBF7EC; border: 1px solid #EBD79B; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: #78350F;
  margin-bottom: 14px; line-height: 1.65;
}
.inline-field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline-field .input { width: auto; }
.inline-field input[type=number] { width: 90px; }

/* ───────── 右侧抽屉 ───────── */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
  z-index: 120; display: flex; justify-content: flex-end;
}
.drawer {
  width: min(640px, 96vw); height: 100%; background: var(--card);
  box-shadow: -10px 0 34px rgba(0, 0, 0, .2);
  display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.drawer-head h3 { font-size: 16px; color: var(--brand-dark); }
.drawer-body { padding: 16px 20px 48px; overflow-y: auto; flex: 1 1 auto; }
.dr-section { margin-bottom: 20px; }
.dr-section h4 {
  font-size: 14px; color: var(--brand-dark); margin-bottom: 9px;
  border-left: 3px solid var(--brand); padding-left: 8px;
}
.dr-section .empty { text-align: center; color: var(--muted); padding: 22px 0; }

/* ───────── 密码强度条 ───────── */
.pw-meter { height: 6px; background: #F0EDE6; border-radius: 3px; overflow: hidden; margin: 4px 0 2px; }
.pw-meter span { display: block; height: 100%; width: 0; background: #DCCFB0; transition: width .2s, background .2s; }
.pw-meter.lv1 span { width: 22%; background: #E23A20; }
.pw-meter.lv2 span { width: 45%; background: #E23A20; }
.pw-meter.lv3 span { width: 70%; background: #0B6B31; }
.pw-meter.lv4 span { width: 100%; background: #0A5C2A; }

/* ───────── 配置项网格 ───────── */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 14px; }
.cfg-field { display: flex; flex-direction: column; gap: 5px; }
.cfg-field > span { font-size: 13px; color: var(--muted); }
.cfg-unit { font-style: normal; color: var(--brand); font-size: 12px; margin-left: 4px; }
.cfg-src { font-style: normal; color: #A99E8E; font-size: 11px; margin-left: 6px; }
.cfg-hint { font-style: normal; color: #A99E8E; font-size: 11.5px; line-height: 1.45; }
.cfg-field input {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff; outline: none;
}
.cfg-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(62, 123, 39, .12); }

/* ───────── 小弹窗 ───────── */
.modal-sm { max-width: 460px; }
.dlg-msg { font-size: 14px; line-height: 1.7; }
.dlg-err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ───────── 小屏 ───────── */
@media (max-width: 900px) {
  .sidenav {
    display: flex; width: 100%; flex: 0 0 auto;
    overflow-x: auto; gap: 4px; padding: 10px 12px;
    position: static; border-bottom: 1px solid var(--border);
  }
  .navitem { margin-bottom: 0; white-space: nowrap; padding: 8px 12px; }
  .layout { flex-direction: column; }
  .content { padding: 12px; width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2col { grid-template-columns: 1fr; }
  .field-span2 { grid-column: span 1; }
  .topbar-title { font-size: 13px; }
  .topbar-link { display: none; }
  .drawer { width: 100%; }
}
