:root {
  --bg: #030503;
  --panel: #080a06;
  --panel-soft: #10120b;
  --line: #8f772d;
  --line-soft: rgba(238, 206, 102, 0.32);
  --gold: #f2d572;
  --gold-deep: #a78b37;
  --olive: #1e2d1d;
  --olive-2: #2b4428;
  --danger: #a93636;
  --text: #f6f1dc;
  --muted: #cfc39c;
  --bad: #ff4242;
  --ok: #f2d572;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
}

* {
  box-sizing: border-box;
}

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

.plugin-shell {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 0 12px 18px;
  background:
    radial-gradient(circle at 0 260px, rgba(44, 78, 72, 0.28), transparent 115px),
    linear-gradient(90deg, rgba(223, 191, 80, 0.035), transparent 32%),
    var(--bg);
}

.plugin-shell::-webkit-scrollbar {
  width: 11px;
}

.plugin-shell::-webkit-scrollbar-track {
  background: #3b3b3b;
}

.plugin-shell::-webkit-scrollbar-thumb {
  background: #858585;
  border: 2px solid #3b3b3b;
}

.topbar {
  margin: 0 -12px;
  height: 30px;
  line-height: 30px;
  padding: 0 12px;
  background: #2f2f2f;
  color: #e8e8e8;
  overflow: hidden;
  white-space: nowrap;
}

