/* ===== Portrait dancing 设计系统 ===== */
:root {
  --bg: #540D15;
  --bg-elev: #14141b;
  --bg-card: #16161e;
  --bg-input: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4efe9;
  --text-dim: #a9a29b;
  --text-mute: #726c67;
  --accent: #E0D4C6;
  --accent-strong: #F2E9DC;
  --accent-soft: rgba(224, 212, 198, 0.14);
  --danger: #e5674f;
  --ok: #5fbf8f;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  /* 字体全部为"引用本机已装字体"，不打包、不外链、不分发；优先开源可商用字体（SIL OFL） */
  --font: system-ui, -apple-system, "Noto Sans SC", "Source Han Sans SC", "HarmonyOS Sans SC",
    "MiSans", "Alibaba PuHuiTi 3", sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", serif;
  --header-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 560px at 12% -12%, rgba(230, 185, 141, 0.1), transparent 62%),
    radial-gradient(760px 460px at 92% -6%, rgba(126, 96, 210, 0.09), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(230, 185, 141, 0.04), transparent 65%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

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

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

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

::selection {
  background: rgba(230, 185, 141, 0.3);
}

/* ===== 头部 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(84, 13, 21, 0.92);
  backdrop-filter: blur(16px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 0;
  object-fit: cover;
  box-shadow: none;
}

.brand__name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: 0.18s;
}

.lang-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ===== 账号菜单 ===== */
.account {
  position: relative;
}

.account__trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 6px 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: 0.18s;
  max-width: 200px;
}

.account__trigger:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, #3a3244, #241f2c);
  border: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  text-transform: uppercase;
}

.account__name {
  font-size: 13px;
  padding-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account__points {
  font-size: 12px;
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  white-space: nowrap;
}

.account__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 328px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  z-index: 60;
  animation: menuIn 0.14s ease;
}

/* 菜单里的积分档位行：信息 + 「使用」按钮（手动指定优先消耗哪一档） */
.account__tier {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  color: var(--text-mute);
  font-size: 11.5px;
  line-height: 1.45;
}

.account__tier-info {
  flex: 1;
}

.account__menu .account__tier-use {
  flex: none;
  width: auto;
  display: inline-flex;
  padding: 3px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.14s;
}

.account__menu .account__tier-use:hover,
.account__tier-use:hover {
  border-color: var(--accent);
  border-style: solid;
  color: var(--accent);
}

.account__menu .account__tier-use.is-active,
.account__tier-use.is-active,
.account__tier-use.is-active:hover {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.account__menu button,
.account__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: 0.14s;
}

.account__menu button:hover,
.account__menu a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.account__menu .menu-danger {
  color: var(--danger);
}

.account__menu-head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.account__menu-head strong {
  display: block;
  font-size: 14px;
}

.account__menu-head span {
  font-size: 12px;
  color: var(--text-dim);
}


/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #E0D4C6;
  color: #540D15;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
  white-space: nowrap;
}

.btn:hover {
  border-color: transparent;
  background: #D5C6B2;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  border-color: transparent;
  background: #E0D4C6;
  color: #540D15;
  box-shadow: 0 10px 26px rgba(230, 185, 141, 0.22);
}

.btn--primary:hover {
  filter: brightness(1.05);
  background: #E0D4C6;
}

.btn--ghost {
  border-color: transparent;
  color: var(--text-dim);
}

.btn--ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn--danger {
  border-color: rgba(229, 103, 79, 0.4);
  color: var(--danger);
}

.btn--danger:hover {
  background: rgba(229, 103, 79, 0.1);
  border-color: var(--danger);
}

.btn--sm {
  padding: 7px 13px;
  font-size: 12.5px;
}

.btn--block {
  width: 100%;
}

