:root {
  --bg: #12151a;
  --surface: #1b2129;
  --surface-2: #242c36;
  --text: #e8edf2;
  --muted: #9aa6b2;
  --accent: #c4a35a;
  --accent-press: #a8873f;
  --danger: #d36b6b;
  --ok: #6fad7c;
  --border: #2e3845;
  --tab-h: 56px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  padding-bottom: calc(var(--tab-h) + 16px);
}

.app-header {
  padding: 20px 16px 12px;
  background: linear-gradient(180deg, #1a222c 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.app-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.app-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.page {
  padding: 16px;
  max-width: 560px;
  margin: 0 auto;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1408;
  font-weight: 650;
  font-size: 1rem;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:not(:disabled):active {
  background: var(--accent-press);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  width: auto;
  margin-top: 12px;
}

.hint {
  min-height: 1.25rem;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--danger);
}

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

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tab-h);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.tabbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.tabbar a.active {
  color: var(--accent);
  font-weight: 650;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.card .q {
  font-weight: 600;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.card .a {
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.card .meta {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.empty,
.error-box {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 24px);
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
}
