@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800&family=Noto+Serif+SC:wght@600;700;800&display=swap");

* {
  box-sizing: border-box;
}

html {
  background: #edf1f5;
}

body {
  margin: 0;
  color: #17202a;
  background: #edf1f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d8dde5;
  border-radius: 8px;
  padding: 0 12px;
  color: #17202a;
  background: #fff;
}

input,
select {
  height: 44px;
}

textarea {
  min-height: 78px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

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

.mobile-app {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 84px;
  background: #f3f6fa;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

#minePage.active {
  display: flex;
  flex-direction: column;
}

#minePage .profile-hero {
  order: 1;
}

#minePage .wallet-panel {
  order: 2;
}

#minePage .settings-card {
  order: 3;
}

#developerRoleCard {
  order: 4;
}

#minePage .my-ledger-section {
  order: 5;
}

#minePage .bounty-publish-section {
  order: 6;
}

#mineBountySection {
  order: 7;
}

#adminPanel {
  order: 8;
}

.app-header,
.page-header {
  display: flex;
  min-height: 96px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px 16px 14px;
  color: #fff;
  background: linear-gradient(135deg, #dc5573 0%, #ef8d56 100%);
}

.app-header > div,
.page-header > div {
  min-width: 0;
}

.app-header h1,
.page-header h1 {
  margin: 3px 0 0;
  font-size: 26px;
  line-height: 1.15;
}

.page-header {
  align-items: center;
  min-height: 96px;
}

.page-header span,
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.86;
}

