:root {
  --bg: #f7f6f2;
  --surface: #fff;
  --ink: #19242b;
  --muted: #7b8689;
  --line: #e8e9e4;
  --green: #1b7064;
  --green-dark: #12584e;
  --green-light: #e9f3ef;
  --orange: #f3a661;
  --shadow: 0 14px 40px rgba(22, 45, 43, 0.045);
  --topbar-height: 80px;
  font-family: var(--app-font);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--topbar-height) + 16px);
  scrollbar-gutter: stable;
}

/* Keep the page at its current position until the last dialog closes. */
html:has(dialog[open]) {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

a {
  text-decoration: none;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.site-shell > main {
  flex: 1 0 auto;
}

.site-shell > .topbar,
.site-shell > .footer {
  flex-shrink: 0;
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 36px 20px;
  background: radial-gradient(ellipse at 50% 0%, #e6efea 0, transparent 62%), var(--bg);
}

.auth-card {
  width: min(100%, 460px);
  padding: 36px;
  border: 1px solid #dfe7e1;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(22, 45, 43, 0.07);
}

.auth-brand {
  display: block;
  width: 160px;
  height: auto;
  margin-bottom: 30px;
}

.auth-card h1 {
  margin: 14px 0 10px;
  font-size: 30px;
  letter-spacing: -1px;
}

.auth-description,
.auth-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.auth-card .field-label {
  margin-top: 18px;
}

.auth-status {
  margin: 20px 0 0;
  color: var(--green);
  line-height: 1.65;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.auth-status:empty {
  display: none;
}

.auth-status.error {
  color: #ac5849;
}

/* 登录页按钮独立固定高度（与输入框一致）和字号，不随共享 .primary-btn 变化 */
.primary-btn.auth-submit {
  width: 100%;
  height: 45px;
  font-size: 15px;
  justify-content: center;
  margin-top: 26px;
}

.auth-note {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
}

.auth-secondary-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}

.auth-text-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 14px;
}

.settings-account-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 26px 22px;
  }
}

.topbar {
  height: 80px;
  padding: 0 max(32px, calc((100vw - 1380px) / 2));
  display: flex;
  align-items: center;
  gap: 40px;
  background: #fff;
  border-bottom: 1px solid #e6e9e4;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar::after {
  content: "";
  width: 150px;
  flex: none;
}

.brand {
  display: flex;
  transform: translateX(20px);
  align-items: center;
  flex: none;
}

.brand-image {
  display: block;
  width: 150px;
  height: 46px;
  object-fit: cover;
  object-position: center;
  border-radius: 0px;
}

.chain-nav {
  display: flex;
  align-items: center;
  gap: 15px;
  height: 100%;
  min-width: 0;
  margin: auto;
}

.nav-pages {
  display: flex;
  align-items: center;
  gap: inherit;
  height: 100%;
  flex-shrink: 0;
}

.nav-search {
  min-width: 0;
  max-width: 100%;
  gap: 8px;
}

.nav-search > .chain-trigger {
  flex-shrink: 0;
}

.chain-item {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.chain-trigger {
  border: 0;
  background: none;
  color: #69767a;
  padding: 14px 15px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
}

.chain-trigger:hover,
.chain-item.active > .chain-trigger,
.chain-trigger[aria-expanded="true"] {
  color: var(--green);
  background: #eef5f1;
}

.chain-item.active > .chain-trigger:before {
  content: "";
  width: 6px;
  height: 6px;
  background: #5aad91;
  border-radius: 50%;
}

.chain-chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s;
}

.chain-trigger[aria-expanded="true"] .chain-chevron {
  transform: rotate(180deg);
}

.chain-menu {
  position: absolute;
  top: calc(100% - 5px);
  left: 0;
  width: 194px;
  padding: 7px;
  border: 1px solid #e0e7df;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 12px 32px rgba(30, 65, 49, 0.12),
    0 2px 6px rgba(30, 65, 49, 0.04);
}

.chain-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #65736c;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition:
    background 0.15s,
    color 0.15s;
}

.chain-option + .chain-option {
  margin-top: 3px;
}
.chain-option img {
  border-radius: 5px;
  border: 1px solid #e0e6d8;
  object-fit: cover;
  flex: none;
}
.chain-option:hover,
.chain-option:focus-visible {
  background: #f4f7f2;
  color: var(--green);
}
.chain-option[aria-checked="true"] {
  background: #edf5ef;
  color: var(--green);
}
.chain-check {
  margin-left: auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}
.chain-option[aria-checked="true"] .chain-check {
  visibility: visible;
}

.narratives-section {
  padding: 24px 0 32px;
  min-height: 60vh;
}

.section-heading.narratives-heading {
  align-items: center;
}

.section-heading.narratives-heading h2 {
  margin: 10px 0 0;
  font-size: 30px;
}

.narratives-description {
  color: #829087;
  font-size: 13px;
  margin: 12px 0 0;
}

.narratives-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 18px;
  font-size: 13px;
  color: #69776f;
}

