/* ==========================================================================
   焱坤云营销魔方 · 基础样式（原生 CSS，无第三方组件库）
   ========================================================================== */

:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #e4e7ec;
  --line-soft: #eef1f6;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --brand: #4f46e5;
  --brand-deep: #3730a3;
  --brand-soft: #eef0ff;
  --nav: #111a36;
  --nav-2: #0b1227;
  --gold: #e8a43c;
  --gold-soft: #fdf3e2;
  --green: #12a76b;
  --green-soft: #e6f8f0;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber: #b7791f;
  --amber-soft: #fdf5e3;
  --violet: #7c3aed;
  --violet-soft: #f3edff;
  --blue: #2563eb;
  --blue-soft: #e9f0ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.09);
  --shadow-lg: 0 24px 70px rgba(9, 15, 40, 0.2);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, canvas { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(79, 70, 229, 0.18); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cdd3e1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb6c8; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

html.no-scroll, html.no-scroll body { overflow: hidden; }

/* ------------------------------- 按钮 ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, 0.24); }
.btn.primary:hover { background: #4338ca; }
.btn.ghost { border-color: var(--line); background: #fff; color: var(--ink-2); }
.btn.ghost:hover { border-color: #c8cede; background: #fafbff; }
.btn.soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn.soft:hover { background: #e3e7ff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: #cf3b40; }


.btn.success { background: var(--green); color: #fff; }
.btn.success:hover { background: #0e8f5c; }
.btn.link { height: auto; padding: 0; background: transparent; color: var(--brand); font-weight: 600; }
.btn.link:hover { text-decoration: underline; transform: none; }
.btn.sm { height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 14px; }
.btn.block { width: 100%; }

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: #f1f3f9; color: var(--ink); }

/* ------------------------------- 表单 ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em; }
.field > label em { color: var(--red); font-style: normal; }
.field .hint { font-size: 11px; color: var(--soft); }
.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: #b3bac9; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.input:disabled, .select:disabled { background: #f7f8fb; color: var(--soft); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2398a2b3' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
.input.sm, .select.sm { height: 32px; font-size: 12px; border-radius: 8px; padding-left: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

/* ------------------------------- 标签 ---------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: #f1f3f8;
  color: var(--muted);
}
.badge.green { background: var(--green-soft); color: #0b7a4e; }
.badge.red { background: var(--red-soft); color: #c5393d; }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.gray { background: #f2f4f7; color: var(--muted); }


.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
}

/* ------------------------------- 容器 ---------------------------------- */

.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }



.panel-body { padding: 20px; }




.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); }

/* ------------------------------- 表格 ---------------------------------- */
.table-wrap { width: 100%; overflow: auto; }
.table { min-width: 100%; font-size: 13px; }
.table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
  background: #fafbfd;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid #f2f4f8; vertical-align: middle; }
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: #fbfcff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; color: var(--ink); }

.table .sub { display: block; font-size: 11px; color: var(--soft); margin-top: 2px; }



.empty-state { padding: 42px 16px; text-align: center; color: var(--soft); font-size: 13px; }
.empty-cube { display: inline-block; width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #e7e9ff, #f6f7ff); border: 1px solid #dfe3f8; transform: rotate(12deg); margin-bottom: 10px; }

/* ------------------------------- 分页 ---------------------------------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.pager-info { color: var(--muted); font-size: 12px; }
.pager-btns { display: flex; align-items: center; gap: 5px; }
.pager-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
}
.pager-btn:hover:not(:disabled) { border-color: #c4cada; background: #fafbff; }
.pager-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pager-gap { color: var(--soft); padding: 0 2px; }

/* ------------------------------- 选项卡 -------------------------------- */
.tabs { display: flex; gap: 6px; padding: 4px; background: #f2f4f9; border-radius: 10px; width: fit-content; max-width: 100%; overflow: auto; }
.tab-btn {
  height: 32px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(16, 24, 40, 0.1); }

/* ------------------------------- 开关 ---------------------------------- */







/* ------------------------------- 弹层 ---------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 13, 30, 0.46);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.overlay.show { opacity: 1; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.2s ease;
  overflow: hidden;
  display: flex;
}
.overlay.show .modal { transform: translateY(0) scale(1); }
.modal.modal-lg { width: min(860px, 100%); }
.modal.modal-sm { width: min(400px, 100%); }
.modal-card { display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 48px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-soft); background: #fcfcfe; }
.confirm-text { color: var(--ink-2); line-height: 1.75; }

.drawer-overlay { justify-content: flex-end; padding: 0; }
.drawer {
  width: min(640px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -24px 0 70px rgba(8, 13, 30, 0.22);
  display: flex;
  flex-direction: column;
  transform: translateX(40px);
  transition: transform 0.22s ease;
}
.overlay.show .drawer { transform: translateX(0); }
.drawer.drawer-xl { width: min(880px, 100%); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.drawer-head h3 { font-size: 17px; }
.drawer-head p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.drawer-body { flex: 1; overflow: auto; padding: 22px 24px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: #fcfcfe; }

/* ------------------------------- 提示 ---------------------------------- */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  max-width: 420px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #101828;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }
.toast.error .toast-dot { background: #ff6b70; }
.toast.info .toast-dot { background: #60a5fa; }

/* ------------------------------- 工具类 -------------------------------- */
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.strong { font-weight: 600; }


.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; }











.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }



.hidden { display: none !important; }


.spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: currentColor; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .overlay { padding: 12px; }
  .toast { left: 16px; right: 16px; top: 16px; max-width: none; }
  .drawer { width: 100%; }
}