.app-header button,
.text-button {
  flex: 0 0 auto;
  height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.text-button {
  color: #e85f7b;
  background: #fff0f3;
}

.user-strip,
.metrics-grid,
.section-block,
.settings-card,
.wallet-panel,
.rank-grid {
  width: calc(100% - 24px);
  margin: 12px auto 0;
}

.user-strip {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(88px, auto);
  align-items: center;
  gap: 10px;
  min-height: 72px;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid #edf1f5;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.avatar,
.profile-avatar,
.anchor-avatar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #e85f7b;
  font-weight: 800;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 18px;
}

.strip-name {
  overflow: hidden;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-sub {
  margin-top: 3px;
  color: #7b8491;
  font-size: 13px;
}

.strip-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.strip-metrics span {
  border-radius: 999px;
  padding: 4px 8px;
  color: #2d3748;
  background: #eef2f6;
  font-size: 12px;
  font-weight: 800;
}

.strip-main {
  min-width: 0;
}

.strip-side {
  display: grid;
  min-width: 88px;
  max-width: 118px;
  min-height: 48px;
  align-content: center;
  justify-items: end;
  border-radius: 8px;
  padding: 8px;
  background: #f7f9fc;
  text-align: right;
}

.strip-side span {
  color: #8a93a0;
  font-size: 11px;
  font-weight: 700;
}

.strip-side strong {
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: #17202a;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-grid,
.wallet-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metrics-grid article,
.wallet-panel article {
  min-width: 0;
  min-height: 86px;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.metrics-grid span,
.wallet-panel span {
  display: block;
  color: #7b8491;
  font-size: 12px;
}

.metrics-grid strong,
.wallet-panel strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: #17202a;
  font-size: 24px;
  line-height: 1.1;
}

.wallet-panel strong {
  font-size: 22px;
}

#myDouyuUid {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-block,
.settings-card,
.rank-grid article {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.section-block {
  padding: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2,
.rank-grid h2,
.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.section-head span {
  color: #8a93a0;
  font-size: 12px;
}

.anchor-list,
.bounty-list,
.feed-list {
  display: grid;
  gap: 8px;
}

.anchor-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.anchor-group {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.anchor-group-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  color: #334155;
  background: #f1f5f9;
}

.anchor-group-title strong {
  font-size: 14px;
}

.anchor-group-title span {
  color: #7b8491;
  font-size: 12px;
}

.anchor-card {
  min-width: 0;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  padding: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.035);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.anchor-card:active {
  transform: scale(0.995);
  border-color: #f4a6b6;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.anchor-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  text-align: left;
}

.anchor-avatar {
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #2aa79c 0%, #248b87 100%);
  font-size: 16px;
  overflow: hidden;
  box-shadow: 0 5px 12px rgba(47, 156, 149, 0.16);
}

.anchor-avatar span {
  line-height: 1;
}

.anchor-avatar.has-image {
  background: #2f9c95;
}

.anchor-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.anchor-avatar.has-image img[hidden],
.anchor-avatar.has-image span[hidden] {
  display: none;
}

.anchor-avatar.has-image span:not([hidden]) {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.anchor-name-row {
  display: grid;
  align-items: center;
  justify-items: start;
  gap: 3px;
  min-width: 0;
}

.anchor-name-row strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #17202a;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anchor-meta-row {
  display: flex;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  overflow: visible;
}

.anchor-name-row span,
.anchor-meta-row a,
.anchor-room a {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 6px;
  color: #2f7f79;
  background: #e5f5f2;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.anchor-meta-row a {
  min-width: 0;
  flex: 0 1 auto;
  overflow: visible;
  color: #d65370;
  background: #fff0f3;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: break-all;
}

.anchor-info p {
  display: -webkit-box;
  margin: 7px 0 8px;
  overflow: hidden;
  color: #6f7885;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.anchor-room a {
  display: inline-flex;
  color: #d65370;
  background: #fff0f3;
}

.anchor-rank {
  color: #d65370;
  font-size: 15px;
  font-weight: 900;
}

.anchor-stats,
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.anchor-stats.compact {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 6px;
}

.anchor-stats span,
.anchor-stats a,
.status-grid div {
  min-height: 28px;
  border-radius: 8px;
  padding: 4px 6px;
  background: #f7f9fc;
  color: #647084;
  font-size: 11px;
  text-align: left;
}

.anchor-stats a,
.anchor-stats span {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.15;
}

.anchor-stat small,
.status-grid span {
  color: #8a93a0;
  font-size: 10px;
  font-weight: 700;
}

.anchor-stat strong,
.status-grid strong {
  color: #17202a;
  font-size: 13px;
  font-weight: 900;
}

.anchor-stats .room-stat {
  color: #d65370;
  background: #fff0f3;
}

.anchor-stats .room-stat small,
.anchor-stats .room-stat strong {
  color: #d65370;
}

.anchor-stats .coin-stat {
  background: #edf8f5;
}

.anchor-stats .coin-stat small,
.anchor-stats .coin-stat strong {
  color: #1f766f;
}

.status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 5px;
}

.status-grid span,
.status-grid strong {
  display: inline;
}

.status-grid strong {
  margin-top: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status-grid div {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
}

.status-grid div.empty,
.detail-status article.empty {
  color: #8a93a0;
  background: #f4f6f8;
}

.status-grid div.empty span,
.status-grid div.empty strong,
.detail-status article.empty span,
.detail-status article.empty strong {
  color: #8a93a0;
}

.status-grid div.active,
.detail-status article.active {
  color: #1f766f;
  background: #e8f6f4;
}

.status-grid div.card-meal-rocket,
.detail-status article.card-meal-rocket {
  background: linear-gradient(135deg, #e3f7f4 0%, #d3f0ee 100%);
}

.status-grid div.card-meal-rocket span,
.status-grid div.card-meal-rocket strong,
.detail-status article.card-meal-rocket span,
.detail-status article.card-meal-rocket strong {
  color: #1f766f;
}

.status-grid div.card-meal-super,
.detail-status article.card-meal-super {
  background: linear-gradient(135deg, #fff2d7 0%, #ffe3ea 100%);
}

.status-grid div.card-meal-super span,
.status-grid div.card-meal-super strong,
.detail-status article.card-meal-super span,
.detail-status article.card-meal-super strong {
  color: #b45309;
}

.status-grid div.card-room-floor,
.detail-status article.card-room-floor {
  background: linear-gradient(135deg, #edf7ff 0%, #e5f0ff 100%);
}

.status-grid div.card-room-floor span,
.status-grid div.card-room-floor strong,
.detail-status article.card-room-floor span,
.detail-status article.card-room-floor strong {
  color: #2563eb;
}

.status-grid div.card-room-twin,
.detail-status article.card-room-twin {
  background: linear-gradient(135deg, #eef2ff 0%, #e7e5ff 100%);
}

.status-grid div.card-room-twin span,
.status-grid div.card-room-twin strong,
.detail-status article.card-room-twin span,
.detail-status article.card-room-twin strong {
  color: #5b21b6;
}

.status-grid div.card-room-queen,
.detail-status article.card-room-queen {
  background: linear-gradient(135deg, #fff7d6 0%, #ffe8b5 100%);
}

.status-grid div.card-room-queen span,
.status-grid div.card-room-queen strong,
.detail-status article.card-room-queen span,
.detail-status article.card-room-queen strong {
  color: #92400e;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.room-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button-row button,
.bounty-actions button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 8px;
  color: #d65370;
  background: #fff0f3;
  font-size: 13px;
  font-weight: 700;
}

.button-row button[data-kind="give"],
.detail-actions button[data-kind="give"] {
  color: #1f766f;
  background: #e8f6f4;
}

.button-row button[data-kind="hit"],
.detail-actions button[data-kind="hit"] {
  color: #d65370;
  background: #fff0f3;
}

.button-row button[data-action="meal"],
.detail-actions button[data-detail-action="meal"] {
  color: #a95510;
  background: #fff4e6;
}

.button-row button[data-action="room"],
.detail-actions button[data-detail-action="room"] {
  color: #4755a6;
  background: #eef2ff;
}

.feed-item,
.bounty-item,
.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-top: 1px solid #edf0f4;
  padding: 10px 0;
}

.feed-item:first-child,
.bounty-item:first-child,
.rank-item:first-child {
  border-top: 0;
}

.feed-item div,
.bounty-item div {
  min-width: 0;
  flex: 1;
}

.feed-item strong,
.bounty-item strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item span,
.bounty-item span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #7b8491;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bounty-status {
  display: inline-flex !important;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #2f7f79 !important;
  background: #e8f6f4;
  font-weight: 800;
}

.bounty-status.status-running,
.bounty-status.status-claimed {
  color: #9a5b13 !important;
  background: #fff3d7;
}

.bounty-status.status-completed {
  color: #1f766f !important;
  background: #dcfce7;
}

.bounty-status.status-cancelled {
  color: #9f1239 !important;
  background: #ffe4eb;
}

.feed-item em,
.bounty-item em,
.rank-item em {
  flex: 0 0 auto;
  color: #2f9c95;
  font-style: normal;
  font-weight: 900;
}

.feed-item em.negative {
  color: #d65370;
}

.bounty-item {
  align-items: flex-start;
}

.bounty-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.bounty-actions button {
  min-width: 48px;
  min-height: 30px;
  font-size: 12px;
}

.rank-grid {
  display: grid;
  gap: 12px;
}

.rank-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: calc(100% - 24px);
  margin: 12px auto 0;
}

.rank-tabs button {
  min-height: 38px;
  border-radius: 8px;
  color: #536174;
  background: #eef2f6;
  font-size: 13px;
  font-weight: 800;
}

.rank-tabs button.active {
  color: #fff;
  background: #263241;
}

.rank-audience-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.rank-audience-tabs button {
  min-height: 34px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.rank-grid article {
  padding: 14px;
}

.rank-grid h2 {
  margin-bottom: 8px;
}

.rank-list {
  min-height: 40px;
}

.rank-item .rank-index {
  display: flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: #e85f7b;
  font-size: 12px;
  font-weight: 800;
}

.rank-avatar {
  display: flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2f9c95 0%, #4f7cc8 100%);
  font-size: 13px;
  font-weight: 900;
}

.rank-avatar.has-image {
  background: #eef2f6;
}

.rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-avatar i {
  font-style: normal;
}

.rank-avatar img[hidden],
.rank-avatar i[hidden] {
  display: none;
}

.rank-item strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-hero {
  padding: 18px 12px 0;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 8px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #263241 0%, #2f9c95 100%);
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 24px;
}

.profile-main {
  min-width: 0;
  flex: 1;
}

.profile-name {
  overflow: hidden;
  font-size: 22px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.profile-tags span,
.profile-tags button {
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.profile-tags button.locked {
  cursor: default;
}

.settings-card {
  overflow: hidden;
}

.settings-card button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #edf0f4;
  padding: 0 16px;
  color: #17202a;
  background: #fff;
  font-size: 16px;
  text-align: left;
}

.settings-card button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-card button:first-child {
  border-top: 0;
}

.settings-card em {
  min-width: 0;
  flex: 1;
  max-width: 64%;
  overflow: hidden;
  color: #7b8491;
  font-style: normal;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.developer-role-card {
  display: grid;
  gap: 10px;
}

.role-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.role-switcher button {
  min-width: 0;
  min-height: 40px;
  border-radius: 8px;
  color: #536174;
  background: #eef2f6;
  font-size: 14px;
  font-weight: 800;
}

.role-switcher button.active {
  color: #fff;
  background: #263241;
}

.form-section {
  display: grid;
  gap: 10px;
}

.form-section label,
.sheet-panel label {
  display: grid;
  gap: 6px;
  color: #657080;
  font-size: 13px;
}

.sheet-hint {
  border-radius: 8px;
  padding: 9px 10px;
  color: #536174;
  background: #f6f8fa;
  font-size: 12px;
  line-height: 1.45;
}

.specific-anchor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.specific-anchor-list label {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  color: #17202a;
  background: #f6f8fa;
  font-size: 13px;
}

.specific-anchor-list input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.specific-anchor-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-anchor-field {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  color: #657080;
  font-size: 12px;
  line-height: 1.4;
}

.config-anchor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.config-anchor-list label {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  color: #17202a;
  background: #f6f8fa;
  font-size: 13px;
}

.config-anchor-list input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.config-anchor-list input:disabled + span {
  color: #2f6e69;
  font-weight: 800;
}

.config-anchor-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anchor-editor input[readonly] {
  color: #657080;
  background: #f3f5f7;
  cursor: default;
}

.primary-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: #e85f7b;
  font-weight: 800;
}

.primary-button.wide {
  width: 100%;
}

.admin-status-list {
  display: grid;
  gap: 8px;
}

.admin-tabs {
  display: grid;
  grid-template-columns: 0.8fr 1.25fr 1.45fr;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-tab-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-content: start;
  padding: 8px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-tab-group > span {
  grid-column: 1 / -1;
  color: #8a94a6;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.admin-tabs button {
  min-height: 34px;
  border-radius: 8px;
  color: #536173;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e6ebf2;
  font-size: 12px;
  font-weight: 800;
}

.admin-tabs button.active {
  color: #fff;
  background: #23415f;
  box-shadow: none;
}

.admin-tabs button span {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  border-radius: 999px;
  padding: 0 5px;
  color: #fff;
  background: #d65370;
  font-size: 10px;
  font-weight: 900;
}

.admin-view[hidden] {
  display: none !important;
}

.admin-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.admin-filter-row input:first-child {
  grid-column: span 2;
}

.admin-filter-row input,
.admin-filter-row select,
.admin-filter-row button {
  min-height: 38px;
  height: 38px;
  font-size: 13px;
}

.gift-refresh-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.8fr) minmax(112px, 0.6fr);
  gap: 10px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.gift-refresh-editor label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #657080;
  font-size: 12px;
  font-weight: 700;
}

.gift-refresh-editor textarea {
  min-height: 88px;
  resize: vertical;
}

.gift-refresh-cookie,
.gift-refresh-result {
  grid-column: 1 / -1;
}

.gift-refresh-toggle {
  display: flex !important;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.gift-refresh-toggle input {
  width: auto;
  min-height: auto;
}

.gift-rank-room-button {
  align-self: end;
  min-height: 42px;
  padding: 0 12px;
  white-space: nowrap;
}

.gift-refresh-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 10px;
}

.gift-refresh-result {
  display: grid;
  gap: 8px;
  border-left: 3px solid #2f9c95;
  border-radius: 8px;
  padding: 10px;
  background: #ecf8f6;
}

.gift-refresh-result strong {
  color: #17202a;
  font-size: 14px;
}

.gift-refresh-result span,
.gift-refresh-result p {
  margin: 0;
  color: #657080;
  font-size: 12px;
}

.gift-refresh-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.gift-refresh-metrics span {
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.gift-refresh-metrics b {
  display: block;
  margin-top: 2px;
  color: #17202a;
  font-size: 15px;
}

.gift-catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(96px, 0.8fr) minmax(96px, 0.8fr) minmax(88px, 0.6fr) auto auto;
  gap: 8px;
  margin-top: 12px;
}

.gift-catalog-tools input,
.gift-catalog-tools button {
  min-height: 38px;
  height: 38px;
  font-size: 13px;
}

.gift-catalog-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.gift-catalog-metrics article {
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fa;
}

.gift-catalog-metrics span,
.gift-catalog-metrics strong {
  display: block;
}

.gift-catalog-metrics span {
  color: #7b8491;
  font-size: 12px;
}

.gift-catalog-metrics strong {
  margin-top: 4px;
  color: #17202a;
  font-size: 16px;
}

.gift-catalog-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.gift-catalog-item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.gift-catalog-main,
.gift-catalog-values {
  min-width: 0;
}

.gift-catalog-main strong,
.gift-catalog-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-catalog-main strong {
  color: #17202a;
  font-size: 14px;
}

.gift-catalog-main span {
  margin-top: 3px;
  color: #7b8491;
  font-size: 12px;
}

.gift-catalog-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.gift-catalog-values span {
  border-radius: 8px;
  padding: 7px 8px;
  color: #657080;
  background: #f6f8fa;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.gift-catalog-values b {
  color: #17202a;
  font-size: 13px;
}

.gift-catalog-actions {
  display: grid;
  grid-template-columns: auto;
  gap: 6px;
}

.gift-catalog-actions button,
.gift-catalog-pager button {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  color: #2f6e69;
  background: #e4f5f2;
  font-size: 12px;
  font-weight: 800;
}

.gift-catalog-actions button {
  min-width: 64px;
}

.gift-catalog-actions button.danger {
  color: #be123c;
  background: #fff0f3;
}

.gift-catalog-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  color: #657080;
  font-size: 12px;
  font-weight: 800;
}

.gift-catalog-pager button:disabled {
  color: #aab3bf;
  background: #f1f5f9;
  cursor: not-allowed;
}

.admin-export-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-export-tools input {
  width: 136px;
  height: 34px;
  min-height: 34px;
  font-size: 13px;
}

.admin-date-hint {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  color: #2f6e69;
  background: #e4f5f2;
  font-size: 12px;
  font-weight: 800;
}

.admin-date-hint.readonly {
  color: #7a4a12;
  background: #fff0d6;
}

.admin-user-tools {
  margin-top: 12px;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-user-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fa;
  border-left: 3px solid #b8c0cc;
}

.admin-user-item.bound {
  border-left-color: #2f9c95;
}

.admin-user-item.unbound {
  border-left-color: #d65370;
}

.admin-user-item div,
.admin-user-item strong,
.admin-user-item span,
.admin-user-item em,
.admin-user-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-item strong {
  display: block;
  color: #17202a;
  font-size: 13px;
}

.admin-user-item span,
.admin-user-item small {
  color: #7b8491;
  font-size: 12px;
}

.admin-user-item em {
  border-radius: 999px;
  padding: 4px 8px;
  color: #263241;
  background: #e8edf3;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.admin-user-actions {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-user-actions button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #be123c;
  background: #fff0f3;
  font-size: 12px;
  font-weight: 800;
}

.admin-user-item small {
  grid-column: 1 / -1;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.anomaly-list {
  display: grid;
  gap: 8px;
}

.anomaly-item {
  display: grid;
  gap: 8px;
  border-left: 3px solid #d9a441;
  border-radius: 8px;
  padding: 11px;
  background: #fffaf0;
}

.anomaly-item.critical {
  border-left-color: #d65370;
  background: #fff5f7;
}

.anomaly-item.resolved {
  border-left-color: #aab3bf;
  background: #f6f8fa;
  opacity: 0.78;
}

.anomaly-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.anomaly-head > div {
  min-width: 0;
}

.anomaly-head strong,
.anomaly-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anomaly-head strong {
  color: #17202a;
  font-size: 13px;
}

.anomaly-head span,
.anomaly-head em {
  margin-top: 2px;
  color: #7b8491;
  font-size: 11px;
  font-style: normal;
}

.anomaly-head button {
  min-height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 0 10px;
  color: #2f6e69;
  background: #e4f5f2;
  font-size: 12px;
  font-weight: 800;
}

.anomaly-item p {
  margin: 0;
  color: #4f5967;
  font-size: 12px;
  line-height: 1.5;
}

.anomaly-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #7b8491;
  font-size: 11px;
}

.audit-item {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fa;
  border-left: 3px solid #b8c0cc;
}

.audit-item.success {
  border-left-color: #2f9c95;
}

.audit-item.failed {
  border-left-color: #d65370;
}

.audit-item strong,
.audit-item span,
.audit-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-item strong {
  color: #17202a;
  font-size: 13px;
}

.audit-item span,
.audit-item em {
  color: #7b8491;
  font-size: 12px;
  font-style: normal;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.admin-metrics article {
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fa;
}

.admin-metrics article.success {
  background: #e8f6f4;
}

.admin-metrics article.success strong {
  color: #1f766f;
}

.admin-metrics article.failed {
  background: #fff0f3;
}

.admin-metrics article.failed strong {
  color: #be123c;
}

.admin-metrics span,
.admin-metrics strong {
  display: block;
}

.admin-metrics span {
  color: #7b8491;
  font-size: 12px;
}

.admin-metrics strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #17202a;
  font-size: 18px;
}

.admin-subsection {
  margin-top: 16px;
  border-top: 1px solid #edf0f4;
  padding-top: 14px;
}

.admin-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-subhead h3 {
  margin: 0;
  font-size: 16px;
}

.admin-section-note {
  max-width: 680px;
  margin: 4px 0 0;
  color: #7b8491;
  font-size: 12px;
  line-height: 1.45;
}

.admin-subhead span {
  color: #8a93a0;
  font-size: 12px;
}

.admin-subhead span.dirty {
  color: #b45309;
  font-weight: 800;
}

.admin-subhead .admin-date-hint {
  color: #2f6e69;
  background: #e4f5f2;
  font-weight: 800;
}

.admin-subhead .admin-date-hint.readonly {
  color: #7a4a12;
  background: #fff0d6;
}

.admin-monitor-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-monitor-tools button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
}

.admin-status-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fa;
  font-size: 12px;
}

.admin-status-list.monitor-room-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 68px;
  padding: 10px;
  gap: 6px 10px;
}

.monitor-error {
  color: #be123c !important;
}

.monitor-room-head {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.monitor-room-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #17202a;
  font-size: 15px;
  line-height: 1.2;
}

.monitor-room-detail {
  align-self: center;
}

.admin-status-main {
  min-width: 0;
}

.admin-status-main strong,
.admin-status-main span {
  display: block;
}

.admin-status-main span {
  margin-top: 3px;
  color: #7b8491;
}

.monitor-room-detail span {
  overflow: visible;
  white-space: normal;
  line-height: 1.35;
}

.state-pill {
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
}

.state-pill.active {
  color: #1f766f;
  background: #e8f6f4;
}

.state-pill.empty {
  color: #8a93a0;
  background: #eef1f5;
}

.state-pill.unknown {
  color: #a95510;
  background: #fff4e6;
}

.monitor-room-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
}

.monitor-room-actions button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #1f766f;
  background: #e8f6f4;
  font-size: 12px;
  font-weight: 800;
}

.monitor-room-actions button[data-monitor-action="stop"] {
  color: #be123c;
  background: #fff0f3;
}

.monitor-room-actions button:disabled {
  opacity: 0.45;
}

.state-pill.card-meal-rocket {
  color: #1f766f;
  background: #dff5f1;
}

.state-pill.card-meal-super {
  color: #b45309;
  background: #ffe9c7;
}

.state-pill.card-room-floor {
  color: #2563eb;
  background: #e3efff;
}

.state-pill.card-room-twin {
  color: #5b21b6;
  background: #e9e5ff;
}

.state-pill.card-room-queen {
  color: #92400e;
  background: #ffe8b5;
}

.admin-status-list strong,
.admin-status-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.admin-card-actions button {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 6px;
  color: #d65370;
  background: #fff0f3;
  font-size: 12px;
  font-weight: 800;
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  margin-top: 12px;
}

.admin-anchor-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.admin-anchor-picker label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #657080;
  font-size: 12px;
}

.admin-anchor-picker button {
  min-height: 44px;
  white-space: nowrap;
}

.admin-anchor-picker select.is-new {
  border-color: #f6b6c5;
  color: #be123c;
  background: #fff7fa;
  font-weight: 800;
}

.admin-anchor-picker select option.new-anchor-option,
.admin-anchor-picker select option[value="__new__"] {
  color: #be123c;
  background: #fff0f3;
  font-weight: 800;
}

.admin-anchor-quick {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-anchor-lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-anchor-lookup-row button {
  min-width: 112px;
}

.admin-anchor-lookup-result {
  min-height: 72px;
}

.anchor-lookup-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.anchor-lookup-avatar {
  display: flex;
  width: 54px;
  height: 54px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2f9c95, #e85f7b);
  font-size: 20px;
  font-weight: 900;
}

.anchor-lookup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.anchor-lookup-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.anchor-lookup-main strong,
.anchor-lookup-main span,
.anchor-lookup-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anchor-lookup-main strong {
  color: #17202a;
  font-size: 16px;
}

.anchor-lookup-main span,
.anchor-lookup-main em {
  color: #7b8491;
  font-size: 12px;
  font-style: normal;
}

.anchor-lookup-main em {
  color: #2f6e69;
  font-weight: 800;
}

.anchor-editor,
.config-editor,
.role-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-editor {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #657080;
  font-size: 12px;
  line-height: 1.35;
}

.admin-form label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.config-room-summary {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.config-room-summary div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.config-room-summary strong {
  color: #17202a;
  font-size: 13px;
}

.config-room-summary em,
.config-room-summary b {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.config-room-summary em {
  color: #2f6e69;
  background: #e4f5f2;
}

.config-room-summary b {
  color: #17202a;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e6eaf0;
}

.config-room-summary span {
  color: #7b8491;
  font-size: 12px;
}

.anchor-editor .anchor-field-wide,
.anchor-editor .admin-form-actions,
.config-room-summary,
.config-editor .primary-button,
.admin-form .primary-button {
  grid-column: 1 / -1;
}

.role-editor .primary-button {
  grid-column: auto;
  min-height: 44px;
  white-space: nowrap;
}

.anchor-editor .admin-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.ghost-button {
  min-height: 42px;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  padding: 0 16px;
  color: #647084;
  background: #fff;
  font-weight: 800;
}

.ghost-button.wide {
  width: 100%;
}

.ghost-button.danger {
  color: #be123c;
  background: #fff5f7;
  border-color: #ffd6df;
}

.action-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(13, 21, 31, 0.42);
}

.sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: grid;
  width: 100%;
  max-width: 560px;
  gap: 12px;
  transform: translateX(-50%);
  border-radius: 14px 14px 0 0;
  padding: 16px;
  background: #fff;
}

.detail-page-header {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #263241 0%, #2f9c95 100%);
}

.detail-page-header .text-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.detail-page-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.detail-page-header span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  opacity: 0.84;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-head button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #657080;
  background: #f0f2f5;
  font-size: 24px;
  line-height: 1;
}

.detail-hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.detail-hero strong,
.detail-hero span,
.detail-hero p {
  display: block;
}

.detail-hero strong {
  font-size: 20px;
  line-height: 1.2;
}

.detail-hero span {
  margin-top: 4px;
  color: #7b8491;
  font-size: 13px;
}

.detail-hero p {
  margin: 8px 0 0;
  color: #566171;
  font-size: 14px;
  line-height: 1.5;
}

.detail-stats,
.detail-status,
.detail-actions {
  display: grid;
  gap: 8px;
}

.detail-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-status,
.detail-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-stats article,
.detail-status article {
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fa;
  text-align: center;
}

.detail-stats span,
.detail-status span {
  display: block;
  color: #7b8491;
  font-size: 12px;
}

.detail-stats strong,
.detail-status strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #17202a;
  font-size: 18px;
}