#narratives-count {
  color: #829087;
}

.narrative-edit-actions #pin-narrative {
  margin-right: auto;
}

.narrative-detail-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.narrative-detail-btn:hover {
  text-decoration: underline;
}

.narrative-detail-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  border-radius: 3px;
}

.narratives-empty {
  text-align: center;
  padding: 64px 20px;
  color: #829087;
  font-size: 13px;
}

.narratives-empty .narrative-detail-btn {
  margin-left: 12px;
}

.narratives-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 20px;
  font-size: 12px;
  color: #829087;
}

.narratives-pagination .secondary-btn {
  height: 36px;
}

.content-modal .modal-card {
  width: min(100vw - 36px, 900px);
  height: min(1040px, calc(100vh - 44px));
  height: min(1040px, calc(100dvh - 44px));
  max-height: calc(100dvh - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-modal .modal-head {
  flex-shrink: 0;
}

.content-modal .modal-head h2 {
  overflow-wrap: anywhere;
}

.narrative-modal #narrative-read,
.narrative-modal #narrative-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.narrative-edit-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.narrative-edit-body > :not(.editor-shell) {
  flex-shrink: 0;
}

.narrative-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 16px;
}

.narrative-fields .field-control {
  margin: 0;
}

.narrative-modal .review-view-content {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  overflow-y: auto;
  overflow-wrap: anywhere;
}

.narrative-modal .modal-actions {
  flex-shrink: 0;
  margin-top: 16px;
  padding-top: 16px;
}

.narrative-actions {
  justify-content: space-between;
}

.narrative-form-status {
  color: #a44e46;
  font-size: 12px;
  min-height: 18px;
}

.narrative-form-status:empty {
  display: none;
}

.narrative-delete-confirm {
  flex-shrink: 0;
  background: #fff7f4;
  border: 1px solid #efd4ca;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: #a44e46;
}

.narrative-delete-confirm p {
  margin: 0 0 14px;
}

.narrative-delete-confirm > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.narrative-image-modal {
  padding: 24px;
  overflow: visible;
}

.narrative-image-modal img {
  display: block;
  max-width: calc(100vw - 64px);
  max-height: calc(100dvh - 100px);
  object-fit: contain;
  border-radius: 8px;
}

.narrative-image-modal .close-btn {
  position: absolute;
  right: 12px;
  top: -20px;
  background: #fff;
}

@media (max-width: 650px) {
  .narratives-nav-item {
    margin-left: 12px;
  }

  .narratives-heading {
    gap: 16px;
    flex-wrap: wrap;
  }

  .section-heading.narratives-heading h2 {
    font-size: 26px;
  }

  .narratives-filters {
    gap: 8px;
  }

  .narrative-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.primary-btn,
.secondary-btn {
  height: 36px;
  padding: 0 17px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: nowrap;
  transition: 0.2s;
}

.primary-btn {
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  box-shadow: 0 5px 12px rgba(24, 112, 99, 0.13);
}

.primary-btn:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.secondary-btn {
  background: #fff;
  color: #4f5f61;
  border: 1px solid #dfe5e0;
}

.secondary-btn:hover {
  border-color: #aebeb5;
  background: #f7faf7;
}

.main-content {
  max-width: 1380px;
  margin: auto;
  padding: 0 32px 95px;
}

.intro {
  padding: 0 32px;
  background: #f7f6f2;
  border-bottom: 1px solid #e6e9e4;
}

.intro-image {
  display: block;
  width: 100%;
  max-width: 1316px;
  height: auto;
  margin: 0 auto;
}

.section-kicker,
.modal-kicker {
  font-family: var(--app-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-search-panel {
  width: 320px;
  min-width: 0;
  flex: 0 1 320px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e4e8e1;
  border-radius: 10px;
  box-shadow: 0 6px 22px rgba(31, 61, 52, 0.035);
  padding: 0 8px 0 12px;
  transition: 0.2s;
}

.nav-search-panel:focus-within {
  border-color: #96bfae;
  box-shadow: 0 0 0 4px #e8f3eb;
}

.nav-search-panel > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--green);
}

.nav-search-panel input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
}

.nav-search-panel input::placeholder {
  color: #a8b0ae;
}

.nav-search-close {
  width: 30px;
  height: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  border: 0;
  border-radius: 8px;
  background: #f1f4f1;
  color: #829089;
  font-size: 21px;
  line-height: 1;
  transition:
    background 0.2s,
    color 0.2s;
}

.nav-search-close:hover {
  background: #e7eee8;
  color: var(--green);
}

.archive-section {
  padding-top: 32px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 22px;
}

.section-kicker {
  color: #9caeaa;
  gap: 10px;
}

.section-kicker span {
  width: 23px;
  height: 1px;
  background: #c8d1ca;
}

.section-heading h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin: 9px 0 0;
}

.archive-year-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.archive-year-control select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 29px 2px 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.archive-year-control select:hover {
  background: var(--green-light);
  color: var(--green);
}

