/* ===== 基础 ===== */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --text: #17171a;
  --muted: #6f6f78;
  --line: #e7e3dc;
  --accent: #17171a;
  --gold: #a8793b;
  --green: #1f7a4d;
  --red: #b4382f;
  --amber: #9a6a12;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(23, 23, 26, 0.07);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.3; letter-spacing: -0.2px; }
p { margin: 0 0 12px; }
.container { width: min(1160px, 100% - 40px); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt20 { margin-top: 20px; } .mt32 { margin-top: 32px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ===== 顶栏 ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 249, 247, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.5px; font-size: 17px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav a { color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--text); }
.nav .entry-btn {
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 13px; font-family: var(--font);
}
.nav .entry-btn:hover { border-color: var(--text); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 11px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: 0.15s; white-space: nowrap;
}
.btn:hover { border-color: #c9c3b9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #2a2a30; border-color: #2a2a30; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--gold); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* ===== 首页 ===== */
.hero { padding: 54px 0 30px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); letter-spacing: -1px; }
.hero .lead { color: var(--muted); max-width: 620px; font-size: 15px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pill { font-size: 12px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 8px 0 22px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; color: var(--muted); cursor: pointer; font-family: var(--font);
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
select, input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"], input[type="month"], textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; outline: none; width: 100%;
}
select:focus, input:focus, textarea:focus { border-color: #b9b3a8; box-shadow: 0 0 0 3px rgba(168, 121, 59, 0.12); }
textarea { min-height: 84px; resize: vertical; }
.toolbar select { width: auto; min-width: 130px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 22px 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: 0.18s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dcd6cc; }
.card-media { position: relative; aspect-ratio: 3 / 4; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: 0.4s; }
.card:hover .card-media img { transform: scale(1.035); }
.card-media .tag {
  position: absolute; left: 10px; top: 10px; font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); color: #fff; backdrop-filter: blur(4px);
}
.card-media .watermark-note {
  position: absolute; right: 10px; bottom: 10px; font-size: 11px; color: rgba(255,255,255,.85);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.card-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { color: var(--gold); font-weight: 700; font-size: 17px; letter-spacing: -0.3px; }
.price small { font-size: 11px; font-weight: 500; color: var(--gold); }
.empty {
  padding: 70px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface);
}
.pager { display: flex; gap: 8px; justify-content: center; margin: 34px 0 10px; }

/* ===== 详情页 ===== */
.detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); gap: 36px; padding: 34px 0 60px; }
.gallery-main {
  border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); aspect-ratio: 4 / 5;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.thumb { width: 68px; height: 68px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; flex: none; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 16px; }
.buy-box { position: sticky; top: 84px; }
.buy-title { font-size: 22px; letter-spacing: -0.4px; margin-bottom: 8px; }
.buy-price { font-size: 30px; font-weight: 700; color: var(--gold); letter-spacing: -0.6px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13.5px; margin-top: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.spec-item { background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }
.spec-item .k { font-size: 11.5px; color: var(--muted); }
.spec-item .v { font-size: 14px; font-weight: 600; margin-top: 2px; }
details.rule { border-top: 1px solid var(--line); padding: 13px 0; }
details.rule:first-of-type { border-top: 0; }
details.rule summary { cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.rule summary::-webkit-details-marker { display: none; }
details.rule summary::after { content: "+"; color: var(--muted); }
details.rule[open] summary::after { content: "−"; }
details.rule .body { font-size: 13px; color: var(--muted); white-space: pre-wrap; padding-top: 8px; }
.notice { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 11px 13px; line-height: 1.6; }

/* ===== 状态徽标 ===== */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.badge.paid, .badge.ok, .badge.published, .badge.active, .badge.approved { background: #e8f4ec; color: var(--green); }
.badge.pending, .badge.draft, .badge.wait { background: #fdf1dc; color: var(--amber); }
.badge.closed, .badge.unpublished, .badge.none, .badge.revoked { background: #eeece8; color: var(--muted); }
.badge.failed, .badge.full, .badge.rejected, .badge.partial { background: #fbe9e7; color: var(--red); }

/* ===== 订单页 ===== */
.order-card { max-width: 720px; margin: 36px auto 60px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.big-amount { font-size: 32px; font-weight: 700; letter-spacing: -0.8px; }
.timeline { list-style: none; padding: 0; margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.timeline li { padding-left: 18px; position: relative; padding-bottom: 10px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: #ccc6bb; }
.timeline li.done::before { background: var(--green); }
.file-list { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.file-list li:last-child { border-bottom: 0; }

/* ===== 列表 / 表格 ===== */
.list-item { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-thumb { width: 74px; height: 92px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfbf9; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ===== 表单 ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

/* ===== 弹层 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 20, 22, 0.45); display: flex;
  align-items: center; justify-content: center; padding: 20px; z-index: 90;
}
.modal {
  background: var(--surface); border-radius: 16px; padding: 24px; width: min(460px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2); max-height: 86vh; overflow: auto;
}
.modal h3 { margin-bottom: 6px; }

/* ===== 提示 ===== */
#toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: 32px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(23, 23, 26, 0.93); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); animation: toastIn 0.22s ease;
}
.toast.err { background: rgba(180, 56, 47, 0.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 30px 0 44px; color: var(--muted); font-size: 12.5px; }
.site-footer .row-between { align-items: flex-start; }
.site-footer a:hover { color: var(--text); }

/* ===== 后台 ===== */
.admin-login { max-width: 380px; margin: 90px auto; }
.admin-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 26px; padding: 26px 0 70px; }
.admin-side { position: sticky; top: 84px; align-self: start; }
.admin-side .menu { display: flex; flex-direction: column; gap: 4px; }
.admin-side .menu button {
  text-align: left; padding: 9px 13px; border-radius: 9px; border: 0; background: transparent;
  font: inherit; font-size: 14px; color: var(--muted); cursor: pointer;
}
.admin-side .menu button:hover { background: var(--surface-2); color: var(--text); }
.admin-side .menu button.active { background: var(--accent); color: #fff; font-weight: 600; }
.admin-main { min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 23px; font-weight: 700; letter-spacing: -0.6px; margin-top: 4px; }
.stat .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dropzone {
  border: 1.5px dashed #d5cec2; border-radius: 12px; padding: 22px; text-align: center;
  color: var(--muted); font-size: 13px; cursor: pointer; background: #fcfbf9;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); color: var(--text); background: #fdf9f2; }
.progress { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.asset-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.asset-item:last-child { border-bottom: 0; }
.asset-thumb { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; background: var(--surface-2); flex: none; }
.error-list { margin: 8px 0 0; padding-left: 18px; color: var(--red); font-size: 13px; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tiny-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; gap: 22px; }
  .buy-box { position: static; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-side .menu { flex-direction: row; overflow-x: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .container { width: calc(100% - 28px); }
  .site-header .inner { height: 56px; }
  .nav { gap: 12px; font-size: 13px; }
  .hero { padding: 32px 0 20px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px 12px; }
  .card-body { padding: 10px 11px 12px; }
  .card-title { font-size: 13px; }
  .price { font-size: 15px; }
  .panel { padding: 16px; }
  .list-thumb { width: 58px; height: 74px; }
}
