/* 晚间晨风 · 小可乐抽奖 —— 管理端样式
 *
 * 移动优先：下面不带媒体查询的规则就是 360px 手机上的最终布局（单列、无横向
 * 滚动）。>=481px 只在最后做宽度与按钮排布的增强。所有依赖都在本文件与
 * admin.js 内，不引用任何外部字体、图标库或 CDN——管理员或群友网络受限时
 * 页面也必须完整可用。
 *
 * 三条与「手机上单手能用」直接相关的规则：
 * 1. 主操作按钮在 <=480px 时 position: sticky; bottom: 0，并垫上
 *    env(safe-area-inset-bottom)，避开 iPhone 底部横条；
 * 2. 输入框字号 16px：iOS Safari 对 <16px 的输入框会在聚焦时自动放大页面；
 * 3. 所有可点区域 >=48px，一次拇指命中。
 */

:root {
  --bg: #0a0814;
  --bg-soft: #0d0a1a;
  --panel: #151128;
  --panel-2: #1e1836;
  --line: #342a56;
  --line-soft: #272148;
  --text: #efebff;
  --muted: #aca6cc;
  --gold: #f2d9a0;
  --gold-strong: #ffd98a;
  --red: #64318f;
  --red-strong: #8a4bc4;
  --ok: #6fd096;
  --warn: #f0b35b;
  --danger: #ff9ab8;
  --radius: 14px;
  --tap: 48px;
  color-scheme: dark;
}

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

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
}

body {
  /* 背景：原版星空动图（300x300，4 帧 / 500ms）。
     三条关键：
     1. 不放大——放大到 600 会让像素星星变糊、密度减半；
     2. image-rendering: pixelated——保住方块的锐利边缘，否则浏览器平滑
        插值会把星星糊成光斑（这是"看着不一样"的主因）；
     3. 不叠暗色渐变——星星按原亮度显示；面板自身是不透明卡片，文字
        对比度由卡片负责，不需要压暗背景。 */
  background-color: #05030a;
  background-image: url("bg/stars.gif");
  background-repeat: repeat;
  background-size: auto;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}

/* 系统开启「减少动态效果」时换成静态瓦片：动图对前庭敏感人群不友好，
 * 也会在低端机上持续重绘。CSS 无法暂停 WebP，只能换图。 */
@media (prefers-reduced-motion: reduce) {
  body {
    background-image: url("bg/stars-static.png");
  }
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--gold);
  text-decoration: none;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------------ */
/* 顶栏与导航                                                          */
/* ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(10px, env(safe-area-inset-top)) 16px 0;
  background: rgba(12, 9, 24, 0.94);
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  white-space: nowrap;
}

.brand span {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.session {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.session .who {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session .role {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--gold);
}

.link-btn {
  min-height: 32px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.link-btn:active {
  background: var(--panel-2);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.tab {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 4px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.tab.is-active {
  border-bottom-color: var(--gold);
  color: var(--gold);
}

/* ------------------------------------------------------------------ */
/* 页面容器                                                            */
/* ------------------------------------------------------------------ */

.view {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 88px;
}

/* 内容较短的视图（进行中/详情/模板）用一列 flex 撑满视口，
 * 让吸底的主按钮落在屏幕底部，而不是卡片下方半空中。 */
.stack {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 150px);
  min-height: calc(100dvh - 150px);
}

.view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 16px;
}

.view-head h1 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

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

.small {
  font-size: 12px;
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* 发起页「已恢复上次未提交的内容」提示条：左侧文案 + 右侧清空。 */
.draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(242, 217, 160, 0.35);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.draft-notice .link-btn {
  flex: none;
}

.center {
  text-align: center;
}

/* 登录页：不依赖顶栏，自己占满一屏，键盘弹起时仍可滚动。 */
.login-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 20px calc(24px + env(safe-area-inset-bottom));
}

.login-brand {
  margin-bottom: 24px;
  text-align: center;
}

.login-brand h1 {
  font-size: 27px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.login-brand p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.12em;
}

/* ------------------------------------------------------------------ */
/* 表单                                                                */
/* ------------------------------------------------------------------ */

.form {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 190px);
  min-height: calc(100dvh - 190px);
}

.field {
  margin-bottom: 16px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field .req {
  color: var(--danger);
}

input,
textarea,
select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #100d20;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: #8d87b0;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  outline: 2px solid rgba(242, 217, 160, 0.28);
  outline-offset: 0;
}