.archive-year-control select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.archive-year-control select option {
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.archive-year-control svg {
  position: absolute;
  right: 8px;
  width: 15px;
  height: 15px;
  color: var(--green);
  pointer-events: none;
}

.summary-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #9ca8a5;
  font-size: 12px;
}

.summary-count strong {
  font: 600 25px var(--app-font);
  color: var(--green);
}

.archive-grid {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}

.months-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 14px 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--topbar-height) + 22px);
}

.months-title {
  display: flex;
  justify-content: space-between;
  padding: 0 11px 17px;
  color: #94a19e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.months-title span {
  font: 600 12px var(--app-font);
  color: #c1cbc5;
}

.month-all,
.month-item {
  width: 100%;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 0 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6d7b7b;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.month-all b,
.month-item b {
  font: 500 11px var(--app-font);
  color: #b8c5bd;
}

.month-all.active,
.month-item.active {
  background: #eaf4ef;
  color: var(--green);
}

.month-all.active b,
.month-item.active b {
  color: var(--green);
}

.month-all:hover,
.month-item:hover {
  background: #f3f7f3;
}

.month-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef0ec;
}

.sidebar-note {
  border-top: 1px solid #edf0eb;
  margin: 17px 0 1px;
  padding-top: 15px;
  min-width: 0;
}

.sidebar-note img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto; /* 水平居中 */
  border-radius: 8px;
}

.tokens-area {
  min-width: 0;
}

.token-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.token-card {
  container: meme-card / inline-size;
  position: relative;
  background: #fff;
  border: 1px solid #edf1f2;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.035);
  padding: 22px 24px 16px;
  font-family: var(--app-font);
  color: #0f172a;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  overflow: hidden;
}

.token-card:hover {
  border-color: #d5e5df;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.token-tier-icon {
  display: block;
  flex: none;
  width: 76px;
  height: 36px;
  object-fit: contain;
  user-select: none;
}

.token-card-main {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  flex: none;
  object-fit: cover;
  border: 1px solid #edf1f2;
  background: #eaf3ef;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  font: 600 22px var(--app-font);
  color: var(--green);
  background: linear-gradient(135deg, #edf6ee, #d9e9e0);
}

.token-card-main > .avatar {
  height: 100%;
  align-self: stretch;
  contain: size;
}

.token-copy {
  min-width: 0;
  min-height: 80px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
}

.token-topline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.token-fullname {
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-symbol {
  font-family: var(--app-font);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 700;
  color: #0f172a;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chain-badge {
  font: 600 11px/1.4 var(--app-font);
  padding: 6px 9px;
  border-radius: 7px;
  color: #087f70;
  background: #e6f3ef;
  flex: none;
  white-space: nowrap;
}

.token-fact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 180px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #f2f4f5;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-ath {
  background: #edf2f2;
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
}

.token-contract-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  min-width: 0;
}

/* Align visible glyphs with the avatar edge, accounting for lower line-box whitespace. */
#token-list .token-contract-row {
  transform: translateY(4px);
}

.token-quote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(210px, 100%);
  overflow: hidden;
  color: #087f70;
  font: 500 12px/1.5 var(--app-font);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.token-quote-rwa {
  cursor: pointer;
  border-bottom: 1px dotted currentColor;
  outline-offset: 3px;
}

.token-quote-rwa:focus-visible {
  outline: 2px solid #1b7164;
  border-radius: 2px;
}

.rwa-tooltip {
  position: fixed;
  z-index: 10000;
  width: min(340px, calc(100vw - 24px));
  padding: 15px 17px;
  border: 1px solid #c7ddd1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(20, 58, 47, 0.17);
  color: #364d43;
  font-size: 13px;
  line-height: 1.55;
  pointer-events: none;
}

.rwa-tooltip[hidden] {
  display: none;
}

.rwa-tooltip-kicker {
  margin-bottom: 9px;
  color: #1b7164;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rwa-tooltip dl,
.rwa-tooltip dd {
  margin: 0;
}

.rwa-tooltip dl {
  display: grid;
  gap: 7px;
}

.rwa-tooltip dl div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
}

.rwa-tooltip dt {
  color: #8b9c93;
}

.rwa-tooltip dd {
  overflow-wrap: anywhere;
}

.token-address {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: #6b7280;
  font: 400 12px/1.5 var(--app-font);
  letter-spacing: 0;
  font-variant-ligatures: none;
}

.token-address:hover {
  color: var(--green);
}

.token-address svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.token-actions {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-left: 0;
  flex: none;
}

.token-refresh-btn,
.gmgn-link,
.x-search-link,
.x-link {
  height: 38px;
  width: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #e5ebed;
  border-radius: 9px;
  color: #64748b;
  background: #fff;
  font: 400 18px var(--app-font);
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.token-refresh-btn {
  flex: none;
  padding: 0;
  background: #fff;
  color: var(--green);
}

.token-refresh-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.token-refresh-btn:not(:disabled):active {
  transform: scale(0.94);
}

.token-refresh-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.token-refresh-btn[aria-busy="true"] .token-refresh-icon {
  animation: token-refresh-spin 1s linear infinite;
}

@keyframes token-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .token-refresh-btn[aria-busy="true"] .token-refresh-icon {
    animation: none;
  }
}