.detail-room-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #2f7f79;
  background: #e8f6f4;
  font-weight: 800;
}

.detail-actions button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 10px;
  color: #d65370;
  background: #fff0f3;
  font-weight: 800;
}

.detail-actions button[data-kind="give"] {
  color: #1f766f;
  background: #e8f6f4;
}

.detail-actions button[data-kind="hit"] {
  color: #d65370;
  background: #fff0f3;
}

.detail-actions button[data-detail-action="meal"] {
  color: #a95510;
  background: #fff4e6;
}

.detail-actions button[data-detail-action="room"] {
  color: #4755a6;
  background: #eef2ff;
}

.detail-log {
  display: grid;
  gap: 4px;
  border-top: 1px solid #edf0f4;
  padding-top: 12px;
}

.detail-record-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid #edf0f4;
  padding-top: 12px;
}

.pager {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  color: #7b8491;
  font-size: 12px;
  text-align: center;
}

.pager button {
  min-height: 32px;
  border-radius: 8px;
  color: #475569;
  background: #eef2f6;
  font-size: 12px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 50;
  width: calc(100% - 40px);
  max-width: 420px;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: rgba(23, 32, 42, 0.92);
  font-size: 14px;
  text-align: center;
}

.toast.error {
  background: rgba(190, 24, 93, 0.94);
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  width: 100%;
  max-width: 560px;
  grid-template-columns: repeat(3, 1fr);
  transform: translateX(-50%);
  border-top: 1px solid #e4e8ee;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-tabs button {
  display: grid;
  gap: 2px;
  min-height: 62px;
  align-content: center;
  justify-items: center;
  color: #929ba8;
  background: transparent;
  font-size: 12px;
}

