:root,
html[data-theme="light"] {
  color-scheme: light;
  --ink: #0b2f2b;
  --muted: #5a736e;
  --line: #c5d8d3;
  --panel: rgba(255, 255, 255, 0.92);
  --card: #ffffff;
  --accent: #1a8a7a;
  --accent-hover: #0a5c54;
  --teal: #0a5c54;
  --teal-deep: #064039;
  --oa: #1a7a4c;
  --warn: #8a6418;
  --danger: #b42318;
  --surface: #f7fbfa;
  --bg: #e8f2ef;
  --bg2: #f7fbfa;
  --input-bg: #ffffff;
  --top-bg: rgba(247, 251, 250, 0.88);
  --shadow: 0 18px 50px rgba(6, 64, 57, 0.12);
  --shadow-accent: rgba(26, 138, 122, 0.22);
  --focus-ring: rgba(26, 138, 122, 0.18);
  --modal-backdrop: rgba(6, 64, 57, 0.35);
  --chip-bg: rgba(255, 255, 255, 0.7);
  --radius: 16px;
  --serif: "IBM Plex Serif", "Source Han Serif SC", "Songti SC", serif;
  --sans: "IBM Plex Sans", "Source Han Sans SC", "PingFang SC", "Noto Sans SC", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef4;
  --muted: #9aa8b5;
  --line: #2a3542;
  --panel: rgba(26, 34, 44, 0.92);
  --card: #1a222c;
  --accent: #2a9d8f;
  --accent-hover: #3cb5a5;
  --teal: #2a9d8f;
  --teal-deep: #1f7a6f;
  --oa: #3ecf8e;
  --warn: #e0b15a;
  --danger: #e35d6a;
  --surface: #0f1419;
  --bg: #0f1419;
  --bg2: #121820;
  --input-bg: #121820;
  --top-bg: rgba(15, 20, 25, 0.88);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --shadow-accent: rgba(42, 157, 143, 0.28);
  --focus-ring: rgba(42, 157, 143, 0.28);
  --modal-backdrop: rgba(0, 0, 0, 0.55);
  --chip-bg: rgba(18, 24, 32, 0.85);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, color-mix(in srgb, var(--teal) 18%, transparent) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg2) 40%, var(--surface));
  line-height: 1.45;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
}
.top__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
}
.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--teal), var(--teal-deep));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand__name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.2;
}
.brand__sub {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}
.top__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.theme-toggle {
  min-height: 2.35rem;
  border-radius: 10px;
  padding: 0.38rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.theme-toggle__label { white-space: nowrap; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.lang-switch__label { color: var(--muted); }
.lang-select,
.lang-switch select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  outline: none;
  min-width: 7.5rem;
}
.lang-switch select:focus,
.lang-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 28px 24px 22px;
  text-align: left;
  animation: rise 0.55s ease both;
}