.gmgn-link {
  width: auto;
  padding: 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
}

.x-search-link {
  color: var(--green);
}

.x-search-link svg {
  width: 18px;
  height: 18px;
}

.token-refresh-icon {
  display: block;
  width: 13px;
  height: 13px;
  object-fit: contain;
  transform-origin: center;
}

.token-refresh-btn:not(:disabled):hover,
.gmgn-link:hover,
.x-search-link:hover,
.x-link:hover {
  background: #eef4f0;
  color: var(--green);
  border-color: #cce0d1;
}

.x-link.disabled {
  opacity: 0.35;
  cursor: default;
}

#review-header .review-links {
  flex-wrap: wrap;
}

#review-header .review-x-link {
  min-width: 44px;
  font-size: 16px;
}

#review-header .review-x-link.is-disabled {
  opacity: 0.35;
  cursor: default;
  background: var(--review-surface);
}

.review-btn {
  height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid #d4e9e1;
  background: #f1f8f5;
  color: var(--green);
  font-family: var(--app-font);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.review-btn:hover {
  background: #e8f4eb;
}

.token-meta {
  border-top: 1px solid #edf1f2;
  margin: 20px 0 0;
  padding: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.token-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.tag-pill {
  min-height: 28px;
  max-width: 100%;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #1e293b;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--app-font);
  font-weight: 400;
  line-height: 1.4;
  background: #0f172a;
  color: #ffffff;
}

.tag-pill:before {
  content: "";
  width: 5px;
  height: 5px;
  background: #6ee7b7;
  border-radius: 50%;
  flex: none;
}

.tag-pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.no-tags {
  color: #c2cac5;
  font-size: 11px;
}

.token-card .no-tags {
  color: #94a3b8;
  font-size: 12px;
}

.created-date {
  flex: none;
  margin-left: auto;
  color: #64748b;
  font: 500 12px/1.5 var(--app-font);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.created-date strong {
  font-weight: 400;
  color: #64748b;
  margin-right: 10px;
}

.token-card :is(button, a, [data-rwa-token]):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

@container meme-card (max-width: 820px) {
  .token-card-main {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  .token-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@container meme-card (max-width: 520px) {
  .token-card-main {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
  }
  .avatar {
    width: 64px;
    height: 64px;
  }
  .token-copy {
    min-height: 64px;
  }
  .token-topline {
    gap: 6px;
  }
  .token-meta {
    align-items: flex-start;
  }
}

.search-context {
  font-size: 12px;
  color: #9aa6a0;
  margin-bottom: 10px;
}

.empty-state {
  min-height: 330px;
  border: 1px dashed #d8e4d9;
  background: rgba(255, 255, 255, 0.68);
  border-radius: 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}

.empty-art {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: #e8f3eb;
  display: grid;
  place-items: center;
  color: #75b69a;
  font-size: 30px;
  transform: rotate(-8deg);
}

.empty-art span {
  transform: rotate(8deg);
}

.empty-state h3 {
  font-size: 17px;
  margin: 19px 0 6px;
}

.empty-state p {
  color: #9aa7a1;
  font-size: 12px;
  margin: 0 0 22px;
  line-height: 1.7;
}

.footer {
  height: 86px;
  background: #fff;
  border-top: 1px solid #e9ede8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 max(32px, calc((100vw - 1380px) / 2));
  font: 600 10px var(--app-font);
  letter-spacing: 0.12em;
  color: #b5c1b9;
}

.footer span:first-child {
  color: #7fa998;
}

.settings-dock {
  --dock-bottom: 110px;
  position: fixed;
  right: 16px;
  bottom: var(--dock-bottom);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.settings-trigger {
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  filter: drop-shadow(0 5px 9px rgba(0, 153, 119, 0.24));
  transition:
    filter 0.2s,
    transform 0.2s;
}

.settings-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.settings-trigger:hover,
.settings-trigger[aria-expanded="true"] {
  filter: drop-shadow(0 6px 13px rgba(0, 204, 153, 0.4));
  transform: translateY(-2px);
}

.scroll-controls {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.scroll-controls::before,
.scroll-controls::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.scroll-controls::before {
  width: 42px;
  height: 2px;
  background: rgba(42, 117, 97, 0.2);
}

.scroll-controls::after {
  width: 9px;
  height: 3px;
  background: #f5fffd;
  box-shadow: 0 0 7px #4fffd3;
}

.go-to-bottom,
.back-to-top {
  position: relative;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background:
    radial-gradient(circle at 25% 12%, #fff, rgba(255, 255, 255, 0) 58%) padding-box,
    linear-gradient(140deg, #f5fdf8 10%, #dceee4 50%, #b8f9e6 85%, #fafffc) padding-box,
    conic-gradient(
        from -35deg,
        #00736a,
        #00e6bc 18%,
        #effff9 28%,
        #007469 49%,
        #00d6ad 65%,
        #e6fff5 77%,
        #00736a
      )
      border-box;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.95),
    inset 0 -4px 8px rgba(0, 223, 177, 0.16),
    0 7px 15px rgba(0, 102, 88, 0.18),
    0 0 22px rgba(0, 232, 177, 0.2);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.go-to-bottom::before,
.back-to-top::before,
.go-to-bottom::after,
.back-to-top::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.go-to-bottom::before,
.back-to-top::before {
  inset: -6px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(143, 211, 189, 0.16);
}

.go-to-bottom::after,
.back-to-top::after {
  inset: -8px;
  border: 2px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.9);
  border-left-color: rgba(255, 255, 255, 0.4);
  transform: rotate(-28deg);
}

.go-to-bottom img,
.back-to-top img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(28%) sepia(44%) saturate(1371%) hue-rotate(131deg)
    brightness(96%) contrast(102%);
}

.back-to-top img {
  transform: rotate(180deg);
}

.go-to-bottom:hover,
.back-to-top:hover {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.95),
    inset 0 -4px 8px rgba(0, 223, 177, 0.2),
    0 8px 18px rgba(0, 102, 88, 0.22),
    0 0 28px rgba(0, 232, 177, 0.32);
  transform: translateY(-1px);
}

.settings-trigger:focus-visible,
.go-to-bottom:focus-visible,
.back-to-top:focus-visible,
.nav-search > .chain-trigger:focus-visible,
.nav-search-close:focus-visible {
  outline: 3px solid #79b7a5;
  outline-offset: 3px;
}

.settings-menu {
  position: absolute;
  right: calc(100% + 12px);
  bottom: 0;
  width: min(260px, calc(100vw - 140px));
  max-height: calc(100dvh - var(--dock-bottom) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 9px;
  border: 1px solid #e2e9e3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(22, 51, 39, 0.18);
}

.settings-menu-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 10px 13px;
  color: #6f8079;
  font-size: 11px;
  font-weight: 700;
}

.settings-menu-title span {
  color: #a8b8ae;
  font: 700 9px var(--app-font);
  letter-spacing: 0.1em;
}

.settings-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #2d3d38;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.settings-menu button:hover,
.settings-menu button:focus-visible {
  background: #eff7f1;
  color: var(--green);
}

.settings-menu-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eaf3ed;
  color: var(--green);
  font-size: 17px;
}

.settings-menu button small {
  display: block;
  margin-top: 2px;
  color: #98a69e;
  font-size: 10px;
  font-weight: 500;
}

.settings-menu-arrow {
  margin-left: auto;
  color: #a3b2a9;
}

.modal {
  border: 0;
  background: transparent;
  padding: 22px;
  max-width: none;
  max-height: none;
  color: var(--ink);
}

/* Stop editor scroll gestures at their boundary instead of chaining outward. */
.modal,
.modal .modal-card,
.modal .review-editor,
.modal .tiptap-host,
.modal .review-view-content,
.modal .narrative-edit-body,
.modal .review-tags-section {
  overscroll-behavior: contain;
}

.modal::backdrop {
  background: rgba(14, 32, 31, 0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(100vw - 36px, 520px);
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e5eae5;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(5, 29, 22, 0.18);
  padding: 28px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 27px;
}

.modal-kicker {
  font-size: 10px;
}

.modal-head h2 {
  font-size: 24px;
  margin: 9px 0 5px;
  letter-spacing: -0.04em;
}

.modal-head p {
  font-size: 12px;
  line-height: 1.6;
  color: #98a6a0;
  margin: 0;
}

/* 弹窗关闭按钮：白底细边框浮于背景之上，叉号用两条线绘制，任何字体下都清晰居中 */
.close-btn {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d5e0d9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(5, 29, 22, 0.08);
  color: #3f564d;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition:
    background 160ms,
    border-color 160ms,
    color 160ms,
    transform 120ms;
}

.close-btn::before,
.close-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-btn:hover {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
}

.close-btn:active {
  transform: scale(0.94);
}

.close-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.field-label {
  display: block;
  font-size: 12px;
  color: #4e5d59;
  font-weight: 700;
  margin: 17px 0 9px;
}

.field-control {
  height: 45px;
  width: 100%;
  padding: 0 13px;
  border: 1px solid #dfe7df;
  border-radius: 9px;
  background: #fbfcfa;
  color: var(--ink);
  outline: 0;
  font-size: 18px;
}

.field-control:focus {
  border-color: #8ab9a0;
  box-shadow: 0 0 0 3px #eaf4eb;
}

.field-hint {
  font-size: 11px;
  color: #9eaaa4;
  line-height: 1.6;
  margin: 10px 0 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #eef1ed;
  padding-top: 21px;
  margin-top: 25px;
}

.modal-actions .primary-btn,
.modal-actions .secondary-btn {
  height: 39px;
}

.sync-modal .modal-card {
  width: min(100vw - 36px, 640px);
}

.sync-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sync-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid #e5ebe6;
  border-radius: 13px;
  background: #fbfcfa;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.sync-row.active {
  border-color: #8fbeac;
  background: #f2f8f4;
}

.sync-row.failed {
  border-color: #efd4ce;
  background: #fff9f7;
}

.sync-chain-icon {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #e0e6d8;
  background: #e8f2ec;
}

.sync-row-main {
  min-width: 0;
}

.sync-row-title {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
}

.sync-row-title strong {
  color: #263a33;
  font-size: 13px;
}

.sync-row-title span {
  color: #94a49b;
  font-size: 10px;
  white-space: nowrap;
}

.sync-status {
  margin: 4px 0 0;
  color: #7f8f87;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sync-progress {
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: #dfeae3;
}

.sync-progress span {
  display: block;
  height: 100%;
  width: var(--sync-progress, 10%);
  border-radius: inherit;
  background: var(--green);
  transition: width 0.25s;
}

.sync-progress.indeterminate span {
  width: 35%;
  animation: sync-loading 1.1s ease-in-out infinite alternate;
}

@keyframes sync-loading {
  from {
    transform: translateX(-40%);
  }
  to {
    transform: translateX(190%);
  }
}

.sync-button {
  height: 34px;
  min-width: 60px;
  padding: 0 12px;
  border: 1px solid #267466;
  border-radius: 9px;
  background: #fff;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.sync-button:hover:not(:disabled) {
  background: var(--green);
  color: #fff;
}

.sync-button:disabled {
  border-color: #dce4df;
  background: #f1f4f1;
  color: #9da9a2;
  cursor: wait;
}

.sync-hint {
  display: flex;
  gap: 9px;
  margin: 16px 2px 0;
  color: #87968e;
  font-size: 11px;
  line-height: 1.6;
}

.sync-hint > span:first-child {
  color: #e19a62;
}

.years-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.year-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid #e8eee8;
  border-radius: 11px;
  background: #fafcf9;
}

.year-row strong {
  display: block;
  color: #244f41;
  font: 700 16px var(--app-font);
}

.year-row small {
  display: block;
  margin-top: 3px;
  color: #9aa9a0;
  font-size: 10px;
}

.year-row button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #efded7;
  border-radius: 7px;
  background: #fff;
  color: #a45d4f;
  font-size: 11px;
  font-weight: 700;
}

.year-row button:hover:not(:disabled) {
  background: #fff1ec;
}

.year-row button:disabled {
  border-color: #e9edeb;
  color: #acb7b0;
  cursor: not-allowed;
}

.add-year-form {
  margin-top: 18px;
}

.add-year-form .field-label {
  margin-top: 0;
}

.add-year-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.add-year-row .field-control {
  min-width: 0;
  flex: 1;
}

.add-year-row .primary-btn {
  height: 45px;
}

.year-settings-hint {
  margin: 11px 0 0;
  color: #9aa9a0;
  font-size: 11px;
  line-height: 1.6;
}

.tag-management-modal .modal-card {
  width: min(100vw - 36px, 620px);
}

.tag-management-head {
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 20px;
}

.tag-management-head > p {
  flex-basis: 100%;
}

.tag-management-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: none;
  max-width: 100%;
}

.tag-management-head-actions select {
  min-width: 0;
  width: 106px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dfe7df;
  border-radius: 8px;
  background: #fbfcfa;
  color: #236d60;
  font-size: 13px;
  font-weight: 700;
}

.tag-management-head-actions select:focus-visible,
.tag-management-row button:focus-visible,
.tag-management-confirm button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.tag-management-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: min(48vh, 460px);
  overflow-y: auto;
}

.tag-management-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e7ede8;
  border-radius: 12px;
  background: #fbfcfa;
}