/* type=number 的上下箭头在手机上很小且容易误触，保留输入但隐藏箭头。 */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-size: 16px;
  line-height: 1.6;
}

/* 「高级设置」默认收起：只有展开后，报名截止时间才出现在屏幕上。 */
.advanced {
  margin-bottom: 16px;
  padding: 4px 12px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(21, 17, 40, 0.5);
}

.advanced > summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

.advanced > summary::-webkit-details-marker {
  display: none;
}

.advanced > summary::after {
  content: "展开";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.advanced[open] > summary::after {
  content: "收起";
}

.advanced .field:first-of-type {
  margin-top: 4px;
}

.form-error {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 154, 138, 0.4);
  border-radius: 10px;
  background: rgba(120, 80, 200, 0.22);
  color: var(--danger);
  font-size: 14px;
}

.form-error-list {
  margin: 6px 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 13px;
  list-style: disc;
}

/* ------------------------------------------------------------------ */
/* 按钮与吸底操作栏                                                    */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn.big {
  min-height: 54px;
  width: 100%;
  font-size: 17px;
}

.btn.primary {
  border-color: #f4d597;
  background: linear-gradient(180deg, #e7bc6d 0%, #bd8138 100%);
  color: #241205;
}

.btn.secondary {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--gold);
}

.btn.danger {
  border-color: rgba(255, 154, 138, 0.5);
  background: linear-gradient(180deg, #6b4bc4 0%, #4a2f92 100%);
  color: #f4f0ff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.actionbar {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.actionbar > .btn {
  flex: 1 1 0;
}

/* 手机：主按钮吸在屏幕底部，留出 Home 指示条的安全距离。
 * 这里是全文件唯一依赖 position: sticky 的地方，桌面端（>=481px）不需要。 */
@media (max-width: 480px) {
  .actionbar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 20px -16px -88px;
    margin-top: auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(
      to top,
      rgba(12, 9, 24, 0.99) 0%,
      rgba(12, 9, 24, 0.96) 62%,
      rgba(12, 9, 24, 0) 100%
    );
  }

  .actionbar > .btn {
    min-height: 54px;
  }
}

/* ------------------------------------------------------------------ */
/* 卡片、状态与数据                                                    */
/* ------------------------------------------------------------------ */

.card {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 24, 54, 0.92), rgba(18, 14, 34, 0.94));
  box-shadow: 0 1px 0 rgba(255, 217, 138, 0.06) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card h2 {
  font-size: 17px;
  line-height: 1.4;
}