.bottom-tabs span {
  font-size: 22px;
  line-height: 1;
}

.bottom-tabs button.active {
  color: #e85f7b;
}

.bottom-tabs button:disabled {
  opacity: 0.55;
}

.empty {
  padding: 26px 0;
  color: #9aa4b1;
  text-align: center;
}

.empty.compact {
  padding: 14px 0;
}

.bind-page {
  min-height: 100vh;
  background: #fff;
}

.bind-nav {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  height: 56px;
  padding: 0 12px;
  color: #17202a;
  background: #fff;
  font-size: 18px;
  text-align: center;
}

.bind-nav button {
  width: 36px;
  height: 36px;
  color: #17202a;
  background: transparent;
  font-size: 34px;
  line-height: 1;
}

.bind-screen {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 96px 24px 40px;
  text-align: center;
}

.bind-step-title {
  color: #e85f7b;
  font-size: 36px;
  font-weight: 900;
}

.bind-step-subtitle {
  margin-top: 8px;
  color: #9aa4b1;
  font-size: 17px;
  font-weight: 700;
}

.bind-tip {
  margin: 24px auto 0;
  color: #344054;
  font-size: 15px;
  line-height: 1.7;
}

.bind-room {
  margin-top: 22px;
  color: #17202a;
  font-size: 20px;
  letter-spacing: 1px;
}