.tag-management-row img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #e0e6d8;
}

.tag-management-row-copy strong {
  display: block;
  color: #244f41;
  font-size: 14px;
}

.tag-management-row-copy small {
  display: block;
  margin-top: 4px;
  color: #93a29a;
  font-size: 11px;
}

.tag-management-row button {
  height: 34px;
  padding: 0 11px;
  border: 1px solid #ebd4cd;
  border-radius: 8px;
  background: #fffaf8;
  color: #a45849;
  font-size: 11px;
  font-weight: 700;
}

.tag-management-row button:hover:not(:disabled) {
  background: #fff0eb;
}

.tag-management-row button:disabled {
  border-color: #e9edeb;
  background: #f7f9f6;
  color: #aeb9b1;
  cursor: not-allowed;
}

.tag-management-confirm {
  margin-top: 17px;
  padding: 16px;
  border: 1px solid #ecd5cd;
  border-radius: 12px;
  background: #fff9f6;
}

.tag-management-confirm[hidden] {
  display: none;
}

.tag-management-confirm strong {
  color: #8b493d;
  font-size: 13px;
}

.tag-management-confirm p {
  margin: 7px 0 13px;
  color: #8d7972;
  font-size: 11px;
  line-height: 1.7;
}

.tag-management-confirm > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tag-management-confirm button {
  height: 36px;
}

