:root {
  --ink: #1a5fb4;
  --ink-soft: #1a5fb4;
  --paper: #f0f2f5;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #303133;
  --muted: #909399;
  --danger: #8d3030;
  --warn: #8a5a12;
  --ok: #1a5fb4;
  --sidebar: #1a1d24;
  --shadow: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--text);
  font: 14px/1.5 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a { color: var(--ink); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f0f2f5;
}

.login-panel {
  width: 840px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.login-body {
  display: flex;
  align-items: center;
}

.login-side,
.login-card {
  flex: 1;
  min-width: 0;
  padding: 8px 40px 40px;
  background: transparent;
}

.login-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-art {
  display: block;
  width: 100%;
  height: 132px;
  margin: 28px 0 8px;
  padding: 0 36px;
  object-fit: contain;
  object-position: left center;
}

.login-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-slogan {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.login-points {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: #606266;
  font-size: 13px;
  line-height: 1.6;
}

.login-points li {
  position: relative;
  margin-top: 8px;
  padding-left: 16px;
}

.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a5fb4;
}

.login-closing {
  margin: 18px 0 0;
  color: #1a5fb4;
  font-size: 14px;
  letter-spacing: 1px;
}

.login-card {
  border-radius: 0;
}

.login-card h2 {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 600;
}

.login-card .btn {
  width: 100%;
  height: 40px;
  margin-top: 8px;
}

@media (max-width: 800px) {
  .login-body { flex-direction: column; align-items: stretch; }
  .login-side,
  .login-card { padding: 8px 28px 32px; }
  .login-art { height: 112px; margin-top: 20px; padding: 0 20px; }
}

.brand-mark {
  color: var(--ink);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 2px;
}

.brand-en {
  margin-left: 8px;
  font-size: 14px;
  letter-spacing: 1px;
  font-weight: 500;
}

.admin-layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
}

.topbar {
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  background: var(--sidebar);
  padding-right: 12px;
}

.brand {
  width: 228px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  cursor: pointer;
  background: transparent;
  border: 0;
  color: #fff;
  text-align: left;
}

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

.brand-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
}

.brand-slogan {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.2;
}

.top-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.top-nav-item,
.side-item,
.tag,
.tag-home,
.avatar,
.user-pop button {
  border: 0;
  background: transparent;
}

.top-nav-item {
  height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  color: #d8dde6;
  white-space: nowrap;
}

.top-nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.top-nav-item.active { background: #1a5fb4; color: #fff; }

.top-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
}

.admin-name { color: #d8dde6; font-size: 13px; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a5fb4;
  color: #fff;
}

.user-pop {
  position: absolute;
  top: 40px;
  right: 0;
  width: 140px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  z-index: 5;
}

.user-pop button {
  width: 100%;
  padding: 8px;
  text-align: left;
  border-radius: 4px;
}