.bind-code-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 28px auto 0;
  max-width: 430px;
  font-size: 18px;
}

.bind-code-row input {
  height: 56px;
  border-radius: 999px;
  color: #17202a;
  font-size: 22px;
  text-align: center;
}

.bind-screen .primary-button {
  min-width: 168px;
  margin-top: 28px;
}

.bind-countdown {
  margin-top: 22px;
  color: #475569;
  font-size: 15px;
  line-height: 1.6;
}

.bind-countdown.error {
  color: #be123c;
}

@media (max-width: 420px) {
  .app-header h1,
  .page-header h1 {
    font-size: 25px;
  }

  .metrics-grid strong,
  .wallet-panel strong {
    font-size: 21px;
  }

  .wallet-panel strong {
    font-size: 20px;
  }

  .anchor-main {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
    text-align: left;
  }

  .anchor-avatar {
    width: 34px;
    height: 34px;
    margin: 0;
  }

  .anchor-name-row strong {
    font-size: 13px;
  }

  .anchor-rank {
    display: none;
  }

  .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .room-row button {
    min-height: 34px;
    padding: 0 4px;
    font-size: 12px;
  }

  .admin-status-list article {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .admin-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-metrics,
  .anchor-editor,
  .config-editor,
  .role-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-tabs {
    grid-template-columns: 1fr;
  }

  .admin-tab-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .admin-filter-row input,
  .admin-filter-row .primary-button,
  .admin-filter-row .ghost-button {
    grid-column: 1 / -1;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .gift-refresh-editor,
  .gift-catalog-tools,
  .gift-catalog-item {
    grid-template-columns: 1fr;
  }

  .gift-refresh-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gift-catalog-actions {
    grid-template-columns: 1fr;
  }

  .gift-refresh-metrics,
  .gift-catalog-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gift-catalog-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-anchor-lookup-row,
  .anchor-lookup-card {
    grid-template-columns: 1fr;
  }

  .config-anchor-list {
    grid-template-columns: 1fr;
  }

  .anchor-lookup-avatar {
    margin: 0 auto;
  }

  .anchor-lookup-main {
    text-align: center;
  }

  .bind-code-row {
    grid-template-columns: 1fr;
  }
}

.section-head-tools,
.rank-panel-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.rank-panel-head {
  justify-content: space-between;
  margin-bottom: 8px;
}

.rank-panel-head h2 {
  margin: 0;
}

.auto-refresh-countdown,
.detail-refresh-countdown {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--tb-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.auto-refresh-countdown::before,
.detail-refresh-countdown::before {
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--tb-accent);
  content: "";
}

.detail-refresh-countdown {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
}

.detail-refresh-countdown::before {
  background: #9dc6b7;
}

@media (max-width: 420px) {
  .section-head-tools {
    gap: 6px;
  }

  .auto-refresh-countdown,
  .detail-refresh-countdown {
    font-size: 10px;
  }
}

/* Product visual system: compact live-operations workspace. */
:root {
  --tb-ink: #14241f;
  --tb-ink-soft: #203b33;
  --tb-canvas: #f5f5f0;
  --tb-surface: #ffffff;
  --tb-line: #dce5df;
  --tb-muted: #6c7b75;
  --tb-accent: #e95d47;
  --tb-accent-deep: #bd4636;
  --tb-mint: #e5f3ec;
  --tb-mint-ink: #176957;
}

html,
body {
  background: var(--tb-canvas);
}

body,
button,
input,
select,
textarea {
  font-family: "Noto Sans SC", sans-serif;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--tb-accent);
  outline-offset: 2px;
}

input,
select,
textarea {
  border-color: var(--tb-line);
  border-radius: 6px;
  color: var(--tb-ink);
  background: var(--tb-surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--tb-accent);
  box-shadow: 0 0 0 3px rgba(233, 93, 71, 0.12);
}

.mobile-app {
  max-width: 600px;
  background: var(--tb-canvas);
}

.app-header {
  position: relative;
  min-height: 132px;
  align-items: flex-start;
  overflow: hidden;
  padding: 24px 18px 22px;
  color: #fff;
  background: var(--tb-ink);
}

.app-header::before {
  position: absolute;
  top: 0;
  right: 72px;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.16);
  content: "";
}