.field-row-title {
  height: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #596a62;
}

.field-row-title span:last-child:not(:first-child) {
  color: #a9b5ac;
  font-weight: 400;
  font-size: 11px;
}

.editor-shell {
  border: 1px solid var(--review-line);
  border-radius: var(--review-radius);
  overflow: hidden;
}

:is(.review-view-content, .simple-editor) img {
  cursor: zoom-in;
  display: inline-block !important;
  width: var(--rich-image-width, 0px) !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  vertical-align: middle;
  margin: 8px 0;
  border-radius: 8px;
  object-fit: contain;
  border: 0;
  outline: 1px solid #dfe8e1;
  background: #fff;
  box-shadow: 0 4px 14px rgba(19, 55, 45, 0.07);
}

.review-editor img:hover,
.review-view-content img:hover,
.review-view-content img:focus-visible {
  border-color: var(--green);
  outline: 2px solid #b6d9ca;
  outline-offset: 2px;
}

.review-image-preview[hidden] {
  display: none;
}

.review-image-preview {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 24, 23, 0.82);
  pointer-events: none;
}

.review-image-preview.is-pinned {
  pointer-events: auto;
}

.review-image-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

.review-image-preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.review-image-preview.is-pinned .review-image-preview-close {
  display: grid;
}

.review-editor a,
.review-view-content a {
  color: var(--green);
  text-decoration: underline;
}