.link {
  color: var(--accent);
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== 表单 ===== */
.field {
  display: grid;
  gap: 7px;
}

.field > span {
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 14.5px;
  outline: none;
  transition: 0.16s;
}

.input::placeholder {
  color: var(--text-mute);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input--code {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: ui-monospace, "Cascadia Mono", "Noto Sans Mono", "JetBrains Mono", monospace;
}

.form-stack {
  display: grid;
  gap: 15px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.form-error {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--danger);
}

.form-error:empty {
  min-height: 0;
}

.form-hint {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.5;
}

/* 激活码 + 跳转购买 */
.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.buy-link {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border: 1px dashed rgba(230, 185, 141, 0.45);
  border-radius: 11px;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.16s;
}

.buy-link:hover {
  background: var(--accent-soft);
  border-style: solid;
}

/* ===== 弹窗 ===== */
dialog.modal {
  width: min(448px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
}

dialog.modal::backdrop {
  background: rgba(5, 5, 8, 0.74);
  backdrop-filter: blur(7px);
}

.modal__panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.modal__eyebrow {
  display: block;
  margin-bottom: 7px;
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal__title {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: 0.16s;
}

.modal__close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.modal__foot {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* ===== Toast ===== */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 300;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #1e1e28;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: toastIn 0.2s ease;
  max-width: min(92vw, 460px);
  text-align: center;
}

.toast--ok {
  border-color: rgba(95, 191, 143, 0.5);
  color: #cfeee0;
}

.toast--err {
  border-color: rgba(229, 103, 79, 0.55);
  color: #f6cfc7;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ===== 页脚 ===== */
.site-footer {
  padding: 36px clamp(16px, 4vw, 48px) 44px;
  border-top: 1px solid var(--line);
  color: var(--text-mute);
  font-size: 12.5px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
}

.site-footer a:hover {
  color: var(--accent);
}

/* ===== 小工具 ===== */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

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

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

/* ===== 下拉框 =====
   原生 <select> 的展开列表由浏览器自己画，默认是「浅色底 + 继承文字色」，
   在深色主题下就变成白底白字、完全看不清。这里三件事：
   1) color-scheme: dark -> 让浏览器按深色渲染原生弹层（Chrome/Edge 生效）；
   2) option 显式给深底浅字 -> 不依赖 color-scheme 的浏览器也有正确配色；
   3) appearance: none + 自绘箭头 -> 去掉各处不一致的系统箭头，视觉统一。 */
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  color-scheme: dark;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% + 1px),
    calc(100% - 14px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

select.input:hover {
  border-color: var(--accent);
}

select.input option,
select.input optgroup {
  background-color: #16161e;
  color: #f4efe9;
}

select.input option:checked {
  background-color: #2b2219;
  color: var(--accent-strong);
}

/* 日期/时间控件的原生图标同理：不声明就是深色图标压在深色底上 */
input[type="date"].input,
input[type="time"].input,
input[type="datetime-local"].input {
  color-scheme: dark;
}

/* ===== 积分充值弹窗 ===== */
.recharge-panel {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.recharge-banner {
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--accent-soft), rgba(230, 185, 141, 0.05));
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.recharge-list {
  display: grid;
  gap: 10px;
}

.recharge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color 0.15s ease;
}

.recharge-item:hover {
  border-color: var(--line-strong);
}

.recharge-item__info strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.recharge-item__info span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12.5px;
}

/* 充值套餐「单图最低价」高亮 */
.recharge-item__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.recharge-item__price.is-best {
  color: #E0D4C6;
  font-weight: 700;
}

.recharge-item__badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  background: #E0D4C6;
  color: #540D15;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.recharge-item.is-best {
  border-color: rgba(224, 212, 198, 0.55);
}

.recharge-item.is-best:hover {
  border-color: #E0D4C6;
}

/* 关键提示（青柠绿强调，与全站「绿色 = 重点」一致） */
.form-hint--accent {
  color: #E0D4C6;
}

/* ===== 马赛克动画背景（Vignette Bloom） ===== */
#ascii-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