.app-header::after {
  position: absolute;
  right: -18px;
  bottom: 14px;
  width: 82px;
  height: 8px;
  background: var(--tb-accent);
  content: "";
  transform: skewX(-32deg);
}

.brand-block,
.header-refresh {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: #9dc6b7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.app-header h1,
.page-header h1,
.detail-page-header h1,
.bind-step-title {
  font-family: "Noto Serif SC", serif;
  font-weight: 800;
}

.app-header h1 {
  margin-top: 5px;
  font-size: 30px;
  line-height: 1.1;
}

.header-support {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.45;
}

.header-refresh {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: transparent;
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

.page-header,
.detail-page-header {
  min-height: 88px;
  background: var(--tb-ink);
}

.page-header h1,
.detail-page-header h1 {
  font-size: 25px;
}

.user-strip,
.metrics-grid,
.section-block,
.settings-card,
.wallet-panel,
.rank-grid {
  width: calc(100% - 28px);
}

.user-strip {
  grid-template-columns: 46px minmax(0, 1fr) minmax(86px, auto);
  min-height: 76px;
  border: 1px solid var(--tb-line);
  border-radius: 6px;
  padding: 11px;
  background: var(--tb-surface);
  box-shadow: none;
}

.avatar,
.profile-avatar {
  background: var(--tb-ink-soft);
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

.strip-name,
.profile-name,
.anchor-name-row strong,
.rank-item strong,
.feed-item strong,
.bounty-item strong {
  color: var(--tb-ink);
}

.strip-name {
  font-size: 17px;
}

.strip-sub,
.strip-side span,
.section-head span,
.feed-item span,
.bounty-item span,
.admin-section-note {
  color: var(--tb-muted);
}

.strip-metrics span {
  border-radius: 4px;
  color: var(--tb-mint-ink);
  background: var(--tb-mint);
}

.strip-side {
  min-height: 50px;
  border-radius: 0;
  border-left: 1px solid var(--tb-line);
  padding: 5px 0 5px 10px;
  background: transparent;
}

.strip-side strong {
  color: var(--tb-ink);
}

.metrics-grid article,
.wallet-panel article {
  min-height: 80px;
  border: 1px solid var(--tb-line);
  border-radius: 6px;
  background: var(--tb-surface);
  box-shadow: none;
}

.metrics-grid strong,
.wallet-panel strong {
  color: var(--tb-ink);
}

#homePage .section-block {
  border-radius: 0;
  padding: 16px 0 0;
  background: transparent;
  box-shadow: none;
}

#homePage .section-block + .section-block {
  margin-top: 20px;
  border-top: 1px solid var(--tb-line);
}

.section-head {
  margin: 0 2px 10px;
}

.section-head h2,
.rank-grid h2,
.sheet-head h2 {
  color: var(--tb-ink);
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 700;
}

.text-button {
  height: 30px;
  border-radius: 4px;
  padding: 0 9px;
  color: var(--tb-accent-deep);
  background: #fff0ec;
  font-size: 12px;
}

.anchor-list,
.anchor-group {
  gap: 7px;
}

.anchor-group-title {
  min-height: 28px;
  border-radius: 0;
  padding: 0 2px;
  color: var(--tb-ink);
  background: transparent;
}

.anchor-group-title strong {
  font-family: "Noto Serif SC", serif;
}

.anchor-card {
  border: 1px solid var(--tb-line);
  border-radius: 6px;
  padding: 8px;
  background: var(--tb-surface);
  box-shadow: none;
}

.anchor-card:active {
  border-color: var(--tb-accent);
  box-shadow: none;
}

.anchor-avatar {
  border-radius: 5px;
  background: var(--tb-ink-soft);
  box-shadow: none;
}

.anchor-name-row {
  gap: 4px;
}

.anchor-name-row strong {
  font-size: 14px;
}

.anchor-name-row span,
.anchor-meta-row a,
.anchor-room a {
  border-radius: 3px;
  padding: 2px 5px;
  color: var(--tb-mint-ink);
  background: var(--tb-mint);
  font-size: 10px;
}

.anchor-meta-row a,
.anchor-room a {
  color: var(--tb-accent-deep);
  background: #fff0ec;
}

.anchor-stats.compact {
  margin-top: 7px;
}

.anchor-stats span,
.anchor-stats a,
.status-grid div {
  min-height: 26px;
  border-radius: 4px;
}

.anchor-stats .coin-stat {
  background: #edf6f1;
}

.anchor-stats .coin-stat small,
.anchor-stats .coin-stat strong {
  color: var(--tb-mint-ink);
}

.status-grid div.empty,
.detail-status article.empty {
  background: #eef1ee;
}

.status-grid div.card-meal-rocket,
.detail-status article.card-meal-rocket {
  background: #dff2ed;
}

.status-grid div.card-meal-super,
.detail-status article.card-meal-super {
  background: #fff0d8;
}

.status-grid div.card-room-floor,
.detail-status article.card-room-floor {
  background: #e5f0eb;
}

.status-grid div.card-room-twin,
.detail-status article.card-room-twin {
  background: #e8f3ee;
}

.status-grid div.card-room-twin span,
.status-grid div.card-room-twin strong,
.detail-status article.card-room-twin span,
.detail-status article.card-room-twin strong {
  color: #2e7664;
}

.status-grid div.card-room-queen,
.detail-status article.card-room-queen {
  background: #ffe5db;
}

.rank-tabs {
  gap: 6px;
  width: calc(100% - 28px);
}

.rank-tabs button {
  min-height: 36px;
  border: 1px solid var(--tb-line);
  border-radius: 5px;
  color: var(--tb-muted);
  background: transparent;
}

.rank-tabs button.active,
.role-switcher button.active {
  color: #fff;
  background: var(--tb-ink);
}

.rank-audience-tabs button {
  background: var(--tb-surface);
  box-shadow: none;
}

.rank-grid article {
  border: 1px solid var(--tb-line);
  border-top: 3px solid var(--tb-ink);
  border-radius: 6px;
  padding: 13px;
  background: var(--tb-surface);
  box-shadow: none;
}

.rank-item {
  padding: 11px 0;
}

.rank-item .rank-index {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  color: var(--tb-ink);
  background: #e9efeb;
}

.rank-item:nth-child(1) .rank-index {
  color: #fff;
  background: var(--tb-accent);
}

.rank-item:nth-child(2) .rank-index {
  background: #dce9e2;
}

.rank-avatar {
  border-radius: 6px;
  background: var(--tb-ink-soft);
}

.rank-item em,
.feed-item em,
.bounty-item em {
  color: var(--tb-mint-ink);
}

.profile-hero {
  padding: 14px 14px 0;
}

.profile-card {
  border-radius: 6px;
  padding: 17px;
  background: var(--tb-ink);
}

.profile-avatar {
  border-radius: 6px;
  background: var(--tb-accent);
}

.profile-name {
  font-family: "Noto Serif SC", serif;
  font-size: 23px;
}

.profile-tags span,
.profile-tags button {
  border-radius: 4px;
}

.settings-card,
#minePage .section-block:not(#adminPanel) {
  border: 1px solid var(--tb-line);
  border-radius: 6px;
  background: var(--tb-surface);
  box-shadow: none;
}

