:root {
  --bg: #11110f;
  --panel: #181814;
  --panel-2: #1f211b;
  --panel-3: #12130f;
  --line: #32362d;
  --line-strong: #4b5343;
  --text: #ece8d9;
  --muted: #a7ad9b;
  --faint: #737b6c;
  --green: #8bd450;
  --cyan: #58c7bd;
  --amber: #e2b45b;
  --rose: #d66a6a;
  --purple: #a88ce8;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 !important;
  min-height: 100vh;
  color: var(--text) !important;
  background:
    linear-gradient(rgba(139, 212, 80, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 212, 80, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(226, 180, 91, 0.10), transparent 34%),
    var(--bg) !important;
  background-size: 36px 36px, 36px 36px, 100% 100%, auto !important;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif !important;
  padding: 26px 16px 46px !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 18%, rgba(0, 0, 0, 0.20));
  z-index: -1;
}

.container {
  width: min(1200px, 100%) !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

.subpage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  font-size: 12px;
}

.subpage-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.subpage-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0d0e0b;
  color: var(--green);
  font-weight: 900;
}

.subpage-title {
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.subpage-path {
  overflow: hidden;
  color: var(--faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subpage-home,
.back,
.back-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: rgba(24, 24, 20, 0.78) !important;
  color: var(--green) !important;
  text-decoration: none !important;
  font-family: "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  font-size: 12px;
  font-weight: 900;
}

.subpage-home:hover,
.back:hover,
.back-link:hover {
  border-color: rgba(139, 212, 80, 0.62) !important;
}

.hero,
.header {
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px !important;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(139, 212, 80, 0.07), transparent 46%),
    linear-gradient(225deg, rgba(88, 199, 189, 0.07), transparent 40%),
    var(--panel) !important;
  box-shadow: var(--shadow) !important;
  padding: 24px !important;
}

.header {
  margin-bottom: 14px;
}

.badge {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 10px !important;
  border: 1px solid rgba(139, 212, 80, 0.28) !important;
  border-radius: 8px !important;
  background: rgba(139, 212, 80, 0.08) !important;
  color: var(--green) !important;
  font-family: "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

h1,
h2,
h3,
.panel-title,
.section-title,
.persona-name,
.poem-line {
  color: var(--text) !important;
  letter-spacing: 0 !important;
}

h1 {
  margin: 14px 0 8px !important;
  font-size: clamp(28px, 4.6vw, 48px) !important;
  line-height: 1.08 !important;
}

.subtitle,
.panel-subtitle,
.hint,
.muted,
.footer,
.emotion,
.poem-source,
.signature,
.card p,
.app p {
  color: var(--muted) !important;
}

.grid,
.split-layout {
  gap: 14px !important;
  margin-top: 18px !important;
}

.panel,
.card,
.section-card,
.share-box,
.debug-box,
.result-box,
.api-info,
.day,
.menu-item,
.record {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: var(--panel-2) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.panel,
.card,
.section-card,
.result-box,
.api-info {
  padding: 16px !important;
}

.panel-header {
  align-items: flex-start !important;
  gap: 12px;
}

textarea,
input,
select,
.password-input {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #10110e !important;
  color: var(--text) !important;
  outline: none !important;
  box-shadow: inset 0 0 0 1px rgba(139, 212, 80, 0.03);
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(139, 212, 80, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(139, 212, 80, 0.10) !important;
}

button,
.btn {
  min-height: 38px;
  border: 1px solid rgba(139, 212, 80, 0.44) !important;
  border-radius: 8px !important;
  background: rgba(139, 212, 80, 0.12) !important;
  color: var(--green) !important;
  box-shadow: none !important;
  font-family: "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  font-size: 12px !important;
  font-weight: 900 !important;
}

button:hover,
.btn:hover {
  border-color: rgba(139, 212, 80, 0.72) !important;
  background: rgba(139, 212, 80, 0.18) !important;
}

button.secondary,
.btn.secondary {
  border-color: var(--line) !important;
  background: #10110e !important;
  color: var(--muted) !important;
}

.tag,
.status-chip,
.real-badge,
.success-badge,
.view-toggle {
  border: 1px solid rgba(139, 212, 80, 0.26) !important;
  border-radius: 8px !important;
  background: rgba(139, 212, 80, 0.08) !important;
  color: var(--green) !important;
  font-family: "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.view-toggle.active {
  border-color: rgba(139, 212, 80, 0.65) !important;
  background: rgba(139, 212, 80, 0.18) !important;
}

.empty-state {
  border: 1px dashed var(--line-strong) !important;
  border-radius: 8px !important;
  color: var(--faint) !important;
  background: #10110e !important;
}

pre,
code,
.debug,
.response-view {
  border-color: var(--line) !important;
  background: #10110e !important;
  color: var(--muted) !important;
}

.url-link,
a {
  color: var(--cyan);
}

.warning {
  border-left-color: var(--amber) !important;
  background: rgba(226, 180, 91, 0.08) !important;
  color: var(--muted) !important;
}

.error,
.risk {
  color: var(--rose) !important;
}

.footer {
  margin-top: 16px !important;
  text-align: center;
  font-family: "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  font-size: 12px !important;
}

@media (max-width: 720px) {
  body {
    padding: 14px 10px 34px !important;
  }

  .subpage-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .subpage-title {
    white-space: normal;
  }

  .hero,
  .header,
  .panel,
  .card,
  .section-card,
  .result-box,
  .api-info {
    padding: 14px !important;
  }

  .panel-header,
  .actions,
  .actions-row {
    align-items: stretch !important;
    flex-direction: column;
  }

  button,
  .btn,
  .subpage-home,
  .back,
  .back-link {
    width: 100%;
  }
}