.headline {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sub {
  margin: 0 0 1.35rem;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.search-bar {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  max-width: 720px;
  animation: rise 0.65s ease 0.05s both;
}
.search-bar input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-search {
  border: none;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-search:hover { background: var(--teal-deep); }
.btn-search:active { transform: translateY(1px); }
.btn-search:disabled { opacity: 0.55; cursor: wait; }

.btn-ghost {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--teal);
  font: inherit;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0;
  max-width: 720px;
  animation: rise 0.7s ease 0.1s both;
}
.ex {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.ex:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--input-bg);
}

.advanced {
  max-width: 720px;
  margin: 1.15rem 0 0;
  text-align: left;
}
.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
  user-select: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before {
  content: "▸ ";
  color: var(--accent);
}
.advanced[open] summary::before { content: "▾ "; }
.advanced-body {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  animation: rise 0.3s ease both;
}
.adv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 720px) {
  .top__inner { align-items: flex-start; flex-direction: column; }
  .top__right { width: 100%; }
}
@media (max-width: 560px) {
  .search-bar { flex-direction: column; }
  .btn-search { padding: 0.75rem 1rem; min-height: 2.75rem; }
  .adv-grid { grid-template-columns: 1fr; }
  .suggest-item { padding: 0.75rem; }
  .suggest-check-wrap { min-height: 2.5rem; }
  .history-tools { flex-wrap: wrap; }
  .history-pager { flex-wrap: wrap; justify-content: center; }
  .profile-card { max-height: 92vh; overflow: auto; width: calc(100vw - 1rem); }
  .auth-card { width: calc(100vw - 1rem); max-height: 92vh; overflow: auto; }
  .hero { padding: 1.25rem 1rem 1.1rem; }
  .lookup { width: calc(100vw - 1.25rem); max-width: none; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .btn-search,
  .dialog-actions .btn-ghost { flex: 1 1 8rem; min-height: 2.75rem; }
  .top__right { gap: 0.45rem; flex-wrap: wrap; }
}
.advanced label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.advanced input[type="text"],
.advanced input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  padding: 0.55rem 0.65rem;
  outline: none;
}
.advanced input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: var(--ink) !important;
  font-size: 0.9rem !important;
}
.ai-status {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.prepare-status {
  margin: 0.85rem 0 0;
  max-width: 720px;
  text-align: left;
  color: var(--muted);
  font-size: 0.95rem;
}
.suggest-panel {
  margin: 1.1rem 0 0;
  max-width: 720px;
  text-align: left;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 92%, var(--accent));
  animation: rise 0.45s ease both;
}
.suggest-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}
.suggest-rationale {
  margin: 0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.suggest-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.suggest-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--input-bg);
}
.suggest-check-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.suggest-label {
  font-weight: 600;
  color: var(--ink);
}
.suggest-focus {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.suggest-query {
  width: 100%;
  border: 1px solid var(--line);
  background: #f7f9fc;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.45rem 0.55rem;
  outline: none;
}
.suggest-query:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.suggest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.95rem;
}
.suggest-actions .btn-search {
  padding: 0.7rem 1.1rem;
}
.ai-panel {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}
.ai-panel p { margin: 0 0 0.45rem; }
.ai-panel p:last-child { margin-bottom: 0; }
.ai-panel code {
  font-size: 0.84em;
  background: var(--chip-bg);
  padding: 0.1rem 0.35rem;
}
.item .why {
  margin: 0.35rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.sources {
  margin: 0.85rem 0 0;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem 0.8rem;
}
.sources legend {
  padding: 0 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.35rem 0.65rem;
}
.source-grid label {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 0.86rem;
}

.lookup-line {
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.linkish {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lookup {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 2rem);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.lookup::backdrop {
  background: var(--modal-backdrop);
}
.lookup form {
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1.35rem;
}
.lookup h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
}
.lookup-hint {
  margin: -0.25rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.lookup-or {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.lookup-tip {
  margin: 0;
  color: var(--accent);
  font-size: 0.84rem;
  line-height: 1.4;
}
.lookup-error {
  margin: 0;
  color: #a12828;
  background: rgba(161, 40, 40, 0.08);
  border: 1px solid rgba(161, 40, 40, 0.25);
  padding: 0.55rem 0.65rem;
  font-size: 0.86rem;
  line-height: 1.4;
}
.lookup-error[hidden] {
  display: none !important;
}
.lookup label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.lookup input {
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  padding: 0.6rem 0.7rem;
}
.dialog-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.url-block {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--chip-bg);
}
.url-tip {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.url-row {
  display: grid;
  gap: 0.2rem;
}
.url-label {
  font-size: 0.78rem;
  color: var(--muted);
}
.url-value {
  color: var(--accent);
  font-size: 0.88rem;
  word-break: break-all;
  text-underline-offset: 3px;
  line-height: 1.35;
}

.results-wrap {
  margin-top: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem 1.5rem;
  animation: rise 0.45s ease both;
}
.results-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
}
.results-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}
.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.list { display: grid; gap: 0; }
.empty {
  color: var(--muted);
  padding: 1.4rem 0;
}

.item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  animation: rise 0.35s ease both;
}
.item-title {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
}
.item-title a {
  color: var(--accent);
  text-decoration: none;
}
.item-title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.35rem;
}
.chip {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  padding: 0.12rem 0.4rem;
  color: var(--muted);
  background: var(--chip-bg);
}
.chip.oa { color: var(--oa); border-color: rgba(26, 122, 76, 0.35); }
.chip.preprint { color: var(--warn); border-color: rgba(138, 100, 24, 0.35); }
.chip.source { color: var(--accent); border-color: var(--shadow-accent); }
.doi {
  margin: 0.15rem 0 0.4rem;
  font-size: 0.84rem;
  color: var(--muted);
  word-break: break-all;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.links a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.foot a { color: var(--accent); }

.user-label {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-auth {
  font-size: 0.85rem;
  min-height: 2.35rem;
  padding: 0.38rem 0.75rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--modal-backdrop);
}
.auth-modal[hidden] { display: none !important; }
.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  position: relative;
  animation: rise 0.35s ease;
  color: var(--ink);
}
.auth-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.auth-card h3 {
  margin: 0 1.5rem 0.35rem 0;
  font-family: var(--serif);
  font-size: 1.35rem;
}
.auth-lead {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.auth-tab {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--muted);
}
.auth-tab.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  color: var(--accent);
  font-weight: 600;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
}
/* display:flex above would otherwise override the HTML hidden attribute */
.auth-form label[hidden],
.auth-form [hidden] {
  display: none !important;
}
.auth-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: var(--input-bg);
  color: var(--ink);
}
.auth-captcha-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
  align-items: stretch;
}
.auth-captcha-image {
  min-width: 108px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6fb center / cover no-repeat;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
}
.auth-captcha-image.has-image { color: transparent; }
.auth-captcha-refresh {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  padding: 0 0.65rem;
  cursor: pointer;
  font-size: 0.8rem;
}
.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.auth-error {
  min-height: 1.2em;
  margin: 0 0 0.75rem;
  color: #b42318;
  font-size: 0.86rem;
}
.auth-submit {
  width: 100%;
  min-height: 3rem;
  margin-top: 0.15rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px var(--shadow-accent);
}
.auth-submit:hover {
  box-shadow: 0 10px 22px var(--shadow-accent);
}
.auth-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--shadow-accent), 0 8px 18px var(--shadow-accent);
}

