@charset "UTF-8";
/* ==========================================================================
   礼物系统 —— 全站统一样式表（简约大气）
   --------------------------------------------------------------------------
   约定：
   1. 所有页面都只引这一份 style.css，页面里**不要**写行内 style；
   2. 类名分三块：布局骨架（site-header / admin / card …）、组件（btn / alert /
      badge / table / field …）、页面专区（hero- / gift- / nfc- 开头）；
   3. 颜色统一走 :root 里的变量，改一处全站生效。
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --bg:        #f6f6fa;
  --bg-soft:   #fbfbfd;
  --card:      #ffffff;
  --text:      #1f2233;
  --text-2:    #4a4f66;
  --muted:     #7b8098;
  --line:      #e9e9f2;
  --line-2:    #f1f1f7;

  --brand:     #5656d6;
  --brand-dk:  #4444bd;
  --brand-soft:#eeeefc;
  --accent:    #e0647c;
  --accent-soft:#fdeef1;

  --ok:        #1f9d63;
  --ok-soft:   #e9f7f0;
  --warn:      #b8791a;
  --warn-soft: #fdf4e5;
  --err:       #d0454f;
  --err-soft:  #fdeced;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow:    0 1px 2px rgba(31, 34, 51, .05), 0 8px 24px rgba(31, 34, 51, .05);
  --shadow-lg: 0 18px 50px rgba(31, 34, 51, .10);
  --sidebar:   236px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); }

h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.35; font-weight: 600; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p  { margin: 0 0 1em; }

img { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

code, pre, .mono { font-family: var(--mono); font-size: 13px; }

pre {
  background: #f7f7fb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
}

/* ---------- 3. 通用小工具类 ---------- */
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.wrap-sm { max-width: 720px; }
.muted  { color: var(--muted); }
.small  { font-size: 13px; }
.center { text-align: center; }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 26px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 26px; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.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;
}

.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* 图标：config.php 的 icon() 输出的内联 SVG，尺寸由函数给定 */
.ico { flex: none; display: block; }

/* ---------- 4. 前台外壳：页头 / 页脚 ---------- */
.site-header {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--text); }
.brand:hover { color: var(--brand); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  padding: 7px 13px; border-radius: 9px; color: var(--text-2); font-size: 14px;
}
.site-nav a:hover { background: var(--line-2); color: var(--text); }
.site-nav a.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-user { font-size: 13px; color: var(--muted); }

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 60px;
  padding: 26px 0 34px;
  color: var(--muted);
  font-size: 13px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--brand); }

