/* ===== 藏宝奇缘 · 交互组件样式 =====
   在现有站设计系统（site.css）之上扩展，复用同一套 CSS 变量与气质 */

/* ---------- 通用容器 ---------- */
.page-head { padding: 56px 0 30px; border-bottom: 1px solid var(--line); }
.page-kicker { margin: 0 0 12px; font-size: 13px; letter-spacing: .28em; color: var(--accent); }
.page-title { margin: 0 0 14px; font-family: var(--font-serif); font-size: 38px; font-weight: 400; line-height: 1.3; }
.page-desc { margin: 0; max-width: 640px; color: var(--ink-2); font-size: 16px; }
.page-body { padding: 40px 0 64px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 15px; font-family: inherit;
  cursor: pointer; transition: all .16s ease; line-height: 1.4;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #832b0f; border-color: #832b0f; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }
.btn-sm { padding: 7px 15px; font-size: 14px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field-label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--ink-2); }
.field-label .req { color: var(--accent); }
.field-hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.input, .textarea, .select {
  width: 100%; padding: 11px 14px; font-size: 15px; font-family: inherit;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; transition: border-color .16s, box-shadow .16s; outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.counter { float: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.checkbox-row input { margin-top: 4px; accent-color: var(--accent); flex: 0 0 auto; }

/* ---------- 卡片 / 面板 ---------- */
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); padding: 26px;
}
.panel-soft { background: var(--bg-soft); border-color: var(--line); }
.panel-title { margin: 0 0 6px; font-family: var(--font-serif); font-size: 19px; font-weight: 400; }
.panel-sub { margin: 0 0 20px; font-size: 14px; color: var(--ink-3); }

/* ---------- 分段切换（藏/寻） ---------- */
.segment {
  display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px;
}
.segment button {
  padding: 9px 26px; border: none; background: transparent; color: var(--ink-2);
  font-size: 15px; font-family: inherit; border-radius: 999px; cursor: pointer;
  transition: all .16s ease;
}
.segment button.on { background: var(--bg); color: var(--accent); font-weight: 500; box-shadow: 0 1px 3px rgba(28,25,23,.08); }

/* ---------- 标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: 999px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent);
}
.chip-plain { background: var(--bg-soft); color: var(--ink-2); border: 1px solid var(--line); }
.chip-done { background: #f0f7f2; color: #2f6b45; }
.chip-wait { background: #fdf6e8; color: #8a6a1f; }
.chip-reject { background: #f8f2f2; color: #8a4040; }

/* ---------- 提示条 ---------- */
.notice {
  padding: 13px 17px; border-radius: 10px; font-size: 14.5px; line-height: 1.7;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-2);
}
.notice-error { background: #fdf3f2; border-color: #f0d5d0; color: #8a3a2c; }
.notice-ok { background: #f2f8f4; border-color: #cfe6d6; color: #2f6b45; }
.notice-info { background: var(--accent-soft); border-color: #f3ddd2; color: #8a4a2c; }
.notice + .notice { margin-top: 10px; }

/* ---------- 藏宝码展示 ---------- */
.code-box { text-align: center; padding: 30px 24px; }
.code-label { font-size: 13px; color: var(--ink-3); letter-spacing: .14em; margin-bottom: 12px; }
.code-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 42px; letter-spacing: .18em; color: var(--accent);
  font-weight: 600; margin-bottom: 8px; user-select: all;
}
.code-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------- 列表项 ---------- */
.item-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: none; }
.item-main { min-width: 0; flex: 1; }
.item-title { font-family: var(--font-serif); font-size: 17px; margin: 0 0 4px; }
.item-meta { font-size: 13px; color: var(--ink-3); margin: 0; }
.item-side { flex: 0 0 auto; text-align: right; font-size: 13px; color: var(--ink-3); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 52px 20px; color: var(--ink-3); }
.empty-mark { font-size: 40px; margin-bottom: 14px; opacity: .5; }
.empty-text { font-size: 15px; margin: 0 0 18px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(28,25,23,.42); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; z-index: 100; animation: fadeIn .18s ease;
}
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: 16px; padding: 32px;
  box-shadow: 0 24px 60px rgba(28,25,23,.22); animation: popIn .22s ease;
}
.modal-wide { max-width: 620px; }
.modal-title { margin: 0 0 6px; font-family: var(--font-serif); font-size: 22px; font-weight: 400; }
.modal-sub { margin: 0 0 24px; font-size: 14px; color: var(--ink-3); }
.modal-close {
  position: absolute; top: 16px; right: 18px; width: 32px; height: 32px;
  border: none; background: transparent; color: var(--ink-3); font-size: 22px;
  cursor: pointer; border-radius: 8px; line-height: 1;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal-rel { position: relative; }
.tab-switch { display: flex; gap: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tab-switch button {
  padding: 0 0 12px; border: none; background: transparent; font-size: 16px;
  font-family: inherit; color: var(--ink-3); cursor: pointer; position: relative;
}
.tab-switch button.on { color: var(--ink); font-weight: 500; }
.tab-switch button.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }

/* ---------- 吐司 ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  padding: 12px 22px; border-radius: 999px; font-size: 14.5px; color: #fff;
  background: rgba(28,25,23,.92); box-shadow: 0 8px 24px rgba(28,25,23,.25);
  animation: toastIn .24s ease; max-width: 88vw;
}
.toast-err { background: rgba(138,58,44,.95); }
.toast-ok { background: rgba(47,107,69,.95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ---------- 留言页 ---------- */
.msg-layout { display: grid; grid-template-columns: 1fr; gap: 34px; }
@media (min-width: 900px) { .msg-layout { grid-template-columns: 1.15fr .85fr; gap: 44px; } }

.msg-form-panel {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
  background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%);
}
.msg-list-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 18px; font-family: var(--font-serif); font-size: 20px; font-weight: 400;
}
.msg-count { font-size: 13px; color: var(--ink-3); font-family: var(--font-sans); }