.settings-card button {
  min-height: 54px;
}

.role-switcher button {
  border: 1px solid var(--tb-line);
  border-radius: 5px;
  background: #f1f4f1;
}

.primary-button {
  border-radius: 5px;
  background: var(--tb-accent);
  box-shadow: inset 0 -2px 0 rgba(116, 35, 25, 0.22);
}

.ghost-button {
  border-color: var(--tb-line);
  border-radius: 5px;
  color: var(--tb-ink-soft);
}

.ghost-button.danger {
  color: var(--tb-accent-deep);
  background: #fff4f1;
  border-color: #ffd5cc;
}

.admin-panel {
  border: 1px solid var(--tb-line) !important;
  border-top: 3px solid var(--tb-ink) !important;
  border-radius: 6px !important;
  background: var(--tb-surface) !important;
  box-shadow: none !important;
}

.admin-tabs {
  gap: 7px;
}

.admin-tab-group {
  gap: 6px;
  border-color: var(--tb-line);
  border-radius: 5px;
  padding: 7px;
  background: #f3f5f2;
}

.admin-tabs button {
  border-radius: 4px;
  color: var(--tb-muted);
  box-shadow: none;
}

.admin-tabs button.active {
  background: var(--tb-ink);
}

.admin-metrics article,
.admin-status-list article,
.admin-user-item,
.anchor-lookup-card,
.config-room-summary,
.gift-catalog-item {
  border-color: var(--tb-line);
  border-radius: 5px;
  background: #f4f7f4;
}