/* 前台主体留白 */
.page { padding: 34px 0 10px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .lead { color: var(--muted); margin: 0; }

/* ---------- 5. 后台骨架 ---------- */
.admin { display: flex; min-height: 100vh; align-items: stretch; }

.side {
  width: var(--sidebar); flex: none;
  background: #1e2033; color: #c9cbe0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 18px; color: #fff; font-weight: 600; font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.side-brand .brand-mark { background: linear-gradient(135deg, #7c7cf0, var(--accent)); }
.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; color: #c9cbe0; font-size: 14px;
}
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.is-active { background: var(--brand); color: #fff; font-weight: 600; }
.side-link .side-ico {
  width: 18px; height: 18px; flex: none; opacity: .9;
  display: inline-flex; align-items: center; justify-content: center;
}
.side-foot {
  margin-top: auto; padding: 16px 20px 20px; font-size: 12.5px;
  border-top: 1px solid rgba(255, 255, 255, .08); color: #8f93ad;
}
.side-foot a { color: #c9cbe0; }
.side-foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 15px 26px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.content { padding: 24px 26px 60px; max-width: 1180px; }

/* 后台里的返回链接 */
.back-link { font-size: 13px; color: var(--muted); }
.back-link:hover { color: var(--brand); }

/* ---------- 6. 卡片 / 栅格 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-hd {
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-hd h2, .card-hd h3 { margin: 0; }
.card-bd { padding: 20px; }
.card-ft {
  padding: 14px 20px; border-top: 1px solid var(--line-2);
  background: var(--bg-soft); border-radius: 0 0 var(--radius) var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-note { padding: 12px 20px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-sm { gap: 12px; }
.span-2 { grid-column: span 2; }

/* ---------- 7. 数据统计卡 ---------- */
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat-num { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat-delta { font-size: 12.5px; color: var(--ok); margin-top: 6px; }
.stat.is-brand .stat-num { color: var(--brand); }
.stat.is-accent .stat-num { color: var(--accent); }

/* ---------- 8. 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg-soft); white-space: nowrap; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-title { font-weight: 600; color: var(--text); }
.table .t-sub { color: var(--muted); font-size: 12.5px; }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.table-actions .btn { white-space: nowrap; }
/* 数字列统一：居中 + 等宽数字，行与行之间才对得齐 */
.table .t-num { width: 74px; text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 操作列：折叠菜单（<details>，不依赖 JS）。展开是撑开行高而不是绝对定位浮层，
   这样 .table-wrap 的横向滚动不会把它裁掉，手机上也不会点不到。 */
.table td.ops { width: 1%; white-space: nowrap; }
.menu { display: inline-block; text-align: left; }
.menu > summary { list-style: none; cursor: pointer; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: "▾"; margin-left: 6px; font-size: 10px; opacity: .7; }
.menu[open] > summary { background: var(--line-2); }
.menu[open] > summary::after { content: "▴"; }
.menu-list {
  display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 6px;
  min-width: 150px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.menu-item {
  display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: 13px;
  text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.menu-item:hover { background: var(--line-2); }
.menu-item.is-danger { color: var(--err); }
.menu-item.is-danger:hover { background: var(--err-soft); }
.menu-list form { margin: 0; }

.t-empty { padding: 34px 20px; text-align: center; color: var(--muted); }

/* ---------- 9. 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--text-2); white-space: nowrap;
}
.badge-ok   { background: var(--ok-soft);   color: var(--ok); }
.badge-off  { background: #f0f0f4;          color: var(--muted); }
.badge-info { background: var(--brand-soft);color: var(--brand); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err  { background: var(--err-soft);  color: var(--err); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; background: var(--line-2);
  color: var(--text-2); font-size: 12.5px;
}

/* ---------- 10. 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--accent); margin-left: 2px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.input, .textarea, .select {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea { min-height: 132px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: none; padding-right: 34px; }
.input::placeholder, .textarea::placeholder { color: #a8abc0; }
.input-sm { padding: 7px 11px; font-size: 13.5px; }

.file {
  padding: 12px 13px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); font-size: 13.5px; width: 100%;
}
.hint { font-size: 12.5px; color: var(--muted); }
.err-text { font-size: 13px; color: var(--err); }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.inline-form { display: inline-flex; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--text-2); }
.check input { margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 0; }
legend { padding: 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }

/* ---------- 11. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 10px 17px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--line-2); color: var(--text-2); font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  text-align: center;
}
.btn:hover { background: #e8e8f0; color: var(--text); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dk); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #cf5570; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-danger { background: #fff; border-color: #f3c8cc; color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); color: var(--err); }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 12. 提示框 ---------- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px;
  border: 1px solid transparent; margin-bottom: 16px;
}
.alert-ok   { background: var(--ok-soft);   border-color: #bfe6d2; color: #176b46; }
.alert-err  { background: var(--err-soft);  border-color: #f3c8cc; color: #a83038; }
.alert-warn { background: var(--warn-soft); border-color: #f0dcb4; color: #8a5a11; }
.alert-info { background: var(--brand-soft);border-color: #d5d5f6; color: #3f3fa8; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 30px; margin-bottom: 8px; opacity: .8; }
.empty h3 { color: var(--text-2); }

/* ---------- 13. 分页 ---------- */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 16px 20px 4px; }
.pager a, .pager span {
  min-width: 34px; padding: 6px 10px; border-radius: 8px; text-align: center;
  font-size: 13.5px; border: 1px solid var(--line); color: var(--text-2); background: #fff;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .is-disabled { color: #b9bccf; background: var(--bg-soft); }
.pager-info { border: 0; background: transparent; color: var(--muted); margin-left: auto; }

/* ---------- 14. 链接 / 密钥展示 ---------- */
.code-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f7f7fb; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.code-box .mono { overflow-wrap: anywhere; word-break: break-all; color: var(--text); }
.code-key { color: var(--accent); font-weight: 600; }
.copy-btn { flex: none; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #1e2033; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity .2s, bottom .2s;
}
.toast.is-on { opacity: 1; bottom: 44px; }

/* 键值列表 */
.kv { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* 自检清单 */
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.check-item .check-ico { flex: none; font-weight: 700; width: 18px; text-align: center; }
.check-ok  .check-ico { color: var(--ok); }
.check-err .check-ico { color: var(--err); }
.check-item .check-text { color: var(--text-2); }
.setting-group { margin-bottom: 26px; }
.setting-group h3 { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }

/* ---------- 15. 首页 hero ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 8% -10%, #eef0ff 0%, rgba(238, 240, 255, 0) 62%),
    radial-gradient(700px 380px at 100% 0%, #fdeef1 0%, rgba(253, 238, 241, 0) 58%),
    #fff;
  border-bottom: 1px solid var(--line);
  padding: 66px 0 60px;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 46px; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 5px 13px;
  margin-bottom: 16px;
}
.hero-title { font-size: 40px; line-height: 1.25; letter-spacing: -1px; margin-bottom: 16px; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: 16px; color: var(--text-2); max-width: 560px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--muted); }

.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 26px; position: relative;
}
.nfc-demo { display: flex; flex-direction: column; gap: 14px; }
.nfc-demo .tag {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  background: linear-gradient(135deg, #fbfbff, #f3f3fd);
}
.nfc-demo .tag-title { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.nfc-demo .tag-url { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.nfc-demo .wave { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.pulse {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, var(--brand) 0 28%, rgba(86, 86, 214, .18) 30% 100%);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(86, 86, 214, .28); }
  70%  { box-shadow: 0 0 0 16px rgba(86, 86, 214, 0); }
  100% { box-shadow: 0 0 0 0 rgba(86, 86, 214, 0); }
}

.section { padding: 56px 0 8px; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: 26px; letter-spacing: -.5px; }
.section-head p { color: var(--muted); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); position: relative;
}
.step-num {
  width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  margin-bottom: 12px;
}
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 13.5px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.feature-icon {
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 19px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.feature h3 { font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.cta {
  margin: 56px 0 10px; padding: 40px 30px; text-align: center;
  background: linear-gradient(135deg, #1e2033, #35375c); color: #fff;
  border-radius: var(--radius-lg);
}
.cta h2 { color: #fff; }
.cta p { color: #c3c6dd; max-width: 620px; margin: 0 auto 22px; }
/* 深色底上的次要按钮：白字 + 半透明描边，别再用浅色 ghost（对比度太低） */
.cta .btn-ghost { border-color: rgba(255, 255, 255, .38); color: #fff; }
.cta .btn-ghost:hover { background: rgba(255, 255, 255, .14); border-color: #fff; color: #fff; }

.install-notice {
  background: var(--warn-soft); border: 1px solid #f0dcb4; color: #8a5a11;
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}

/* ---------- 16. 礼物展示页（user/show.php） ---------- */
.gift-page {
  background:
    radial-gradient(760px 380px at 12% -8%, #fdeef1 0%, rgba(253, 238, 241, 0) 60%),
    radial-gradient(760px 420px at 100% 4%, #eef0ff 0%, rgba(238, 240, 255, 0) 62%),
    var(--bg-soft);
  min-height: 100vh;
  padding-bottom: 40px;
}
.gift-hero { padding: 46px 0 12px; text-align: center; }
.gift-envelope {
  width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #f0a1b1);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px;
  box-shadow: 0 14px 30px rgba(224, 100, 124, .28);
}
.gift-to { font-size: 13.5px; color: var(--muted); letter-spacing: 2px; }
.gift-title { font-size: 32px; letter-spacing: -1px; margin: 8px 0 10px; }
.gift-from { color: var(--text-2); font-size: 14.5px; }
.gift-meta { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.gift-meta .chip { background: #fff; border: 1px solid var(--line); }

.gift-body { max-width: 760px; margin: 0 auto; }
.gift-message {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 30px 32px; margin: 26px 0;
  font-size: 16px; line-height: 2; color: var(--text);
}
.gift-message p { margin: 0 0 1em; }
.gift-message p:last-child { margin-bottom: 0; }

.gift-section { margin: 34px 0 0; }
.gift-section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.gift-section-head h2 { margin: 0; font-size: 17px; }
.gift-section-head .line { flex: 1; height: 1px; background: var(--line); }

.gift-items { display: flex; flex-direction: column; gap: 20px; }
.gift-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.gift-item-hd {
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.gift-item-hd h3 { margin: 0; font-size: 15px; }
.gift-item-bd { padding: 16px 18px; }
.item-text { white-space: pre-wrap; line-height: 1.95; font-size: 15.5px; }
.item-caption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.media-img { display: block; width: 100%; border-radius: var(--radius-sm); }
/* 后台「内容管理」里的媒体预览：缩略图定尺寸，行高才整齐（前台礼物页仍是通栏大图） */
.table .media-img { width: auto; max-width: 280px; max-height: 180px; object-fit: cover; background: var(--bg); }
.table .t-thin { width: 104px; }
.video-wrap { border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.video-wrap video { display: block; width: 100%; max-height: 70vh; }
.audio-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.audio-row audio { flex: 1; min-width: 220px; }
.audio-ico {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}

.gift-foot { margin-top: 36px; text-align: center; }
.gift-foot .stamp {
  display: inline-block; padding: 14px 22px; border-radius: var(--radius);
  background: #fff; border: 1px dashed var(--line); color: var(--muted); font-size: 13px;
}
.claim-box {
  margin-top: 22px; padding: 20px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.claim-box .claim-text { font-size: 14px; color: var(--text-2); }

/* 密钥校验页 */
.lock-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(700px 360px at 50% -10%, #eef0ff 0%, rgba(238, 240, 255, 0) 65%),
    var(--bg);
}
.lock-card {
  width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 34px 32px; text-align: center;
}
.lock-icon {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 18px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.lock-card h1 { font-size: 21px; margin-bottom: 8px; }
.lock-card .lock-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.lock-card .field { text-align: left; }
.key-input {
  text-align: center; font-family: var(--mono); letter-spacing: 3px; font-size: 16px;
}
.key-hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.key-error { margin-bottom: 18px; }

/* 礼物失效 / 找不到 */
.notice-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.notice-card {
  max-width: 460px; width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 36px 32px; text-align: center;
}
.notice-card .notice-ico { font-size: 34px; margin-bottom: 10px; }
.notice-card h1 { font-size: 20px; }
.notice-card p { color: var(--muted); }
/* 提示页上的按钮组：未签收 / 私密的情况会多给一个出口（登录或回我的礼物） */
.notice-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- 17. 账号中心 ---------- */
.auth-wrap { max-width: 420px; margin: 56px auto 40px; }
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 32px;
}
.auth-title { text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--muted); }

.gift-rows { display: flex; flex-direction: column; gap: 14px; }
.gift-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.gift-row-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gift-row-hd .gift-row-title { font-weight: 600; }
.gift-row-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.gift-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 18. NFC 写卡页 ---------- */
.nfc-card { border-left: 3px solid var(--brand); }
.nfc-payload {
  background: #1e2033; color: #e8e9f5; border-radius: var(--radius);
  padding: 18px 20px; font-family: var(--mono); font-size: 12.5px; line-height: 1.9;
  overflow-wrap: anywhere;
}
.nfc-payload .pk { color: #9a9ddb; }
.nfc-payload .pv { color: #ffd9a0; }
.nfc-status { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 16px 0; }
.nfc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.nfc-dot.is-ready { background: var(--ok); }
.nfc-dot.is-busy  { background: var(--warn); }
.nfc-dot.is-err   { background: var(--err); }
.nfc-steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.nfc-steps li { margin-bottom: 6px; }
.nfc-log {
  margin-top: 16px; background: #f7f7fb; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; min-height: 60px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2); max-height: 200px; overflow-y: auto;
}
.log-line { margin-bottom: 4px; }
.log-ok  { color: var(--ok); }
.log-err { color: var(--err); }
.tag-preview {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px;
  background: linear-gradient(135deg, #fbfbff, #f3f3fd);
}
.tag-preview .tag-title { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

/* ---------- 19. 响应式 ---------- */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { padding: 42px 0 40px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .hero-title { font-size: 31px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); }

  /* 后台侧栏收成顶部横向导航 */
  .admin { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; padding: 10px 12px; }
  .side-link { white-space: nowrap; }
  .side-foot { margin-top: 0; padding: 10px 16px 14px; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 13px 16px; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 15px; }
  .hero-title { font-size: 27px; }
  .gift-title { font-size: 25px; }
  .cols-4, .steps { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .card-bd { padding: 16px; }
  .gift-message { padding: 22px 18px; font-size: 15.5px; }
  .stat-num { font-size: 26px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .auth-card, .lock-card { padding: 26px 20px; }

  /* 收礼人那边：一行里塞不下「标题 + 三个按钮」，改成上下两段、按钮平分整行 */
  .gift-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .gift-row-actions { flex-wrap: wrap; }
  .gift-row-actions .btn, .gift-row-actions form { flex: 1 1 100%; }
  .gift-row-actions form { display: flex; }
  .gift-row-actions .btn { justify-content: center; }
  .menu-list { min-width: 132px; }
}