.card h3 {
  font-size: 15px;
  color: var(--gold);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.state-open {
  border-color: rgba(111, 208, 150, 0.55);
  color: var(--ok);
}

.badge.state-committed {
  border-color: rgba(240, 179, 91, 0.55);
  color: var(--warn);
}

.badge.state-drawn {
  border-color: rgba(242, 217, 160, 0.55);
  color: var(--gold);
}

.badge.state-void {
  border-color: rgba(255, 154, 138, 0.5);
  color: var(--danger);
}

.draw-title {
  font-size: 24px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.draw-title .times {
  font-size: 17px;
  color: var(--gold);
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 8px;
}

.stat-num {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-strong);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
}

/* 进行中页的报名群友名单：默认前 10 条，可展开全部。 */
.entries-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

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

.entries-head h3 {
  margin: 0;
}

.entries-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.entries-row {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.entries-row:last-child {
  border-bottom: 0;
}

.entries-rank,
.entries-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entries-time {
  white-space: nowrap;
}

.entries-name {
  overflow-wrap: anywhere;
}

.entries-empty,
.entries-more {
  margin-top: 8px;
}

.entries-more .link-btn {
  min-height: 0;
  padding: 0;
  font-size: 13px;
}

.countdown {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.countdown > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.countdown dt {
  color: var(--muted);
  font-size: 13px;
}

.countdown dd {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.countdown .small {
  font-weight: 400;
  text-align: right;
}

.alert-box {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 154, 138, 0.45);
  border-radius: 12px;
  background: rgba(120, 80, 200, 0.22);
  color: var(--danger);
  font-size: 14px;
}

.alert-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 14px 0;
  font-size: 14px;
}

.facts dt {
  color: var(--muted);
  white-space: nowrap;
}

.facts dd {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.hash-block {
  margin: 12px 0;
}

.hash-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.hash {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #100d20;
  color: var(--gold);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.winners {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.winners li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(15, 12, 30, 0.65);
}

.wname {
  font-weight: 700;
  color: var(--gold-strong);
  overflow-wrap: anywhere;
}

.wid {
  color: #9a94bb;
  font-size: 11px;
  overflow-wrap: anywhere;
  text-align: right;
}

/* ------------------------------------------------------------------ */
/* 往期列表与详情                                                      */
/* ------------------------------------------------------------------ */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-row {
  display: block;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(21, 17, 40, 0.85);
  color: var(--text);
}

.history-row:active {
  background: var(--panel-2);
}

.history-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-prize {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.history-k {
  color: var(--gold);
  font-size: 14px;
  white-space: nowrap;
}

.history-date {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.history-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
}

.empty {
  padding: 40px 16px;
  text-align: center;
}

.empty p {
  margin-bottom: 16px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* 模板页                                                              */
/* ------------------------------------------------------------------ */

.tpl-input {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
}

/* 「内置默认 / 已自定义」标记：纯文字，未自定义灰、已自定义高亮。 */
.tpl-status {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.tpl-status.custom {
  color: var(--gold);
  font-weight: 600;
}

/* 「恢复默认」按钮贴右下角，与保存按钮一样不立即提交。 */
.tpl-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vars {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.vars th,
.vars td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.vars th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.vars td:first-child {
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* 群友                                                                */
/* ------------------------------------------------------------------ */

.members-search {
  margin-bottom: 12px;
}

.members {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.members th,
.members td {
  padding: 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.members th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.members .member-nickname {
  max-width: 120px;
  word-break: break-word;
}

.members .member-openid {
  max-width: 240px;
}

.member-openid-text {
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.members .copy-btn {
  margin-left: 6px;
  white-space: nowrap;
}

.members .member-role,
.members .member-seen {
  color: var(--muted);
  white-space: nowrap;
}

/* 按群分组：一个群一个标题 + 成员表；标题右侧是人数与「改名」。 */
.member-group {
  margin-bottom: 18px;
}

.member-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}

.member-group-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}

.group-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.group-rename {
  margin-left: auto;
  white-space: nowrap;
}

/* 发起页「开奖时 @ 谁」：成员多选列表（可滚动，不把表单撑得太长）。 */
.notify-list {
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #100d20;
}

.notify-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.notify-item:hover {
  background: rgba(242, 217, 160, 0.08);
}

/* 覆盖全局 input 的 100% 宽 / 最小高度，复选框只占自己的位置。 */
.notify-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--gold);
  -webkit-appearance: auto;
  appearance: auto;
}

.notify-name {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.notify-openid {
  max-width: 48%;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}

.preview-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.preview-item:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.preview-item h3 {
  margin-bottom: 6px;
}

.preview-text {
  margin: 6px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #100d20;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ */
/* 公示图                                                              */
/* ------------------------------------------------------------------ */

.poster-box {
  margin-top: 10px;
}

.poster {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ------------------------------------------------------------------ */
/* 轻提示                                                              */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 480px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #2b1919;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

.toast.is-error {
  border-color: rgba(255, 154, 138, 0.6);
}

.toast.is-ok {
  border-color: rgba(111, 208, 150, 0.55);
}

/* 加载占位：不做骨架动画，避免低端机持续重绘。 */
.loading {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* 宽屏增强（>=481px）：仍然单列，只把内容收窄居中、按钮靠右。          */
/* ------------------------------------------------------------------ */

@media (min-width: 481px) {
  .view {
    padding: 24px 24px 64px;
  }

  .form {
    min-height: 0;
  }

  /* 桌面端：按钮组居中，宽度随窗口自适应。
     之前是 flex-end + 固定 200px —— 并排两个按钮会贴到右边、且不随窗口变化。
     现在：
     - justify-content: center 让整组居中（单个按钮也是居中的主 CTA）；
     - flex: 0 1 auto 让宽度跟内容走，min/max 夹住，超宽窗口下不会变成两条长条；
     - flex-wrap: wrap 保证窗口很窄时自动换行，而不是把按钮压扁。 */
  .actionbar {
    justify-content: center;
    flex-wrap: wrap;
  }

  .actionbar > .btn {
    flex: 0 1 auto;
    min-width: 180px;
    max-width: 260px;
  }

  .countdown {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .countdown > div {
    display: block;
  }

  .countdown dd {
    text-align: left;
  }

  .countdown .small {
    text-align: left;
  }
}

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