:root {
  --pink: #ff8fb1;
  --pink-soft: #ffd1dc;
  --bg: #fff7fa;
  --card: #ffffff;
  --text: #4a3b41;
  --muted: #9c8a92;
  --border: #f5dde5;
  --danger: #e5738a;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 12px 32px rgba(255, 143, 177, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 143, 177, 0.15);
}

::placeholder {
  color: #c4b2ba;
}

code {
  background: #fff3f7;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 0.92em;
  color: #b4567a;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  border: none;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(255, 143, 177, 0.32);
}

.btn:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn.ghost {
  background: #fff;
  color: var(--pink);
  border: 1px solid var(--pink-soft);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.small {
  padding: 7px 14px;
  font-size: 13px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: #b4567a;
  font-size: 12px;
  line-height: 1.8;
  white-space: nowrap;
}

.tag.gray {
  background: #f3edf0;
  color: var(--muted);
}

.tag.dark {
  background: #ede3e7;
  color: #7c6a72;
}

.feedback {
  min-height: 22px;
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.feedback.error {
  color: #d9536f;
}

.feedback.ok {
  color: #3fa271;
}

/* ---------- 提问页 ---------- */

.page-ask {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 209, 220, 0.6), transparent 46%),
    radial-gradient(circle at 88% 84%, rgba(255, 209, 220, 0.45), transparent 42%),
    var(--bg);
}

.ask-card {
  width: 100%;
  max-width: 560px;
  padding: 36px 32px 28px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.ask-heart {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff3f7;
  color: var(--pink);
  font-size: 26px;
  line-height: 52px;
  text-align: center;
}

.ask-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 25px;
  color: #b4567a;
}

.ask-sub {
  margin: 0 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.ask-card textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 2px 14px;
  font-size: 12px;
  color: var(--muted);
}

.field-meta .hint {
  flex: 1;
  line-height: 1.5;
}

#nickname {
  margin-bottom: 18px;
}

.ask-card .btn[type="submit"] {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  font-size: 16px;
}

/* ---------- 登录 ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, #ffe9f0 0%, transparent 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
  color: #b4567a;
}

.login-sub {
  margin: 0 0 8px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.login-card .feedback {
  margin: 0;
}

/* ---------- 后台 ---------- */

.page-admin {
  padding-bottom: 60px;
}

.admin-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-header h1 {
  margin: 0;
  font-size: 21px;
  color: #b4567a;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #fff3f7;
  flex-shrink: 0;
}

.lang-switch button {
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.lang-switch button.active {
  background: #fff;
  color: #b4567a;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(255, 143, 177, 0.22);
}

.lang-switch-inline {
  justify-content: center;
  margin-top: 4px;
}

.panel {
  max-width: 1180px;
  margin: 0 auto 20px;
  padding: 20px clamp(16px, 2.5vw, 28px);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 6px 22px rgba(255, 143, 177, 0.09);
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #b4567a;
}

.panel > p {
  margin: 0;
}

.link-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.link-row input {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  background: #fff9fb;
}

.link-row .btn {
  flex-shrink: 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat {
  padding: 9px 16px;
  border-radius: 14px;
  background: #fff3f7;
  color: var(--muted);
  font-size: 13px;
}

.stat b {
  margin-left: 6px;
  color: #b4567a;
  font-size: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  transition: all 0.15s;
}

.tab:hover {
  border-color: var(--pink-soft);
  color: #b4567a;
}

.tab.active {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
  font-weight: 600;
}

#search-form {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 220px;
  max-width: 340px;
}

#search-form input {
  padding: 8px 14px;
  font-size: 14px;
}

#search-form .btn {
  flex-shrink: 0;
}

.q-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.q-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
}

.q-select {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 3px;
}

.q-check {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--pink);
  cursor: pointer;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #fff9fb;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.bulk-select-all input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--pink);
  cursor: pointer;
}

.bulk-bar .btn {
  margin-left: auto;
}