.msg-card {
  padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); margin-bottom: 14px; transition: border-color .16s, transform .16s;
}
.msg-card:hover { border-color: #ddd4c6; transform: translateY(-1px); }
.msg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.msg-name { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-size: 13px;
  font-family: var(--font-serif); flex: 0 0 auto;
}
.msg-time { font-size: 12.5px; color: var(--ink-3); }
.msg-body { margin: 0; font-size: 15.5px; line-height: 1.85; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.msg-reply {
  margin-top: 14px; padding: 12px 16px; background: var(--accent-soft);
  border-radius: 10px; font-size: 14.5px; line-height: 1.75; color: #7a3a1c;
}
.msg-reply-label { font-size: 12.5px; color: var(--accent); margin-bottom: 5px; }

/* ---------- 音乐控制 ---------- */
.music-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); color: var(--ink-2);
  font-size: 19px; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(28,25,23,.12); transition: all .16s ease;
}
.music-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.05); }
.music-btn.playing { color: var(--accent); border-color: var(--accent); }
.music-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid var(--accent); opacity: 0; pointer-events: none;
}
.music-btn.playing .music-ring { animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.9); opacity: .7 } 100% { transform: scale(1.5); opacity: 0 } }
.music-tip {
  position: fixed; right: 22px; bottom: 80px; z-index: 90;
  padding: 9px 15px; border-radius: 10px; font-size: 13px;
  background: rgba(28,25,23,.9); color: #fff; white-space: nowrap;
  animation: toastIn .24s ease;
}

/* ---------- 后台 ---------- */
.admin-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 26px; flex-wrap: wrap;
}
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-tab {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); font-size: 14px; font-family: inherit; color: var(--ink-2); cursor: pointer;
}
.admin-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.admin-tab .n { opacity: .75; margin-left: 5px; }
.admin-msg {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  margin-bottom: 14px; background: var(--bg);
}
.admin-msg.attention { border-color: #e8d4a8; background: #fffdf7; }
.admin-msg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-msg-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.admin-reply-input { flex: 1; min-width: 180px; }

/* ---------- 统计条 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 34px; }
.stat {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); text-align: center;
}
.stat-n { font-family: var(--font-serif); font-size: 30px; color: var(--accent); line-height: 1.2; }
.stat-l { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
@media (max-width: 620px) { .stat-row { grid-template-columns: 1fr; } }

/* ---------- 找宝藏输入 ---------- */
.seek-line { display: flex; gap: 10px; align-items: stretch; }
.seek-line .input { flex: 1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; font-size: 17px; }
@media (max-width: 620px) {
  .seek-line { flex-direction: column; }
  .code-value { font-size: 30px; letter-spacing: .12em; }
  .page-title { font-size: 28px; }
  .modal { padding: 24px 20px; }
  .msg-form-panel { padding: 22px 18px; }
}

/* ---------- 图片上传 ---------- */
.upload-zone {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 30px;
  text-align: center; cursor: pointer; transition: all .16s; background: var(--bg-soft);
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone.has-img { padding: 0; border-style: solid; overflow: hidden; }
.upload-zone img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.upload-mark { font-size: 26px; margin-bottom: 8px; opacity: .55; }
.upload-text { font-size: 14px; color: var(--ink-2); }
.upload-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 提示气泡 ---------- */
.tip-inline { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-3); line-height: 1.65; margin-top: 12px; }