.profile-card {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
}
.profile-user-card {
  margin: 0.35rem 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid var(--focus-ring);
}
.profile-user-name {
  font-weight: 600;
  font-size: 1.02rem;
}
.profile-user-meta {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.profile-password {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: var(--chip-bg);
}
.profile-password summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}
.change-password-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}
.change-password-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.86rem;
}
.change-password-form input {
  width: 100%;
  min-height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font: inherit;
}
.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.history-head h4 {
  margin: 0;
  font-size: 0.95rem;
}
.history-head .tip {
  font-size: 0.78rem;
  color: var(--muted);
}
.history-tools {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.history-filter {
  flex: 1;
  min-width: 0;
}
.history-filter input {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font: inherit;
}
.history-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: -0.35rem 0 0.85rem;
}
.history-pager .btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 4rem;
  max-height: min(42vh, 22rem);
  overflow: auto;
  margin-bottom: 0.65rem;
  -webkit-overflow-scrolling: touch;
}
.empty-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.history-empty {
  padding: 1rem 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--chip-bg);
}
.history-item-main { flex: 1; min-width: 0; }
.history-open {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  word-break: break-word;
}
.history-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.history-del {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
}
.profile-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.compliance {
  margin: 0.65rem 0 0;
  max-width: 720px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.site-foot {
  margin: 2.5rem auto 0;
  padding: 1.25rem 1.25rem 2rem;
  max-width: 960px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
.site-foot__legal {
  margin: 0 0 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}
.site-foot__legal a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.site-foot__legal a:hover { text-decoration: underline; }
.site-foot__health {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
