:root {
  --bg: #0c1412;
  --bg-card: #141f1c;
  --border: #243530;
  --text: #e8f0ec;
  --muted: #8aa399;
  --accent: #3ecf8e;
  --accent-dim: #2a8f5f;
  --warning: #e8c547;
  --danger: #e85d5d;
  --radius: 12px;
  --font: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 20, 18, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #1a5c40);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.auth-zone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.balance-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
}
.balance-pill strong {
  color: var(--accent);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.45rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #041208;
  font-weight: 600;
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.search-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.search-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-input-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
.search-input-wrap input:focus {
  outline: 2px solid var(--accent-dim);
  border-color: transparent;
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 40;
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.suggest.open {
  display: block;
}
.suggest button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.suggest button:last-child {
  border-bottom: none;
}
.suggest button:hover {
  background: rgba(62, 207, 142, 0.12);
}
.suggest-empty {
  padding: 0.65rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.tag-v2 {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(62, 207, 142, 0.2);
  color: var(--accent);
  vertical-align: middle;
  margin-left: 0.35rem;
}

.prompt-preview {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: 0.88rem;
  color: var(--muted);
  display: none;
}
.prompt-preview.visible {
  display: block;
}
.prompt-preview strong {
  color: var(--text);
}

.grid-2 {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.report-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.report-list li:last-child {
  border-bottom: none;
}
.report-list li.active {
  background: rgba(62, 207, 142, 0.08);
}
.report-row-main {
  min-width: 220px;
}
.task-progress {
  margin-top: 0.35rem;
  width: 220px;
  max-width: 52vw;
  height: 8px;
  border-radius: 999px;
  background: #1d2a25;
  border: 1px solid var(--border);
  overflow: hidden;
}
.task-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--warning), var(--accent));
  transition: width 0.35s ease;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-queued {
  background: var(--warning);
}
.status-running {
  background: var(--accent);
  animation: pulse 1.2s ease infinite;
}
.status-done {
  background: #5cb85c;
}
.status-failed {
  background: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.report-body {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  min-height: 120px;
}
.report-body.markdown-body h1,
.report-body.markdown-body h2,
.report-body.markdown-body h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.report-body.markdown-body p {
  margin: 0.5rem 0;
}
.report-body.markdown-body blockquote {
  margin: 0.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-dim);
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--accent-dim);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  z-index: 100;
  transition: transform 0.25s ease;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  font-size: 0.95rem;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1rem;
}
.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
}
.modal h3 {
  margin: 0 0 1rem;
}
.modal label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.modal input,
.modal select {
  width: 100%;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.note-foot {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
