:root {
  --bg-1: #f5ece4;
  --bg-2: #f0e2d7;
  --bg-3: #f8f1ea;
  --m-red: #c79a90;
  --m-orange: #d7b29d;
  --m-yellow: #decaab;
  --ink: #433b37;
  --ink-soft: #6b625d;
  --ink-faint: #8a7f78;
  --panel: rgba(255, 255, 255, 0.4);
  --panel-solid: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(255, 255, 255, 0.52);
  --line-soft: rgba(127, 102, 84, 0.22);
  --shadow-soft: 0 18px 48px -30px rgba(54, 38, 26, 0.4);
  --accent: #b07a62;
  --accent-soft: #c99d86;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

html[data-theme="dark"] {
  --bg-1: #2a2622;
  --bg-2: #241f1c;
  --bg-3: #2e2824;
  --ink: #e8ded4;
  --ink-soft: #c2b4a7;
  --ink-faint: #8c7f74;
  --panel: rgba(48, 40, 34, 0.55);
  --panel-solid: rgba(48, 40, 34, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(232, 218, 200, 0.18);
  --shadow-soft: 0 22px 56px -30px rgba(0, 0, 0, 0.6);
  --accent: #d7a489;
  --accent-soft: #b07a62;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--ink);
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 246, 225, 0.72), transparent 34%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  transition: background-color 0.4s ease, color 0.4s ease;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(215, 164, 137, 0.18), transparent 38%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

html[data-theme="dark"] body::before {
  opacity: 0.12;
  mix-blend-mode: overlay;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 12px;
  background: var(--panel-solid);
  color: var(--ink);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 22px 28px;
  animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #f5e4cd 0 18%, transparent 19%),
    conic-gradient(from 210deg, #c99d86, #decaab, #d7b29d, #c99d86);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 4px 10px -6px rgba(80, 52, 32, 0.5);
}

.brand-word {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav a,
.lang-switch button,
.icon-btn,
.primary-btn,
.ghost-btn {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.25s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 16px -14px rgba(70, 48, 34, 0.7);
}

.nav a.active {
  background: var(--panel-solid);
  box-shadow: inset 0 0 0 1px var(--line-soft), 0 6px 14px -12px rgba(70, 48, 34, 0.7);
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nav a:focus-visible,
.lang-switch button:focus-visible,
.icon-btn:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
textarea:focus-visible,
input:focus-visible,
.chip:focus-visible,
.suggest-item:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.nav a:hover,
.lang-switch button:hover,
.icon-btn:hover,
.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  background: var(--panel-solid);
}

.primary-btn {
  background: linear-gradient(150deg, #b07a62, #8f5d49);
  color: #f8ece0;
  border-color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.09em;
}

.primary-btn:hover {
  background: linear-gradient(150deg, #bd8670, #9a6651);
}

html[data-theme="dark"] .primary-btn {
  background: linear-gradient(150deg, #c88f74, #9b6a53);
  color: #1e1a17;
}

.lang-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}

.lang-switch button {
  border: none;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
}

.lang-switch button.active {
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(124%);
  padding: 34px;
  overflow: hidden;
  animation: sundial 120s linear infinite, fadeUp 0.9s ease both;
  box-shadow: var(--shadow-soft);
}

@keyframes sundial {
  0%   { box-shadow: 0 -28px 40px -28px rgba(201, 157, 145, 0.4), 0 20px 36px -20px rgba(0, 0, 0, 0.1); }
  25%  { box-shadow: 28px 0 40px -28px rgba(216, 178, 154, 0.42), 0 20px 36px -20px rgba(0, 0, 0, 0.1); }
  50%  { box-shadow: 0 28px 40px -28px rgba(223, 198, 159, 0.45), 0 20px 36px -20px rgba(0, 0, 0, 0.1); }
  75%  { box-shadow: -28px 0 40px -28px rgba(201, 157, 145, 0.42), 0 20px 36px -20px rgba(0, 0, 0, 0.1); }
  100% { box-shadow: 0 -28px 40px -28px rgba(201, 157, 145, 0.4), 0 20px 36px -20px rgba(0, 0, 0, 0.1); }
}

.hero-eyebrow {
  display: block;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 5.6vw, 58px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-align: center;
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 28px;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-align: center;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.38));
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 10px 24px -20px rgba(61, 44, 31, 0.55);
}

html[data-theme="dark"] .panel {
  background: linear-gradient(160deg, rgba(58, 48, 40, 0.65), rgba(44, 36, 30, 0.45));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 28px -20px rgba(0, 0, 0, 0.6);
}

.panel h3 {
  margin: 0 0 13px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.query-wrapper {
  position: relative;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  background: var(--panel-solid);
  color: var(--ink);
  outline: none;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: 0.2s ease;
}

html[data-theme="dark"] textarea,
html[data-theme="dark"] input {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea:focus,
input:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(176, 122, 98, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

textarea {
  min-height: 170px;
  resize: vertical;
}

.input-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kbd kbd {
  font: inherit;
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink-soft);
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--panel-solid);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 56px -28px rgba(60, 40, 24, 0.35);
  padding: 6px;
  display: none;
  z-index: 8;
  backdrop-filter: blur(14px);
}

.suggest.show { display: block; }

.suggest-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  border: none;
  width: 100%;
  background: transparent;
  text-align: left;
}

.suggest-item:hover,
.suggest-item.active {
  background: rgba(176, 122, 98, 0.12);
}

.suggest-key {
  font-weight: 400;
  letter-spacing: 0.04em;
}

.suggest-meta {
  color: var(--ink-faint);
  font-size: 12px;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card {
  min-height: 170px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: var(--panel-solid);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-empty {
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  text-align: center;
}

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.result-key {
  font-family: "Cormorant Garamond", serif;
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.result-tag {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(176, 122, 98, 0.14);
  color: var(--accent);
}

.result-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px dashed var(--line-soft);
}

.result-row:first-of-type { border-top: none; padding-top: 0; }

.result-label {
  flex: 0 0 58px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.result-value {
  flex: 1;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.result-loading {
  color: var(--ink-faint);
  font-size: 13px;
}

.result-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-bar {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(176, 122, 98, 0.08), rgba(176, 122, 98, 0.22), rgba(176, 122, 98, 0.08));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-bar.sm { width: 40%; }
.skeleton-bar.md { width: 70%; }
.skeleton-bar.lg { width: 90%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.meta-grid {
  margin-top: 18px;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-solid);
  padding: 7px 13px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.03em;
  transition: 0.2s ease;
}

.chip:hover {
  background: rgba(176, 122, 98, 0.1);
  border-color: var(--accent-soft);
}

.chip-empty {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.donate-actions {
  margin-top: 14px;
}

.section-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(124%);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.9s ease both;
}

.form-row {
  margin-bottom: 14px;
}

.info-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 14px;
  column-gap: 16px;
}

.info-list dt {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 4px;
}

.info-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
}

.footer {
  margin-top: 36px;
  padding: 20px 0 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 14px;
}

.footer a:hover { color: var(--ink); }

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel-solid);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 32px -18px rgba(60, 42, 28, 0.5);
  color: var(--ink);
  font-size: 13px;
  min-width: 220px;
  animation: toastIn 0.3s ease both;
}

.toast.success { border-color: rgba(140, 170, 120, 0.4); }
.toast.error { border-color: rgba(200, 120, 100, 0.45); }

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.not-found {
  text-align: center;
  padding: 60px 20px;
}

.not-found .hero-title { text-align: center; }
.not-found .hero-sub { margin-bottom: 24px; }

@media (max-width: 860px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .hero-card,
  .section-card {
    padding: 22px;
    border-radius: 20px;
  }

  .hero-title {
    font-size: clamp(30px, 11vw, 42px);
  }

  textarea,
  .result-card {
    min-height: 150px;
  }

  .info-list {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .info-list dt { padding-top: 8px; }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}
