:root {
    --bg: #08111f;
    --panel: #101b2e;
    --panel2: #13233b;
    --line: #223656;
    --text: #e8eef7;
    --muted: #91a4bf;
    --primary: #28b7ff;
    --green: #28d17c;
    --red: #ff5c74;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: #07101d; border-right: 1px solid var(--line); padding: 22px 16px; }
.brand { margin-bottom: 26px; }
.brand strong { display: block; font-size: 18px; }
.brand span, .topbar p, .muted { color: var(--muted); font-size: 13px; }
.nav { display: block; width: 100%; border: 0; background: transparent; color: var(--muted); padding: 12px 14px; text-align: left; border-radius: 8px; cursor: pointer; margin-bottom: 6px; }
.nav.active, .nav:hover { background: #132746; color: var(--text); }
.main { padding: 24px; overflow: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h1 { margin: 0 0 6px; font-size: 24px; }
.page { display: none; }
.page.active { display: block; }
.cards { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card, .panel, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.card b { display: block; font-size: 28px; margin-top: 8px; }
.panel { margin-bottom: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: end; }
label { display: block; color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; margin-top: 6px; border: 1px solid var(--line); background: #0b1526; color: var(--text); border-radius: 6px; padding: 10px; }
textarea { min-height: 88px; }
input[type="color"] { min-height: 38px; padding: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line); background: #152640; color: var(--text); text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #04101d; font-weight: bold; }
.btn.ghost { background: transparent; }
.btn.danger { background: #391321; border-color: #6b2637; color: #ffd7df; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-input { width: min(280px, 100%); margin-top: 0; }
.table-scroll { width: 100%; overflow: auto; }
.sub-title { margin: 16px 0 10px; font-size: 15px; color: #d7e8ff; }
.list-filter { margin: 0 0 12px; }
.list-filter-inline { display: inline-flex; align-items: center; min-width: 360px; max-width: min(520px, 100%); font-size: 13px; font-weight: 400; }
.list-filter-inline select { min-width: 320px; margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: #b8c7db; background: #0d192b; }
.message { display: none; padding: 12px; border-radius: 6px; margin-bottom: 14px; }
.message.show { display: block; }
.message.success, .alert.success { background: rgba(40,209,124,.12); color: #92ffc1; border: 1px solid rgba(40,209,124,.35); }
.message.error, .alert.error { background: rgba(255,92,116,.12); color: #ffc1cb; border: 1px solid rgba(255,92,116,.35); }
.alert { padding: 10px; border-radius: 6px; margin: 10px 0; }
pre { white-space: pre-wrap; word-break: break-word; background: #08111f; border: 1px solid var(--line); padding: 12px; border-radius: 6px; max-height: 420px; overflow: auto; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); }
.login-card h1 { margin-top: 0; }
.login-card label { margin-bottom: 12px; }
.muted-link { color: var(--muted); display: inline-block; margin-top: 12px; }
.tips { color: var(--muted); line-height: 1.9; }
.wizard-progress { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 14px; }
.wizard-step { min-height: 116px; border: 1px solid var(--line); background: #0b1526; border-radius: 8px; padding: 12px; }
.wizard-step b { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: #1a2b47; margin-bottom: 8px; }
.wizard-step span { display: block; font-weight: 700; margin-bottom: 6px; }
.wizard-step small { display: block; color: var(--muted); line-height: 1.45; }
.wizard-step.done { border-color: rgba(40,209,124,.55); background: rgba(40,209,124,.08); }
.wizard-step.done b { background: var(--green); color: #03130b; }
.wizard-step.current { border-color: rgba(40,183,255,.8); box-shadow: 0 0 0 1px rgba(40,183,255,.25) inset; }
.wizard-step.current b { background: var(--primary); color: #03111f; }
.guide-box { padding: 14px 16px; border: 1px solid rgba(40,183,255,.45); background: rgba(40,183,255,.08); border-radius: 8px; color: #d7efff; }
.empty { color: var(--muted); border: 1px dashed var(--line); padding: 18px; border-radius: 8px; }
.parse-info { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; border: 1px solid rgba(40,209,124,.4); background: rgba(40,209,124,.08); border-radius: 8px; color: #d8ffe9; }
.parse-info div { overflow-wrap: anywhere; }
.panel.nested { margin-top: 14px; background: #0b1526; }
.tag { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #26344d; color: var(--muted); font-size: 12px; }
.tag.success { background: rgba(40,209,124,.16); color: #9cffc8; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 8px; }
.check-item { border: 1px solid var(--line); background: #0b1526; border-radius: 6px; padding: 8px; color: var(--text); display: grid; grid-template-columns: 20px 1fr; gap: 4px 6px; align-items: center; }
.check-item input { width: auto; margin: 0; }
.check-item small { grid-column: 2; color: var(--muted); overflow-wrap: anywhere; }
.modal-mask { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.58); }
.modal { width: min(980px, 100%); max-height: 86vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .cards, .grid, .wizard-progress, .parse-info, .check-grid { grid-template-columns: 1fr; }
}

.web-form-state {
  margin: 8px 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(34, 211, 238, .26);
  border-radius: 8px;
  background: rgba(14, 165, 233, .08);
  color: #bfdbfe;
  font-weight: 700;
}
.form-field-grid {
  display: grid;
  gap: 12px;
}
.form-field-item {
  padding: 12px;
  border: 1px solid #1f3a5b;
  border-radius: 8px;
  background: rgba(15, 23, 42, .58);
}
.form-field-item.disabled {
  opacity: .58;
}
.form-field-item > label:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.form-field-item small {
  color: #8aa0bd;
}

.web-form-theme-cards {
  margin: 8px 0 14px;
}
.web-form-import-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.web-form-import-row .btn {
  min-height: 40px;
  white-space: nowrap;
}
.web-form-import-tip {
  margin: 8px 0 14px;
}
.color-pair {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
}
.color-pair input {
  margin-top: 6px;
}
.color-pair input[type="color"] {
  height: 38px;
  min-height: 38px;
  padding: 3px;
}
.form-field-item {
  display: block;
}
.form-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.form-field-title {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  margin: 0;
  color: #e5f3ff;
  font-weight: 800;
}
.form-field-title input {
  width: auto;
  min-width: auto;
}
.form-field-head small {
  flex: 0 0 auto;
  color: #8aa0bd;
  text-align: right;
}
.form-field-item > label:first-child:not(.form-field-title) {
  display: block;
}
@media (max-width: 900px) {
  .web-form-import-row {
    grid-template-columns: 1fr;
  }
  .web-form-import-row .btn {
    width: 100%;
  }
  .form-field-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-field-head small {
    text-align: left;
  }
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}
.theme-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, .26);
  background: rgba(15, 23, 42, .55);
  color: #e5f3ff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  min-height: 42px;
}
.theme-card.active {
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, .16);
}
.theme-card i {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
}
.theme-card span {
  flex: 1;
  text-align: left;
  font-weight: 700;
}
@media (max-width: 900px) {
  .theme-grid { grid-template-columns: 1fr; }
}