.review-tag-name {
  position: relative;
  min-width: 1em;
  color: inherit;
  font-family: inherit;
  font-weight: inherit;
  font-size: 13px;
  line-height: 1.5;
}

/* Hidden text measures the actual glyphs without font downloads or JS layout reads. */
.review-tag-name::after {
  content: attr(data-value) " ";
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  visibility: hidden;
  pointer-events: none;
}

.review-tag-name textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
}

.review-tag-chip button {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9aa9a0;
  font-size: 17px;
  line-height: 1;
}

.review-tag-chip [data-remove-tag]:hover {
  background: #f8ecea;
  color: #a34c41;
}

.review-tag-chip .tag-drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
  display: grid;
  place-items: center;
  flex: none;
  color: #9aa9a0;
}

.tag-drag-handle svg {
  width: 12px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.review-tag-chip .tag-drag-handle:hover {
  color: var(--green);
}

.review-tag-chip button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.review-tag-chip .tag-drag-handle:active {
  cursor: grabbing;
}

.review-tag-chip.is-dragging {
  opacity: 0.35;
}

.review-tag-chip.drop-before:before,
.review-tag-chip.drop-after:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--green);
}

.review-tag-chip.drop-before:before {
  top: -6px;
}
.review-tag-chip.drop-after:after {
  bottom: -6px;
}

.tag-drag-ghost {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 8px 22px rgba(25, 66, 52, 0.16);
}

.review-tags-section button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.inline-tag-form {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-tag-form input {
  width: min(220px, 100%);
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--review-line);
  border-radius: 9px;
  outline-color: var(--green);
  background: #fff;
  color: var(--review-ink);
  font: inherit;
  font-size: 12px;
}

.inline-tag-form button {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--review-line);
  border-radius: 9px;
  background: #fff;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.inline-tag-form button:hover {
  border-color: var(--green);
}

.review-actions {
  justify-content: flex-end;
  flex: none;
  background: transparent;
}

@media (max-height: 650px) {
  .content-modal .modal-card {
    padding: 18px 22px;
  }

  .content-modal .modal-head {
    margin-bottom: 14px;
  }

  .review-actions {
    margin-top: 12px;
    padding-top: 12px;
  }
}

.danger-text {
  background: transparent;
  border: 0;
  color: #e72867;
  font-size: 14px;
  padding: 0;
}

.danger-text:hover {
  color: #ab4d42;
}

.delete-card {
  width: min(100vw - 36px, 460px);
}

.delete-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 12px;
  background: #fff0eb;
  color: #aa5145;
}

.delete-icon svg {
  width: 20px;
  height: 20px;
}

.delete-card h2 {
  margin: 10px 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.delete-card p {
  margin: 0;
  color: #76847e;
  font-size: 13px;
  line-height: 1.75;
}

.delete-subject {
  margin-top: 20px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  border: 1px solid #f0e8e3;
  border-radius: 9px;
  background: #fcfaf8;
  color: #394842;
  font-size: 12px;
  font-weight: 700;
}

.confirm-delete-btn {
  height: 39px;
  padding: 0 18px;
  border: 1px solid #a34c41;
  border-radius: 9px;
  background: #a34c41;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.confirm-delete-btn:hover {
  background: #883a32;
}

.confirm-delete-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.tags-empty {
  font-size: 12px;
  color: #a5b1a8;
  padding: 15px;
  background: #f8faf7;
  border-radius: 8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 15px);
  padding: 11px 16px;
  border-radius: 10px;
  background: #193f36;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #a44e46;
}