.admin-metrics article.success,
.state-pill.active,
.monitor-room-actions button {
  color: var(--tb-mint-ink);
  background: var(--tb-mint);
}

.admin-metrics article.failed,
.monitor-room-actions button[data-monitor-action="stop"] {
  color: var(--tb-accent-deep);
  background: #fff0ec;
}

.admin-card-actions button,
.gift-catalog-actions button,
.gift-catalog-pager button {
  border-radius: 4px;
  color: var(--tb-mint-ink);
  background: var(--tb-mint);
}

.admin-card-actions button {
  color: var(--tb-accent-deep);
  background: #fff0ec;
}

.gift-refresh-result {
  border-left-color: var(--tb-accent);
  border-radius: 5px;
  background: #fff4f1;
}

.action-sheet .sheet-panel {
  border-radius: 10px 10px 0 0;
  border-top: 3px solid var(--tb-accent);
}

.detail-page-header .text-button {
  border-radius: 4px;
}

.detail-stats article,
.detail-status article {
  border-radius: 5px;
  background: #f1f4f1;
}

.detail-room-link {
  border-radius: 5px;
  color: var(--tb-mint-ink);
  background: var(--tb-mint);
}

.detail-actions button,
.button-row button,
.bounty-actions button {
  border-radius: 5px;
}

.pager button {
  border-radius: 4px;
  color: var(--tb-ink-soft);
  background: #e9efeb;
}

.bottom-tabs {
  max-width: 600px;
  border-top-color: var(--tb-line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 20px rgba(20, 36, 31, 0.07);
}

.bottom-tabs button.active {
  color: var(--tb-accent);
}

.toast {
  border-radius: 6px;
  background: var(--tb-ink);
}

.toast.error {
  background: var(--tb-accent-deep);
}

.bind-page {
  background: var(--tb-canvas);
}

.bind-nav {
  border-bottom: 1px solid var(--tb-line);
  color: var(--tb-ink);
}

.bind-step-title {
  color: var(--tb-ink);
}

.bind-code-row input {
  border-radius: 6px;
}

@keyframes tb-page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tb-card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-page.active > :not(.bottom-tabs) {
  animation: tb-page-enter 0.34s ease both;
}

.anchor-card,
.rank-item,
.feed-item,
.bounty-item {
  animation: tb-card-enter 0.34s ease both;
}

.anchor-card:nth-child(2n),
.rank-item:nth-child(2n),
.feed-item:nth-child(2n),
.bounty-item:nth-child(2n) {
  animation-delay: 0.04s;
}

.anchor-card:nth-child(3n),
.rank-item:nth-child(3n),
.feed-item:nth-child(3n),
.bounty-item:nth-child(3n) {
  animation-delay: 0.08s;
}

@media (hover: hover) {
  .anchor-card,
  .rank-grid article,
  .settings-card button,
  .primary-button,
  .ghost-button,
  .header-refresh,
  .bottom-tabs button {
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  }

  .anchor-card:hover,
  .rank-grid article:hover {
    border-color: #b9cfc4;
    transform: translateY(-2px);
  }

  .primary-button:hover {
    background: var(--tb-accent-deep);
    transform: translateY(-1px);
  }

  .header-refresh:hover {
    border-color: var(--tb-accent);
    color: #fff;
    background: var(--tb-accent);
    transform: rotate(18deg);
  }

  .settings-card button:hover {
    color: var(--tb-accent-deep);
    background: #fff7f4;
  }
}

@supports (animation-timeline: view()) {
  #homePage .section-block {
    animation: tb-page-enter linear both;
    animation-timeline: view();
    animation-range: entry 8% cover 24%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 420px) {
  .app-header {
    min-height: 124px;
    padding: 22px 14px 19px;
  }

  .app-header h1 {
    font-size: 28px;
  }

  .user-strip,
  .metrics-grid,
  .section-block,
  .settings-card,
  .wallet-panel,
  .rank-grid,
  .rank-tabs {
    width: calc(100% - 24px);
  }

  .user-strip {
    grid-template-columns: 42px minmax(0, 1fr) minmax(78px, auto);
    gap: 8px;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }

  .strip-side {
    min-width: 78px;
    padding-left: 8px;
  }

  .header-support {
    font-size: 12px;
  }
}

#rankPage .rank-panel-head h2 {
  margin: 0;
}