.tab-title {
  height: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand {
  position: relative;
  display: block;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}

.brand-logo {
  display: block;
  width: 220px;
  max-width: 72%;
  height: auto;
  margin: 0 auto 10px;
}

.brand .version {
  position: absolute;
  top: 22px;
  right: 2px;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.brand p {
  margin: 0;
  color: var(--muted);
  letter-spacing: 3px;
  font-size: 12px;
}

.section {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(238, 206, 102, 0.28);
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 22px;
  margin: 0 0 8px;
}

.section-line strong,
.section-line span {
  display: block;
  min-width: 0;
}

.section-line strong {
  color: var(--text);
  font-weight: 700;
}

.section-line span {
  text-align: right;
  font-weight: 700;
}

.state-bad {
  color: var(--bad);
}

.state-ok {
  color: var(--ok);
}

.url-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.url-row span,
.url-row input,
.url-row button {
  display: block;
  height: 40px;
  border: 1px solid var(--line);
}

.url-row span {
  flex: 0 0 88px;
  line-height: 38px;
  text-align: center;
  background: var(--gold-deep);
  color: #070806;
  font-weight: 700;
}

.url-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 10px;
  background: #191919;
  color: #fff;
}

.url-row button {
  flex: 0 0 112px;
  padding: 0;
  background: #080908;
  color: #fff;
  font-weight: 700;
}

.major-tab-section {
  padding-top: 10px;
}

.major-tabs {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.major-tab {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  padding: 0 4px;
  border: 1px solid rgba(238, 206, 102, 0.42);
  background: #11160f;
  color: var(--text);
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.major-tab.active {
  background: linear-gradient(90deg, var(--gold), #b8c06c);
  color: #050604;
}

.workbench {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 4px 0 0;
}

.category-tabs {
  display: block;
  flex: 0 0 108px;
  width: 108px;
  min-width: 108px;
  padding: 0 10px 0 0;
  border-right: 1px solid var(--line);
}

.category-tab {
  display: block;
  width: 100%;
  height: 30px;
  line-height: 30px;
  margin: 0 0 6px;
  padding: 0 6px;
  border: 0;
  background: #0e1a10;
  color: #fff;
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-tab.active {
  background: linear-gradient(90deg, var(--gold), #b8c06c);
  color: #050604;
}

.feature-grid {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0 0 0 14px;
  font-size: 0;
  line-height: 0;
}

.feature-button {
  display: inline-block;
  width: calc(50% - 5px);
  height: 36px;
  line-height: 34px;
  margin: 0 10px 8px 0;
  padding: 0 6px;
  border: 1px solid rgba(238, 206, 102, 0.42);
  background: #090c08;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.feature-button:nth-child(2n) {
  margin-right: 0;
}

.feature-button.active {
  background: linear-gradient(90deg, var(--gold), #b8c06c);
  color: #050604;
  border-color: var(--gold);
}

.feature-button.wide {
  width: 100%;
  margin-right: 0;
}

.light-directory-grid .light-feature-card {
  height: 76px;
  line-height: normal;
  padding: 7px;
  text-align: left;
}

.light-thumb {
  display: inline-block;
  width: 42px;
  height: 42px;
  margin-right: 8px;
  border: 1px solid rgba(238, 206, 102, 0.35);
  background: linear-gradient(135deg, rgba(242, 213, 114, 0.35), rgba(28, 55, 34, 0.7));
  vertical-align: middle;
}

.light-card-text {
  display: inline-block;
  width: calc(100% - 56px);
  vertical-align: middle;
}

.light-card-text strong,
.light-card-text span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.light-card-text span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.minor-title {
  display: block;
  height: 22px;
  line-height: 22px;
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 700;
}

.param-panel,
.param-card,
.progress-card,
.result-section {
  display: block;
  width: 100%;
}

.param-card {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(238, 206, 102, 0.42);
  background: rgba(7, 8, 5, 0.86);
}

.param-card label,
.panel-label {
  display: block;
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 700;
  line-height: 18px;
}

textarea,
input,
select {
  border: 1px solid #6d6d6d;
  background: #191919;
  color: #fff;
}

.prompt-card textarea,
.custom-editor textarea {
  display: block;
  width: 100%;
  height: 132px;
  min-height: 132px;
  max-height: 132px;
  margin: 0;
  padding: 8px;
  resize: none;
  overflow-y: auto;
}

.custom-editor textarea {
  height: 122px;
  min-height: 122px;
  max-height: 122px;
}

.field-stack {
  padding: 10px;
}

.reference-preview {
  display: block;
  width: 100%;
  height: 116px;
  line-height: 114px;
  margin: 0 0 8px;
  border: 1px solid rgba(238, 206, 102, 0.22);
  background: linear-gradient(90deg, rgba(242, 213, 114, 0.08), rgba(8, 12, 7, 0.9));
  text-align: center;
  overflow: hidden;
}

.reference-preview img {
  display: block;
  width: 100%;
  height: 116px;
  object-fit: contain;
}

.reference-preview span {
  display: inline-block;
  max-width: 92%;
  max-height: 40px;
  line-height: 20px;
  color: var(--muted);
  overflow: hidden;
  text-align: center;
  vertical-align: middle;
}

.reference-controls,
.button-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 42px;
}

.reference-controls .panel-action,
.button-row .panel-action {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 42px;
  line-height: 40px;
  padding: 0 4px;
  border: 1px solid rgba(238, 206, 102, 0.55);
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-action {
  cursor: default;
  user-select: none;
}

.solid-button {
  background: linear-gradient(90deg, var(--gold), #b8c06c);
  color: #050604;
}

.outline-button {
  background: #060806;
  color: #fff;
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.is-disabled {
  opacity: 0.42;
}

.action-card {
  padding: 0;
  background: transparent;
}

.compact-hint,
.hint {
  display: none;
}

.slider-row {
  position: relative;
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 0 0 0;
}

.slider-row label {
  position: absolute;
  left: 0;
  top: 0;
  width: 82px;
  height: 42px;
  line-height: 42px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slider-row .slider-value {
  position: absolute;
  left: 88px;
  top: 6px;
  width: 58px;
  height: 30px;
  padding: 0 6px;
  line-height: 28px;
  text-align: center;
}

.xhn-slider {
  position: relative;
  display: block;
  height: 42px;
  margin-left: 158px;
  margin-right: 0;
}

.xhn-slider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 20px;
  height: 4px;
  background: #4a4a4a;
}

.xhn-slider-fill {
  position: absolute;
  left: 0;
  top: 20px;
  height: 4px;
  background: var(--gold);
}

.xhn-slider-thumb {
  position: absolute;
  top: 14px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border: 2px solid var(--gold);
  background: #1c1c1c;
}

.param-grid {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.param-grid label {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px 0 0;
  font-weight: 700;
}

.param-grid input {
  display: block;
  width: 100%;
  height: 32px;
  margin-top: 6px;
  padding: 0 8px;
}

.select-grid,
.chips,
.checkbox-grid {
  display: block;
  width: 100%;
  font-size: 0;
}

.select-grid select,
.select-grid .panel-action,
.chips .option-chip,
.chips .strength-chip {
  display: inline-block;
  width: calc(50% - 5px);
  height: 34px;
  line-height: 32px;
  margin: 0 10px 8px 0;
  padding: 0 6px;
  border: 1px solid rgba(238, 206, 102, 0.42);
  background: #161616;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.select-grid select:nth-child(2n),
.select-grid .panel-action:nth-child(2n),
.chips .option-chip:nth-child(2n),
.chips .strength-chip:nth-child(2n) {
  margin-right: 0;
}

.option-chip.active,
.strength-chip.active {
  background: var(--olive-2);
  color: #fff;
}

.check-item {
  display: inline-block;
  width: 50%;
  height: 26px;
  line-height: 26px;
  font-size: 12px;
  color: var(--text);
}

.feature-note-card strong,
.feature-note-card span {
  display: block;
}

.feature-note-card span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 18px;
}

.progress-card {
  min-height: 150px;
  padding: 12px;
  border: 1px solid rgba(238, 206, 102, 0.42);
  background: #020302;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 20px;
}

.progress-head span,
.progress-head strong {
  display: block;
}

.progress-head strong {
  text-align: right;
}

.progress-track {
  display: block;
  width: 100%;
  height: 4px;
  margin: 6px 0 14px;
  background: #303030;
  overflow: hidden;
}

#progressBar {
  width: 0;
  height: 4px;
  background: var(--gold);
}

.log-line {
  min-height: 58px;
  padding-top: 10px;
  border-top: 1px solid rgba(238, 206, 102, 0.18);
  color: #e7d8a1;
  line-height: 19px;
  text-align: center;
}

.log-line.error {
  color: #ff6767;
}

.result-list {
  display: block;
  width: 100%;
}

.result-list.empty {
  display: none;
}

.result-item {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px;
  border: 1px solid rgba(238, 206, 102, 0.28);
}

.result-item img {
  display: block;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  object-fit: cover;
}

.result-item span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 10px;
  color: var(--text);
  word-break: break-all;
}

@media (max-width: 370px) {
  .plugin-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand-logo {
    max-width: 78%;
  }

  .category-tabs {
    width: 96px;
    min-width: 96px;
    padding-right: 8px;
  }

  .feature-grid {
    padding-left: 10px;
  }

  .feature-button {
    width: 100%;
    margin-right: 0;
  }

  .slider-row label {
    width: 72px;
  }

  .slider-row .slider-value {
    left: 78px;
    width: 54px;
  }

  .xhn-slider {
    margin-left: 144px;
  }
}