@media (max-width: 1100px) {
  .topbar {
    gap: 20px;
    padding: 0 24px;
  }

  .main-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .intro {
    padding-left: 24px;
    padding-right: 24px;
  }

  .chain-trigger {
    padding: 12px 9px;
  }

  .footer {
    padding: 0 24px;
  }
}

@media (max-width: 850px) {
  .topbar {
    height: auto;
    min-height: 75px;
    flex-wrap: wrap;
    gap: 0;
    padding: 14px 20px;
  }

  .brand {
    margin-right: auto;
  }

  .topbar::after {
    display: none;
  }

  .chain-nav {
    order: 3;
    width: 100%;
    height: auto;
    flex-wrap: wrap;
    gap: 8px 16px;
    overflow: visible;
    justify-content: flex-start;
  }

  .nav-pages {
    height: 45px;
  }

  .chain-item {
    height: 45px;
  }

  .chain-trigger {
    white-space: nowrap;
  }

  .archive-grid {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 15px;
  }

  .token-card {
    padding: 20px;
  }

  .token-card-main {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .avatar {
    width: 72px;
    height: 72px;
  }
  .token-copy {
    min-height: 72px;
  }

  .token-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 650px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand-image {
    width: 158px;
    height: 49px;
  }

  .settings-dock {
    --dock-bottom: 102px;
    right: 16px;
  }

  .main-content {
    padding: 0 16px 65px;
  }

  .intro {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sync-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
  }

  .sync-chain-icon {
    width: 36px;
    height: 36px;
    font-size: 9px;
  }

  .nav-search-panel input {
    font-size: 12px;
  }

  .archive-section {
    padding-top: 23px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .archive-grid {
    display: block;
  }

  .months-panel {
    position: static;
    padding: 12px;
    margin-bottom: 14px;
  }

  .months-title,
  .sidebar-note {
    display: none;
  }

  .month-all {
    width: auto;
    flex: none;
    margin-right: 8px;
  }

  .month-list {
    display: flex;
    overflow-x: auto;
    gap: 2px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .month-item {
    width: auto;
    flex: none;
    gap: 8px;
  }

  .months-panel {
    display: flex;
    align-items: center;
    overflow-x: auto;
  }

  .token-card {
    padding: 18px;
    border-radius: 16px;
  }

  .avatar {
    width: 64px;
    height: 64px;
    border-radius: 10px;
  }

  .token-card-main {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
  }

  .token-actions {
    width: 100%;
    justify-content: flex-end;
    margin: 0;
    gap: 8px;
    flex-wrap: wrap;
  }

  .token-topline {
    gap: 6px;
  }

  .token-copy {
    min-height: 64px;
  }

  .token-address {
    margin-top: 2px;
  }

  .token-fact {
    max-width: min(135px, 100%);
  }

  .token-meta {
    margin-top: 16px;
    padding-top: 12px;
    gap: 10px;
  }

  .review-actions {
    gap: 10px;
  }

  .modal {
    padding: 8px;
  }

  .modal-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 20px;
  }

  .content-modal .modal-card {
    width: calc(100vw - 16px);
  }

  .rich-text-editor {
    flex-basis: 280px;
    height: 280px;
    min-height: 280px;
  }

  .footer {
    padding: 0 16px;
    font-size: 8px;
  }
}

.archive-grid.search-mode {
  grid-template-columns: minmax(0, 1fr);
}

/* PC shell and tag editing; shared visual rules live in static/ui/styles.css. */
.content-modal .review-card {
  height: auto;
  padding: 0;
  display: block;
  overflow-y: auto;
}
.review-tags-section:not(.is-managing) .review-tag-chip button {
  display: none;
}
.review-tags-section.is-managing .review-tag-chip {
  padding: 6px;
}

.review-tag-chip:focus-within {
  border-color: var(--review-green);
  box-shadow: 0 0 0 2px var(--review-soft);
}

/* Daily RECORD toolbar; calendar follows the PNL popover scale. */
.record-date-summary {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.record-date-summary #narratives-count {
  padding-left: 18px;
  border-left: 1px solid #dce3da;
  font-size: 12px;
}

.archive-day-context {
  margin-top: 9px;
  gap: 9px;
}
.archive-section .archive-day-context time {
  color: #6c8176;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.archive-section .archive-day-context .record-date-weekday {
  font-size: 11px;
}
.archive-history-wrap {
  align-self: center;
}
.meme-period-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: center;
  margin-left: 20px;
}
.meme-period-controls .archive-history-wrap {
  margin-left: 0;
}
/* RECORD：日 / 月视图切换与日历按钮靠右排列 */
.record-period-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.record-period-controls .record-history-wrap {
  margin-left: 0;
}

.archive-list-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 52px 20px;
  color: #84938a;
  font-size: 13px;
}