.q-item:hover {
  border-color: var(--pink-soft);
  background: #fffafc;
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.q-text {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 6px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.q-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.icon-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.empty {
  padding: 44px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

/* ---------- 详情抽屉 ---------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(74, 59, 65, 0.28);
}

.drawer-body {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  padding: 26px clamp(18px, 4vw, 30px) 40px;
  border-radius: 24px 0 0 24px;
  background: #fff;
  box-shadow: -12px 0 44px rgba(74, 59, 65, 0.14);
  overflow-y: auto;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #fff3f7;
  color: #b4567a;
  font-size: 20px;
  line-height: 1;
}

.drawer h3 {
  margin: 0 0 10px;
  padding-right: 40px;
  font-size: 18px;
  color: #b4567a;
}

.drawer h4 {
  margin: 24px 0 8px;
  font-size: 14px;
  color: #b4567a;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.full-text {
  margin: 12px 0 8px;
  padding: 16px;
  border-radius: 16px;
  background: #fff9fb;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}

.trans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trans-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.trans-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trans-text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.trans-item textarea {
  min-height: 110px;
  margin-top: 10px;
  line-height: 1.7;
}

.trans-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.add-trans {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-trans select {
  flex: 0 0 130px;
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
}

.add-trans input {
  flex: 1;
  min-width: 130px;
  padding: 8px 12px;
  font-size: 14px;
}

.add-trans .btn {
  flex-shrink: 0;
}

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 100;
  max-width: 80vw;
  padding: 10px 22px;
  border-radius: 999px;
  background: #4a3b41;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

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

/* ---------- 大屏 ---------- */

.page-display {
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, #ffe9f0 0%, transparent 60%),
    var(--bg);
}

.display-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 5vh 4vw 14vh;
}

.display-card {
  --fs: max(32px, 2.9vmin);
  display: flex;
  flex-direction: column;
  gap: 2vh;
  width: min(1400px, 94vw);
  height: 70vh;
  padding: 3.5vh clamp(24px, 4vw, 56px) 4vh;
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(255, 143, 177, 0.2);
}

.display-card.tier-1 {
  --fs: max(48px, 4.8vmin);
}

.display-card.tier-2 {
  --fs: max(42px, 4.1vmin);
}

.display-card.tier-3 {
  --fs: max(36px, 3.4vmin);
}

.display-card.tier-4 {
  --fs: max(32px, 2.9vmin);
}

.display-author {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: #b4567a;
  font-size: clamp(15px, 1.9vmin, 22px);
  font-weight: 600;
}

.display-columns {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 80px);
  flex: 1;
  min-height: 0;
}

.display-columns::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 2px dashed var(--border);
  pointer-events: none;
}

.display-col {
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
  min-width: 0;
  min-height: 0;
}

.display-col .tag {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 4px 16px;
  font-size: clamp(13px, 1.4vmin, 18px);
}

.display-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: clamp(4px, 1vw, 12px);
}

.display-pane::-webkit-scrollbar {
  width: 8px;
}

.display-pane::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--pink-soft);
}

.display-text {
  margin: 0;
  color: var(--text);
  font-size: var(--fs);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.display-col .trans-text {
  color: #6b5a62;
  font-size: max(30px, calc(var(--fs) * 0.94));
}

.trans-empty {
  margin: 0;
  color: var(--muted);
  font-size: max(24px, calc(var(--fs) * 0.72));
  line-height: 1.9;
  white-space: pre-line;
}

.display-footer {
  position: absolute;
  bottom: 4vh;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vw, 52px);
}

.display-btn {
  width: clamp(56px, 7vmin, 84px);
  height: clamp(56px, 7vmin, 84px);
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #b4567a;
  font-size: clamp(22px, 2.6vmin, 32px);
  box-shadow: 0 10px 26px rgba(255, 143, 177, 0.26);
  transition: transform 0.15s, opacity 0.15s;
}

.display-btn:hover:not(:disabled) {
  transform: scale(1.06);
}

.display-btn:disabled {
  opacity: 0.38;
}

.display-counter {
  min-width: 90px;
  color: var(--muted);
  font-size: clamp(16px, 2vmin, 24px);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fs-btn {
  position: absolute;
  top: 3vh;
  right: 3vw;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
}

.fs-btn:hover {
  border-color: var(--pink-soft);
  color: var(--pink);
}

.display-empty {
  color: var(--muted);
  font-size: clamp(20px, 2.6vmin, 32px);
}

@media (max-width: 640px) {
  .ask-card {
    padding: 30px 20px 24px;
  }

  .q-item {
    flex-direction: column;
  }

  .q-actions {
    align-self: flex-end;
  }

  .display-card {
    height: 64vh;
    padding: 20px 16px 22px;
    border-radius: 24px;
    gap: 12px;
  }

  .display-columns {
    gap: 18px;
  }

  .display-col .tag {
    font-size: 12px;
  }

  .display-stage {
    padding-bottom: 16vh;
  }
}