.user-pop button:hover { background: #f3f4f6; }

.body { flex: 1; min-height: 0; display: flex; }

.aside {
  width: 200px;
  flex: none;
  background: var(--sidebar);
  overflow: auto;
  padding: 8px 0 24px;
}

.aside.collapsed { width: 64px; }
.aside.collapsed .side-item span { display: none; }

.side-item {
  display: block;
  width: calc(100% - 16px);
  height: 44px;
  margin: 2px 8px;
  padding: 0 12px;
  border-radius: 4px;
  color: #c8cdd6;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.side-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side-item.active { background: #1a5fb4; color: #fff; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.content-bar {
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.collapse-btn,
.tag-home {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #606266;
}

.collapse-btn:hover,
.tag-home:hover { background: #e8eaed; color: #1a5fb4; }

.tags {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tag {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 4px;
  color: #606266;
  white-space: nowrap;
}

.tag:hover { background: #e8eaed; }
.tag.active { color: #1a5fb4; background: #e8f0fb; }

.tag-close {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #909399;
  line-height: 16px;
}

.main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.hint { margin: -8px 0 12px; color: var(--muted); }

.muted { color: var(--muted); }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.main:has(.fill-form) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fill-form {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.fill-form .field:last-of-type {
  flex: 1;
  min-height: 0;
}

.fill-form textarea {
  flex: 1;
  min-height: 120px;
  width: 100%;
}

.flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.flow span, .flow i {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px 14px;
  font-style: normal;
}
.flow i { border: 0; background: transparent; color: #909399; padding: 0 4px; }
.status-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.status-col {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-height: 220px;
}
.status-col h3 {
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}
.status-col button {
  display: block;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 8px 10px;
  text-align: left;
  background: #f7f8fa;
  border-radius: 4px;
}
.node-form {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.node-form h3 { margin: 0 0 12px; font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.pad { padding: 16px 18px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-num {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 650;
  color: var(--ink);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

input, select, textarea {
  padding: 8px 10px;
  border: 1px solid #d5dbd4;
  border-radius: 8px;
  background: #fff;
}

textarea { width: 100%; min-height: 96px; resize: vertical; }

.btn {
  border: 0;
  border-radius: 4px;
  padding: 8px 14px;
  background: #1a5fb4;
  color: #fff;
}

.btn.ghost {
  background: #fff;
  color: #1a5fb4;
  border: 1px solid #dcdfe6;
}

.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #303133;
  font-weight: 600;
  background: #f5f7fa;
}

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f7faf7; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--ink);
  font-size: 12px;
}

.pill.ACTIVE, .pill.ACTIVATED { background: #e5f2ea; }
.pill.VOIDED { background: #f8e8e8; color: var(--danger); }
.pill.INACTIVE, .pill.PENDING_GENERATE, .pill.GENERATED { background: #f6f0e4; color: var(--warn); }

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  padding: 12px;
}

.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar {
  background: var(--ink-soft);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bar-label { margin-top: 4px; font-size: 10px; color: var(--muted); text-align: center; overflow: hidden; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.node {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.node-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  text-align: center;
  line-height: 28px;
  font-size: 12px;
}

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.media-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.thumbs img, .thumbs video, .file-chip {
  width: 160px;
  height: 120px;
  object-fit: contain;
  background: #f4f4f4;
  border-radius: 6px;
}
.file-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.modal {
  position: absolute;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  animation: drawer-in 0.2s ease;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-head,
.drawer-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.drawer-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.drawer-x {
  border: 0;
  background: transparent;
  color: #909399;
  font-size: 22px;
  line-height: 1;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
}

.drawer-foot {
  border-bottom: 0;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
  gap: 8px;
}

.date-selects { display: flex; gap: 8px; align-items: center; }
.date-selects .combo { position: relative; flex: 1; min-width: 0; }
.date-selects .combo input { width: 100%; padding-right: 22px; }
.date-selects input::-webkit-calendar-picker-indicator { display: none; }
.combo-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 22px;
  border: 0;
  border-radius: 0 7px 7px 0;
  background: transparent;
}
.combo-btn::after {
  content: '';
  display: block;
  margin: 0 auto;
  border: 4px solid transparent;
  border-top-color: #606266;
  border-bottom: 0;
}
.combo-panel {
  position: fixed;
  z-index: 40;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}
.combo-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: #fff;
  color: #303133;
  text-align: left;
}
.combo-item:hover { background: #f0f2f5; }
.date-label { color: #606266; font-size: 13px; flex: none; }
.filters .date-selects .combo { flex: none; width: 88px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field.inline { flex-direction: row; align-items: center; }
.codes {
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  background: #f6f7f5;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

#toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  max-width: min(420px, calc(100% - 48px));
  padding: 16px 24px;
  border-radius: 8px;
  background: #24312b;
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.empty { padding: 28px; text-align: center; color: var(--muted); }

.preview {
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
  background: #f6f6f6;
}

@media (max-width: 860px) {
  .brand { width: auto; }
  .brand-slogan { display: none; }
  .stats { grid-template-columns: 1fr; }
  .aside { width: 160px; }
}
