* { box-sizing: border-box; }

/* ===== 日间模式（默认，暖羊皮纸底色） ===== */
:root {
  color-scheme: light;
  --bg: #e7d8b4;
  --surface: #f3e9ce;
  --surface-2: #ecdfbd;
  --border: #c9b183;
  --gold: #b8860b;
  --gold-bright: #8a6a1a;
  --gold-deep: #d4af37;
  --text: #2c2110;
  --text-dim: #746441;
  --green: #00733e;
  --red: #d3202a;
  --blue: #0e68ab;
  --header-bg: #efe3c2;
  --hint-bg: #e8d8ae;
  --code-bg: #e2d0a4;
  --thumb-bg: #ddcba0;
  --ok-bg: #e2efe3;
  --ok-border: #a9c9a8;
  --err-bg: #f5e3dd;
  --err-border: #d9a89a;
  --err-text: #d3202a;
  --card-shadow: 0 8px 20px rgba(90, 70, 30, 0.16);
}

/* ===== 夜间模式（龙与地下城暗色地城风） ===== */
:root.theme-dark {
  color-scheme: dark;
  --bg: #17120d;
  --surface: #211a13;
  --surface-2: #2a2118;
  --border: #3d3225;
  --gold: #c9a227;
  --gold-bright: #e0c890;
  --gold-deep: #8a6a20;
  --text: #ece4d6;
  --text-dim: #a89a84;
  --green: #4e8a5a;
  --red: #d4483a;
  --blue: #4a7ab8;
  --header-bg: #0f0b07;
  --hint-bg: #2a2118;
  --code-bg: #3a2f1a;
  --thumb-bg: #0f0b07;
  --ok-bg: #1c2a1c;
  --ok-border: #3a5a3a;
  --err-bg: #2f1a18;
  --err-border: #6a3028;
  --err-text: #e08a78;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* 夜间：按钮用龙红（D&D 地城风格） */
:root.theme-dark button {
  background: var(--red);
  color: #fff;
}
:root.theme-dark button:hover { background: #c13830; }
:root.theme-dark .market-page .add-cart-btn,
:root.theme-dark .market-page .wanted-publish-btn {
  background: linear-gradient(180deg, #e06050, var(--red));
  border: 1px solid #8a2820;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
:root.theme-dark .market-page .shop-card-price,
:root.theme-dark .market-page .card-cell-price,
:root.theme-dark .market-page .offer-price,
:root.theme-dark .market-page .reviews-rate {
  color: var(--red);
}

html { background: var(--bg); }

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  background: var(--header-bg);
  color: var(--text);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--gold-deep);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--gold);
  border: 1px solid var(--gold-deep);
  padding: 0 12px;
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-toggle svg { flex-shrink: 0; }
.theme-toggle:hover { background: var(--hint-bg); color: var(--gold-bright); }

header h1 {
  font-family: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 20px;
  margin: 0;
  color: var(--gold-bright);
  letter-spacing: 1px;
  font-weight: 700;
}

header h1 .brand-mark {
  color: var(--gold);
  font-size: 15px;
  margin-right: 8px;
}

header nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-right: 16px;
}
header nav a:hover { color: var(--gold-bright); }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  border: 1px solid;
}
.flash.ok { background: var(--ok-bg); color: var(--green); border-color: var(--ok-border); }
.flash.error { background: var(--err-bg); color: var(--err-text); border-color: var(--err-border); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}
/* 手机端返回按钮：把顶部「← 返回」文字链接做成明显的大按钮（触控 ≥40px） */
.toolbar > a,
header a.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--gold-bright);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

button {
  background: var(--gold-deep);
  color: #1a1510;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
button:hover { background: var(--gold); }
button.danger { background: #6a3a30; color: #f0d5cd; }
button.danger:hover { background: var(--red); color: #1a1510; }

table.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
table.list th, table.list td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
table.list th { background: var(--surface-2); color: var(--text-dim); font-weight: 600; }
table.list td.empty { text-align: center; color: var(--text-dim); padding: 24px; }

.thumb { width: 48px; height: 66px; object-fit: contain; background: var(--thumb-bg); border-radius: 4px; }

.hint {
  background: var(--hint-bg);
  border: 1px solid var(--gold-deep);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--gold-bright);
}
.hint code { background: var(--code-bg); color: var(--gold-bright); padding: 1px 5px; border-radius: 4px; }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-dim); }
.form input, .form select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
}
.form button { align-self: flex-start; }

.form label.remember-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.remember-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--gold);
}

.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row input { flex: 1; min-width: 0; min-height: 40px; }
.captcha-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.captcha-box img {
  width: 132px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
}
.captcha-refresh {
  font-size: 12px;
  line-height: 1;
  color: var(--gold);
  white-space: nowrap;
}

.card-detail { display: flex; gap: 24px; flex-wrap: wrap; }
.card-image img { width: 244px; border-radius: 12px; box-shadow: var(--card-shadow); }
.card-info { flex: 1; min-width: 300px; }
table.info td { padding: 6px 12px 6px 0; font-size: 14px; }
table.info td:first-child { color: var(--text-dim); }

.search-box {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  background: var(--surface-2);
  color: var(--text);
}
.search-box:focus { border-color: var(--gold); outline: none; }

.set-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.set-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.set-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
}
.set-group-header:hover { background: var(--surface-2); }

.set-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.set-icon.small { width: 20px; height: 20px; }

.set-group-main { flex: 1; }

.set-children {
  border-top: 1px solid var(--border);
  padding: 6px 14px 10px 54px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.set-child {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 6px;
}
.set-child:hover { background: var(--hint-bg); color: var(--gold-bright); }

.set-name { font-weight: 600; font-size: 14px; color: var(--text); }
.set-meta { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.set-child .set-meta { margin-top: 0; margin-left: auto; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.card-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-cell img { width: 100%; border-radius: 6px; }
.card-cell-link { display: block; text-decoration: none; color: inherit; }
.card-cell-effect {
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
}
.card-cell-effect:hover { text-decoration: underline; }
.card-cell-name { font-size: 12px; font-weight: 600; color: var(--text); }
.card-cell-meta { font-size: 11px; color: var(--text-dim); }
.lang-toggle {
  font-size: 10px;
  padding: 1px 5px;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  vertical-align: middle;
}
.lang-toggle:hover { color: var(--gold-bright); border-color: var(--gold); }
.card-cell-price { font-size: 13px; font-weight: 600; color: var(--gold-bright); }

.badge-instock {
  display: inline-block;
  background: var(--hint-bg);
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.add-btn { font-size: 12px; padding: 4px 10px; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.pagination a { color: var(--gold); text-decoration: none; }
.pagination a:hover { color: var(--gold-bright); }

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.form-inline input, .form-inline select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
}
.form-inline input[name="name"] { flex: 1 1 220px; }
.form-inline input[name="set_code"], .form-inline input[name="number"] { width: 150px; }
.form-inline .scan-entry-btn {
  padding: 8px 16px;
  font-size: 14px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-contact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  white-space: pre-line;
  font-size: 14px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.shop-search { margin-bottom: 16px; }
.shop-search .search-box { margin-bottom: 0; }

.shop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
}
.shop-card img { width: 100%; display: block; }
.shop-card-link { display: block; text-decoration: none; color: inherit; }
.shop-card-name { font-size: 13px; font-weight: 600; padding: 6px 8px 0; color: var(--text); }
.shop-card-meta { font-size: 11px; color: var(--text-dim); padding: 2px 8px; }
.shop-card-note { font-size: 12px; color: var(--gold-bright); padding: 2px 8px; }
.shop-card-price { font-size: 15px; font-weight: 700; color: var(--red); padding: 4px 8px 10px; }

.login-box {
  max-width: 360px;
  margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--gold-deep);
  border-radius: 10px;
  padding: 24px;
}

.form textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: var(--surface-2);
  color: var(--text);
}

.public-url-bar {
  background: var(--hint-bg);
  border: 1px solid var(--gold-deep);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--gold-bright);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.public-url-bar a {
  color: var(--gold);
  font-weight: 600;
  word-break: break-all;
}
.public-url-label { font-weight: 600; margin-right: 4px; }
.public-url-sep { color: var(--gold-deep); }

.cart-link { color: var(--gold); text-decoration: none; font-weight: 600; }
header .cart-link { color: var(--gold-bright); margin-left: auto; }
header .cart-link:hover { color: var(--gold); text-decoration: underline; }

/* 头像（导航栏昵称左侧，微信头像尺寸 40px 圆形） */
.header-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--gold-deep);
  box-sizing: border-box;
}
.user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-deep);
  color: #1a1510;
  font-size: 18px;
  font-weight: 700;
  box-sizing: border-box;
}

/* 个人中心头像 + 上传 */
.me-avatar-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.me-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-deep);
  flex-shrink: 0;
  box-sizing: border-box;
}
.me-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-deep);
  color: #1a1510;
  font-size: 36px;
  font-weight: 700;
  box-sizing: border-box;
}
.avatar-form {
  display: flex;
  align-items: center;
}
.me-avatar-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: opacity 0.15s;
}
.me-avatar-label:hover { opacity: 0.85; }
.me-avatar-label input { display: none; }
.me-avatar-cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1510;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  box-sizing: border-box;
}
.me-avatar-hint {
  font-size: 13px;
  color: var(--text-dim);
}

/* 头像裁剪弹层 */
.crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.crop-overlay.show { display: flex; }
.crop-box {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.crop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.crop-head .link-danger { margin-left: 0; }
.crop-body {
  height: 320px;
  background: #000;
}
.crop-body img {
  display: block;
  max-width: 100%;
}
.crop-tip {
  padding: 10px 16px 0;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.crop-actions {
  padding: 12px 16px 16px;
  display: flex;
  justify-content: center;
}

.cart-badge {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  background: #d4483a;
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 12px;
  margin-left: 2px;
  font-weight: 700;
}

.add-cart-btn {
  margin-top: 6px;
  width: 100%;
  background: var(--gold-deep);
  color: #1a1510;
  border: none;
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.add-cart-btn:hover { background: var(--gold); }
.add-cart-btn.added { background: #3a5a44; color: #d6f0dc; }

.cart-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px 8px;
}
.cart-add-row .qty-select {
  padding: 6px 10px;
  min-height: 34px;
  box-sizing: border-box;
}
.cart-add-row .add-cart-btn {
  margin-top: 0;
  width: auto;
  padding: 6px 12px;
  min-height: 34px;
}

.wish-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.wish-add-row .add-cart-btn { margin-top: 0; width: auto; padding: 6px 10px; font-size: 12px; }
.wish-finish-select {
  padding: 6px 26px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888888' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.cart-set { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.cart-note { font-size: 12px; color: var(--gold-bright); margin-top: 2px; }
.qty-cell { white-space: nowrap; }
.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.qty-btn:hover { background: var(--surface); border-color: var(--gold-deep); }
.qty { display: inline-block; min-width: 24px; text-align: center; }
.remove-btn {
  background: var(--surface);
  color: var(--red);
  border: 1px solid var(--err-border);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.remove-btn:hover { background: var(--err-bg); }

.cart-total {
  text-align: right;
  font-size: 16px;
  margin: 16px 0 24px;
}
.cart-total strong { color: var(--gold-bright); font-size: 18px; }

.wish-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.wish-row .thumb { width: 40px; height: 55px; }
.wish-row-info { flex: 1; min-width: 0; }
.wish-row-link { flex-shrink: 0; line-height: 0; }
.wish-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.wish-row-name:hover { color: var(--gold-bright); }

.checkout-form { max-width: 460px; }

.success-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  font-size: 14px;
}
.success-box p { margin: 8px 0; }

.order-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.order-meta p { margin: 6px 0; }

.order-actions {
  margin-top: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.link-danger {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  margin-left: 10px;
}
.link-danger:hover { text-decoration: underline; }

.foil-tag {
  display: inline-block;
  background: var(--code-bg);
  color: var(--gold-bright);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}

.foil-btn { background: var(--gold-deep); color: #1a1510; }
.foil-btn:hover { background: var(--gold); }

.etched-btn { background: #4a3a6a; color: #e6dcf5; }
.etched-btn:hover { background: #6a4a9a; }

.etched-tag {
  display: inline-block;
  background: #2e2740;
  color: #c3b0e0;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}

.surge-btn { background: #1f4a52; color: #cde8ee; }
.surge-btn:hover { background: #2a6a75; }

.surge-tag {
  display: inline-block;
  background: #1e3438;
  color: #9fd0da;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}

.lang-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}
.lang-en { background: #2a2a2a; color: #c9c9c9; }
.lang-zhs { background: #3a1f1f; color: #e0a0a0; }
.lang-zht { background: #3a2a1a; color: #d0b090; }
.lang-ja { background: #3a1f2e; color: #e0a0c0; }
.stamp-tag {
  display: inline-block;
  background: #8a3a2a;
  color: #f6d5c0;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}

.finish-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 4px 8px 8px;
  flex-basis: 100%;
}
.finish-buttons .add-btn,
.finish-buttons .add-cart-btn {
  margin: 0;
  padding: 4px 8px;
  font-size: 12px;
  width: auto;
  white-space: nowrap;
}
.finish-buttons .add-btn.active {
  box-shadow: 0 0 0 2px var(--gold-bright);
}
.wanted-step-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin: 14px 0 6px;
}
.wanted-sheet-note {
  padding: 10px 12px;
  min-height: 40px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
}
.wanted-lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wanted-lang-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.wanted-lang-btn.active {
  border-color: var(--gold);
  background: var(--gold-deep);
  color: #1a1510;
  font-weight: 700;
}
.img-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 400;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.img-viewer.show { display: flex; }
.img-viewer img {
  max-width: 94%;
  max-height: 94%;
  border-radius: 12px;
}
.qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px 0;
}

.qty-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.nav-badge {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  background: var(--red);
  color: #1a1510;
  border-radius: 8px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 16px;
  margin-left: 3px;
  font-weight: 700;
}

.trend-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  max-width: 700px;
}

.muted { color: var(--text-dim); font-size: 13px; }
.muted a { color: var(--text-dim); }

.oracle-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dim);
  white-space: pre-line;
  margin: 8px 0;
}

.stock-input, .sold-input {
  width: 64px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
}
.sold-input { width: 80px; }
.stock-input.saved, .sold-input.saved {
  border-color: var(--green);
  background: var(--ok-bg);
  color: var(--green);
}

#card-preview {
  position: fixed;
  z-index: 9999;
  display: none;
  pointer-events: none;
}
#card-preview img {
  width: 260px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  display: block;
}

.scan-entry-btn {
  display: inline-block;
  background: var(--gold-deep);
  color: #1a1510;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
}
.scan-entry-btn:hover { background: var(--gold); }

.wish-scan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.wish-scan-box {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.wish-scan-box .toolbar { margin-bottom: 12px; }
.wish-scan-box #wish-scan-video {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #000;
}

.scan-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 520px;
}
.scan-video-wrap {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--gold-deep);
}
#scan-video {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #000;
}
.scan-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.scan-controls .qty-select {
  flex: 1;
  max-width: 320px;
  padding: 6px 10px;
}
.scan-flip-btn {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--gold-bright);
  cursor: pointer;
}
.scan-controls .scan-flip-btn {
  flex: 1;
  max-width: 320px;
}
#wish-camera-flip,
#wish-scan-file-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
}
.scan-status {
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.scan-error { margin-bottom: 12px; }
#manual-link { display: inline-block; margin-bottom: 14px; }

.scan-mode {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  margin-left: auto;
}

.confirm-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  max-width: 640px;
}
.confirm-box img {
  width: 180px;
  border-radius: 8px;
  flex-shrink: 0;
}
.confirm-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-name { font-size: 20px; font-weight: 700; color: var(--text); }
.confirm-meta { font-size: 13px; color: var(--text-dim); }
.confirm-price { font-size: 16px; font-weight: 700; color: var(--gold-bright); }
.scan-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scan-price-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.scan-price-row input {
  flex: 1;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  background: var(--surface-2);
  color: var(--text);
}
.scan-cell-price {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  margin: 6px 0 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
}
.confirm-buttons {
  justify-content: flex-start;
  padding: 4px 0 0;
  flex-basis: auto;
}
.confirm-buttons .add-btn {
  padding: 8px 18px;
  font-size: 14px;
}
.confirm-default {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

/* ===== 移动端响应式（手机买家） ===== */
.mobile-cart-bar { display: none; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  main { margin: 12px auto; padding: 0 10px; }
  body.shop-page { padding-bottom: 70px; }

  /* 顶栏吸顶、缩小、店名可截断 */
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 12px;
    gap: 12px;
    flex-wrap: nowrap;
  }
  .brand {
    flex: 1;
    min-width: 0;
  }
  .brand h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
  }
  .market-page .mana-dots { margin-top: 2px; }
  header .cart-link { white-space: nowrap; flex-shrink: 0; }
  .header-cart { display: none; }
  .theme-toggle { padding: 0 10px; font-size: 13px; }

  /* 登录后顶部只显示头像，昵称隐藏；新订单红点移到头像右上角 */
  .header-user-name { display: none; }
  .header-user { position: relative; }
  .header-user .nav-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    margin-left: 0;
    min-width: 14px;
    line-height: 14px;
    font-size: 10px;
    padding: 0 3px;
    border-radius: 7px;
  }

  /* 卡片网格：两列，卡图更大更好点 */
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .shop-card-name { font-size: 12px; padding: 6px 6px 0; }
  .shop-card-meta { font-size: 10px; padding: 2px 6px; }
  .shop-card-price { font-size: 15px; padding: 4px 6px 8px; }

  /* 触控目标加大到手指友好尺寸 */
  .qty-select { padding: 8px 6px; font-size: 14px; min-height: 40px; }
  .search-box { min-height: 40px; }
  .cart-add-row .qty-select {
    height: 40px;
    min-height: 40px;
    padding: 0 28px 0 10px;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237c6b4c' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
  }
  .cart-add-row { gap: 8px; padding: 6px 8px 10px; }
  .cart-add-row .add-cart-btn {
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
    min-height: 40px;
    flex: 1;
  }
  .order-actions .add-cart-btn,
  .order-actions .remove-btn {
    min-height: 40px;
  }

  /* 详情页：图片与信息上下堆叠 */
  .card-detail { flex-direction: column; gap: 16px; }
  .card-image { text-align: center; }
  .card-image img {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: block;
    border-radius: 14px;
  }
  .card-info { min-width: 0; width: 100%; }
  .card-info .add-cart-btn {
    width: 100%;
    max-width: none;
    padding: 14px;
    font-size: 16px;
    min-height: 48px;
  }

  /* 底部固定购物车栏 */
  .mobile-cart-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--header-bg);
    border-top: 1px solid var(--gold-deep);
  }
  .mobile-cart {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
  }
  .mobile-checkout {
    background: var(--gold-deep);
    color: #1a1510;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
  }
  .mobile-checkout:active { background: var(--gold); }

  /* 购物车表格 → 卡片式布局 */
  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td { display: block; }
  .cart-table thead { display: none; }
  .cart-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
  }
  .cart-table td {
    border: none;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
  }
  .cart-table td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 12px;
    min-width: 44px;
    flex-shrink: 0;
  }
  .cart-table td[data-label=""]::before { display: none; }
  /* 卡图一行居中大图 */
  .cart-table td[data-label="卡图"] {
    justify-content: center;
    padding: 4px 0 8px;
  }
  .cart-table td[data-label="卡图"]::before { display: none; }
  .cart-table .thumb { width: 110px; height: 154px; }
  /* 删除按钮靠右 */
  .cart-table td[data-label=""] { justify-content: flex-end; }
  .cart-table .remove-btn { padding: 8px 14px; font-size: 14px; min-height: 40px; }
  .cart-table .cart-qty-select { flex: 1; max-width: 150px; padding: 10px 8px; font-size: 15px; }

  /* 我的店铺表格 → 卡片式布局 */
  .my-shop-table,
  .my-shop-table tbody,
  .my-shop-table tr,
  .my-shop-table td { display: block; }
  .my-shop-table thead { display: none; }
  .my-shop-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
  }
  .my-shop-table td {
    border: none;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
  }
  .my-shop-table td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 12px;
    min-width: 60px;
    flex-shrink: 0;
  }
  .my-shop-table td[data-label="卡图"] { justify-content: center; padding: 4px 0 8px; }
  .my-shop-table td[data-label="卡图"]::before { display: none; }
  .my-shop-table .thumb { width: 110px; height: 154px; }
  .my-shop-table td[data-label="操作"] { justify-content: flex-end; }
  .my-shop-table .link-danger { padding: 8px 16px; font-size: 14px; min-height: 40px; }
  .my-shop-table input[type="number"] { font-size: 15px; padding: 8px 6px; min-height: 40px; }
  .my-shop-table button[type="submit"] { padding: 8px 16px; min-height: 40px; font-size: 14px; }

  /* 收货表单占满、输入更易点 */
  .checkout-form { max-width: none; }
  .checkout-form input,
  .checkout-form select,
  .checkout-form textarea {
    font-size: 16px;
    padding: 12px 10px;
  }
  .checkout-form select {
    min-height: 40px;
  }
  .checkout-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    min-height: 48px;
  }

  /* 心愿单：搜索区按钮 + 单卡行控件触控加大 */
  #wish-search-btn,
  .scan-entry-btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 14px;
  }
  .form-inline button {
    min-height: 40px;
    padding: 8px 16px;
  }
  .form-inline input {
    min-height: 40px;
  }
  .form-inline select {
    height: 40px;
    min-height: 40px;
    padding: 0 28px 0 10px;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237c6b4c' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
  }
  .me-avatar-row {
    flex-wrap: wrap;
  }
  .wish-finish-select {
    height: 40px;
    padding: 8px 26px 8px 10px;
    font-size: 14px;
  }
  .wish-add-row .add-wish-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
  }
  #wish-scan-close {
    min-height: 40px;
    min-width: 44px;
    padding: 8px 12px;
    font-size: 14px;
  }
  .wish-row { gap: 8px; }
  .wish-row .remove-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
  }
  .wanted-del-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
  }
  .wish-row .wish-qty-select {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 15px;
  }

  /* 系列浏览：子系列链接触控加大 */
  .set-child {
    padding: 10px 8px;
    min-height: 40px;
  }
}

/* ============ 玩家市场 ============ */
.market-seller-block { margin-bottom: 24px; }
.market-seller-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.market-seller-head h4 { margin: 0; font-size: 16px; }
.market-seller-head h4 a { color: var(--text); text-decoration: none; }
.market-seller-head h4 a:hover { color: var(--gold-bright); }

.offer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}
.offer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.offer-main { flex: 1; min-width: 0; }
.offer-name { font-weight: 600; font-size: 14px; }
.offer-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.offer-price { font-weight: 700; color: var(--gold-bright); font-size: 16px; white-space: nowrap; }

.market-cart-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.market-cart-head {
  font-size: 14px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.market-cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.market-cart-item:last-child { border-bottom: none; }
.market-cart-item .thumb { width: 44px; height: 62px; border-radius: 4px; }
.market-cart-info { flex: 1; min-width: 0; }
.market-cart-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cart-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-bright);
  white-space: nowrap;
}
.market-cart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}
.message-item {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.message-item:hover { border-color: var(--gold-deep); box-shadow: 0 3px 12px rgba(90,70,30,.12); }
.message-item.unread {
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, var(--surface-2), var(--surface));
}
.message-item.unread .message-item-name { font-weight: 700; color: var(--gold-bright); }
.message-item-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--gold-deep);
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(90,70,30,.16);
}
.message-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-deep);
  color: #241a08;
  font-size: 18px;
  font-weight: 700;
  box-sizing: border-box;
}
.message-item-body { flex: 1; min-width: 0; }
.message-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.message-item-name { font-weight: 600; font-size: 14px; }
.message-item-time { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.message-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}
.message-item-preview {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.message-unread-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: var(--red);
  color: #fff;
  border-radius: 9px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
  margin-bottom: 18px;
  padding: 10px 0;
}
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
}
.message-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.message-row.theirs { align-self: flex-start; }
.message-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  max-width: 76%;
}
.message-side .message-bubble { max-width: 100%; }
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--gold-deep);
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(90,70,30,.16);
}
.message-bubble {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(90,70,30,.14);
}
.message-bubble.mine {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #241a08;
  border-bottom-right-radius: 5px;
}
.message-bubble.theirs {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 4px rgba(90,70,30,.10);
}
.message-content { white-space: pre-wrap; word-break: break-word; }
.message-status { font-size: 11px; opacity: 0.6; padding-right: 4px; }
.message-status.unread { opacity: 1; font-weight: 700; }

.message-form { display: flex; gap: 8px; max-width: 640px; }
.message-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 3px rgba(90,70,30,.06);
}
.message-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.22);
}
.message-form button {
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #241a08;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(90,70,30,.2);
}
.message-form button:hover { filter: brightness(1.06); }

/* 聊天页：输入框固定底部（像微信），消息区在中间滚动 */
.chat-page .market-bottom-nav { display: none; }
.chat-page .icp-footer { display: none; }
.chat-page .message-form {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 210;
  max-width: none;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.chat-page .message-thread {
  margin-bottom: 84px;
}

.me-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.me-stat {
  flex: 1;
  min-width: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.me-stat-num { font-size: 22px; font-weight: 700; color: var(--gold-bright); }
.me-stat-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.me-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.admin-nick { color: var(--blue); font-weight: 700; }

.market-seller-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.market-seller-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
}
.market-seller-row:hover { border-color: var(--gold-deep); }
.seller-row-name { font-weight: 600; font-size: 15px; }
.seller-row-count { font-size: 12px; color: var(--text-dim); flex: 1; }
.seller-row-arrow { font-size: 14px; color: var(--text-dim); }

.market-seller-expand {
  padding: 8px 14px 10px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--surface);
}
.expand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.expand-cards {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.market-img-card {
  position: relative;
  flex-shrink: 0;
  line-height: 0;
}
.market-img-card img {
  width: 60px;
  height: 84px;
  border-radius: 4px;
  display: block;
}
.finish-corner {
  position: absolute;
  right: 3px;
  bottom: 3px;
  font-size: 9px;
  line-height: 1.4;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.finish-corner.stamp { background: #8a3a2a; color: #f6d5c0; }
.seller-enter {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

.wanted-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
}
.wanted-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.wanted-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.wanted-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wanted-user-nick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}
.wanted-user-nick::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.wanted-user-time {
  font-size: 12px;
  color: var(--text-dim);
}
.wanted-official-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 4px;
  padding: 1px 6px;
}
.wanted-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.wanted-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px 5px 5px;
}
.wanted-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.wanted-item-del { flex-shrink: 0; }
.wanted-del-btn { padding: 4px 8px; font-size: 12px; }
.wanted-item-img {
  width: 30px;
  height: 42px;
  border-radius: 3px;
  flex-shrink: 0;
}
.wanted-item-info { min-width: 0; }
.wanted-item-name { font-size: 13px; font-weight: 600; }
.wanted-note { font-size: 13px; color: var(--text-dim); margin-top: 8px; }
.wanted-draft-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.wanted-publish-btn {
  display: block;
  text-align: center;
  background: var(--gold-deep);
  color: #1a1510;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}
.wanted-publish-btn:active { background: var(--gold); }
.wanted-mine-btn {
  display: block;
  text-align: center;
  border: 1px solid var(--gold);
  background: var(--surface-2);
  color: var(--gold-bright);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}
.wanted-mine-btn:active { background: var(--surface); }

.home-wanted-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.home-wanted-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px 13px 18px;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.home-wanted-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-deep);
  box-shadow: 0 8px 24px rgba(90, 70, 30, 0.12);
}
.home-wanted-user {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-wanted-user::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.home-wanted-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}
.home-wanted-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.home-wanted-img {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.home-wanted-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-wanted-more {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--gold-bright);
  text-decoration: none;
  padding: 10px 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-top: 2px;
}
.home-wanted-more:hover { border-color: var(--gold-deep); }

.order-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.order-status {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.order-parties {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  margin-bottom: 8px;
}
.order-ship {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.order-note {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.order-items {
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 4px;
}
.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.order-item:last-child { border-bottom: none; }
.order-item-img {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.order-item-info { flex: 1; min-width: 0; }
.order-item-name { font-size: 14px; font-weight: 600; }
.order-item-link { color: inherit; text-decoration: none; }
.order-item-link:hover { color: var(--gold-bright); }
.order-item-set { font-size: 12px; color: var(--text-dim); }
.order-item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-bright);
  flex-shrink: 0;
}
.order-total {
  font-size: 16px;
  font-weight: 700;
  text-align: right;
  margin-top: 10px;
}
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rating-options {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.rating-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  cursor: pointer;
}

.seller-reviews {
  margin-bottom: 16px;
  max-width: 640px;
}
.reviews-summary {
  font-size: 14px;
  margin-bottom: 8px;
}
.reviews-rate { font-weight: 700; color: var(--gold-bright); }
.reviews-count { color: var(--text-dim); font-size: 13px; }
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.review-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-nick { font-weight: 600; font-size: 13px; }
.review-tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.review-tag.good { background: #2a4a2a; color: #b8e0b8; }
.review-tag.mid { background: #4a4a2a; color: #e0d0a0; }
.review-tag.bad { background: #4a2a2a; color: #e0a0a0; }
.review-content { font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.review-time { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* 市场底部导航（移动端） */
.market-bottom-nav { display: none; }

@media (max-width: 640px) {
  .market-page .header-nav { display: none; }
  .market-page .header-user { margin-left: auto; }
  .market-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    height: 52px;
    background: var(--header-bg);
    border-top: 1px solid var(--gold-deep);
  }
  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
  }
  .mbn-item:active { color: var(--gold-bright); }
  .mbn-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }
  .mbn-icon .cart-badge {
    position: absolute;
    top: -6px;
    right: -12px;
  }
  .mbn-icon .nav-badge {
    position: absolute;
    top: -5px;
    right: -10px;
  }
  .mbn-label {
    font-size: 11px;
    line-height: 1;
  }
  .mbn-me-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
  }
  .mbn-me-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--gold);
    box-sizing: border-box;
  }
  .mbn-me-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-deep);
    color: #241a08;
    font-size: 16px;
    font-weight: 700;
    box-sizing: border-box;
  }
  .mbn-me-avatar .nav-badge {
    position: absolute;
    top: -5px;
    right: -10px;
  }
}

/* ===== 万智牌主题市场美化 ===== */
.market-page {
  background: radial-gradient(ellipse at top, var(--surface-2) 0%, var(--bg) 70%);
}

/* 品牌标题：金色魔法风格 */
.market-page header h1 {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: #604000;
  font-weight: 800;
  letter-spacing: 1px;
}

/* 卡片：万智牌金色卡框 */
.market-page .shop-card,
.market-page .card-cell {
  border: 2px solid var(--gold-deep);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}
.market-page .shop-card:hover,
.market-page .card-cell:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

/* 价格：金色醒目 */
.market-page .shop-card-price,
.market-page .card-cell-price,
.market-page .offer-price,
.market-page .reviews-rate {
  color: var(--gold-bright);
  font-weight: 800;
}

/* 按钮：金色魔法渐变 */
.market-page .add-cart-btn,
.market-page .wanted-publish-btn {
  background: linear-gradient(180deg, var(--gold-deep), var(--gold));
  border: 1px solid var(--gold-bright);
  color: #1a1510;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 卖家行 / 报价行：金色左边框 */
.market-page .market-seller-row,
.market-page .offer-row {
  border-left: 3px solid var(--gold-deep);
}

/* 底部导航：魔法风格 */
.market-bottom-nav {
  border-top: 2px solid var(--gold-deep);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.35);
}

/* 求购卡片 / 卖家店铺卡片：金色描边 */
.market-page .wanted-card,
.market-page .home-wanted-card,
.market-page .review-item {
  border-left: 3px solid var(--gold-deep);
}

/* 品牌区（标题 + 五色法力装饰） */
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.brand h1 { margin: 0; }

/* 五色法力装饰点 */
.mana-dots {
  display: inline-flex;
  gap: 3px;
  margin-top: 3px;
}
.mana-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.mana-dot.w { background: #f5f0dc; border: 1px solid #a99; }
.mana-dot.u { background: #4a90d9; }
.mana-dot.b { background: #6a4a8a; }
.mana-dot.r { background: #d94a3a; }
.mana-dot.g { background: #4a9a4a; }

.brand-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 6px;
}
.title-logo {
  height: 28px;
  width: auto;
  vertical-align: middle;
}

.icp-footer {
  text-align: center;
  padding: 18px 10px 28px;
  font-size: 12px;
  color: #999;
}
.icp-footer a {
  color: #999;
  text-decoration: none;
  margin: 0 6px;
}
.gongan-icon {
  height: 15px;
  width: auto;
  vertical-align: middle;
  margin-right: 3px;
}
.icp-footer a:hover {
  color: #666;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .icp-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .icp-footer a {
    display: inline-block;
    padding: 10px 14px;
    min-height: 40px;
    line-height: 20px;
    font-size: 13px;
    margin: 0;
  }
}

/* ===== 我的快捷菜单（点底部「我的」向上弹出小气泡） ===== */
.me-menu-mask {
  position: fixed; inset: 0; z-index: 300;
  background: transparent;
  opacity: 0; pointer-events: none;
}
.me-menu-mask.show { opacity: 1; pointer-events: auto; }
.me-menu {
  position: fixed; left: 50%; bottom: 54px; z-index: 310;
  min-width: 136px;
  background: var(--surface);
  border: 1px solid var(--gold-deep);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  padding: 4px 0;
  transform: translateX(-50%) translateY(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.me-menu.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: auto;
}
.me-menu-item {
  display: block;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
}
.me-menu-item:active { background: var(--surface-2); }

/* ===== 底部抽屉（点卡弹出详情） ===== */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.42); z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 310;
  width: 100%; max-width: 560px;
  transform: translateX(-50%) translateY(100%);
  transition: transform .38s cubic-bezier(.32,.72,.33,1);
  background: var(--surface); border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; max-height: 84vh;
}
.sheet.show { transform: translateX(-50%) translateY(0); }

.sheet-grabber {
  width: 40px; height: 4px; background: var(--border); border-radius: 2px;
  margin: 10px auto 6px; flex-shrink: 0;
}
.sheet-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; padding: 4px 18px calc(20px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.sheet-head { display: flex; gap: 14px; align-items: flex-start; }
.sheet-img {
  width: 92px; aspect-ratio: 63/88; flex-shrink: 0; border-radius: 8px;
  overflow: hidden; background: var(--surface-2); border: 1px solid var(--border);
}
.sheet-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-info { flex: 1; min-width: 0; }
.sheet-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sheet-name { font-size: 18px; margin: 0; color: var(--text); line-height: 1.3; }
.sheet-lang-btn {
  flex-shrink: 0;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.sheet-tags { margin-bottom: 6px; }
.sheet-meta { font-size: 12px; color: var(--text-dim); }

.sheet-offers { margin-top: 16px; border-top: 1px solid var(--border); }
.sheet-offers-title { font-size: 13px; font-weight: 700; color: var(--gold-bright); padding: 12px 0 4px; }
.sheet-offer { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.sheet-offer:last-child { border-bottom: none; }
.offer-left { flex: 1; min-width: 0; }
.offer-seller { font-size: 14px; font-weight: 600; }
.offer-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.offer-note { font-size: 12px; color: var(--gold-bright); margin-top: 3px; }
.offer-right { display: flex; align-items: center; gap: 10px; }
.offer-price { font-size: 16px; font-weight: 800; color: var(--gold-bright); }
.sheet-add-btn {
  background: var(--gold-deep); color: #1a1510; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
  min-height: 40px;
}
.sheet-add-btn:active { background: var(--gold); }
.sheet-empty { color: var(--text-dim); font-size: 13px; padding: 16px 0; text-align: center; }
.sheet-more {
  display: block; text-align: center; padding: 14px; margin-top: 6px;
  color: var(--gold-bright); font-size: 14px; text-decoration: none;
  border: 1px solid var(--border); border-radius: 10px;
}
.sheet-more:active { background: var(--surface-2); }

/* 加购飞入动画 */
.cart-fly {
  position: fixed; width: 46px; height: 62px; border-radius: 6px; z-index: 320;
  background: linear-gradient(150deg, var(--gold), var(--gold-bright));
  color: #1a1510; display: flex; align-items: flex-end; justify-content: center;
  font-size: 10px; font-weight: 700; padding-bottom: 3px;
  pointer-events: none; transition: all .6s cubic-bezier(.5,-0.2,.8,.6);
}

/* ===== 首页最新求购：横向卡片流 ===== */
.home-wanted-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4px;
}
.home-wanted-slide {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(90, 70, 30, 0.06);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.home-wanted-slide:active {
  transform: scale(0.98);
  border-color: var(--gold-deep);
  box-shadow: 0 8px 22px rgba(90, 70, 30, 0.12);
}
.slide-img {
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border);
  position: relative;
}
.slide-thumb {
  width: 62px;
  height: 87px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--gold-deep);
  box-shadow: 0 3px 8px rgba(90, 70, 30, 0.15);
}
.slide-more {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.slide-body { padding: 12px 14px 13px; }
.slide-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
}
.slide-user::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.slide-name { font-size: 14px; font-weight: 700; margin-top: 8px; }
.slide-finish {
  font-size: 11px;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}
.slide-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 求购区横向滑动卡 + 查看详细 ===== */
.wanted-cards-hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 16px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.wanted-mini {
  flex: 0 0 60px;
  min-width: 0;
  scroll-snap-align: start;
  text-align: center;
}
.wanted-mini-link {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.wanted-mini-img {
  width: 56px;
  height: 78px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--gold-deep);
  background: var(--surface-2);
  display: block;
  margin: 0 auto;
}
.wanted-mini-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wanted-mini-qty {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 1px;
}
.wanted-view-all {
  display: block;
  text-align: center;
  margin: 8px 16px 0;
  padding: 9px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  text-decoration: none;
}
.wanted-view-all:active { background: var(--gold-deep); }

/* ===== 求购详情：整齐网格卡片 ===== */
.wanted-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wanted-cell {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s;
}
.wanted-cell-link {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.wanted-cell-img {
  width: 100%;
  aspect-ratio: 63/88;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.wanted-cell-name {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wanted-cell-meta {
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 10px 0;
}
.wanted-cell-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px 0;
}
.wanted-cell-note {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 10px 0;
  word-break: break-word;
}
.wanted-cell-note-input {
  width: calc(100% - 20px);
  box-sizing: border-box;
  margin: 6px 10px 10px;
  padding: 8px 10px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}
.wanted-cell-price-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 10px;
}
.wanted-cell-price-edit input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
}
.wanted-cell-price-edit .qty-step {
  width: auto;
  padding: 0 10px;
  height: 32px;
  font-size: 13px;
}
.wanted-cell-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  padding: 4px 10px 10px;
}
.wanted-cell-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 0;
  font-size: 13px;
}
.qty-label { color: var(--text-dim); }
.qty-num {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
}
.qty-step {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.qty-step:disabled {
  opacity: 0.4;
  cursor: default;
}
.qty-step:hover:not(:disabled) { border-color: var(--gold-deep); }
.wanted-head-del {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.wanted-head-del:hover { filter: brightness(1.1); }

.wanted-cell-del {
  position: absolute;
  top: 6px;
  right: 6px;
}
.wanted-cell-del .remove-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.wanted-cell-del .remove-btn:hover { filter: brightness(1.15); }

/* ===== 手机端适配：求购数量框、删除按钮、上架备注等触控目标 ===== */
@media (max-width: 640px) {
  .qty-step { width: 40px; height: 40px; font-size: 20px; }
  .wanted-cell-del .remove-btn { width: 34px; height: 34px; line-height: 34px; font-size: 22px; }
  .wanted-head-del { padding: 10px 18px; font-size: 15px; min-height: 40px; }
  .select-sheet-price, .select-sheet-note { min-height: 40px; font-size: 15px; }
  .my-shop-table input[name="note"] { min-height: 40px; font-size: 15px; }
}

/* ===== 购物车批量导入 ===== */
.import-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px dashed var(--gold-deep);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  margin-bottom: 16px;
}
.import-icon { font-size: 20px; }
.import-txt { flex: 1; min-width: 0; }
.import-t1 { font-size: 14px; font-weight: 700; color: var(--gold-bright); }
.import-t2 { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.import-arrow { color: var(--text-dim); }

.import-title { font-size: 16px; font-weight: 800; color: var(--gold-bright); margin-bottom: 6px; }
.import-tip { font-size: 12px; color: var(--text-dim); line-height: 1.7; margin-bottom: 12px; }
.import-tip code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.import-textarea {
  width: 100%;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  resize: none;
  outline: none;
}
.import-actions { display: flex; gap: 10px; margin-top: 14px; }
.import-actions .btn { flex: 1; padding: 13px; border-radius: 10px; border: none; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.import-actions .btn.cancel { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.import-actions .btn.go { background: var(--gold-deep); color: #1a1510; }

.import-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.import-head a { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.import-head span { font-size: 13px; color: var(--text-dim); }
.import-summary { display: flex; gap: 8px; margin-bottom: 14px; }
.sum-pill { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.sum-pill.ok { background: var(--ok-bg); color: var(--green); border: 1px solid var(--ok-border); }
.sum-pill.wait { background: var(--hint-bg); color: var(--gold-bright); border: 1px solid var(--gold-deep); }
.sum-pill.miss { background: var(--err-bg); color: var(--red); border: 1px solid var(--err-border); }
.import-group-title { font-size: 14px; font-weight: 700; padding: 12px 2px 4px; margin-top: 6px; }
.import-group-title.ok { color: var(--green); }
.import-group-title.wait { color: var(--gold-bright); }
.import-group-title.miss { color: var(--red); }
.version-cell { cursor: pointer; }
.version-sheet-name { font-size: 16px; font-weight: 700; padding: 4px 2px 10px; }
.version-list { display: flex; flex-direction: column; gap: 8px; }
.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.version-item.selected { border-color: var(--gold); background: var(--surface-2); }
.version-item-main { flex: 1; min-width: 0; }
.version-item-set { font-size: 14px; font-weight: 600; }
.version-item-seller { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.version-item-price { font-size: 16px; font-weight: 800; color: var(--gold-bright); flex-shrink: 0; }

/* 手机端：批量导入结果触控适配 */
@media (max-width: 640px) {
  .wanted-price-input { min-height: 40px; font-size: 15px; }
  .wanted-add-btn, #auto-import-btn { min-height: 40px; font-size: 15px; }
  .import-summary { gap: 6px; }
  .sum-pill { padding: 8px 4px; font-size: 11px; }
}

.import-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.import-card.miss { opacity: 0.6; }
.ic-top { display: flex; gap: 12px; }
.ic-img { width: 48px; height: 67px; border-radius: 5px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--gold-deep); }
.ic-info { flex: 1; min-width: 0; }
.ic-name { font-size: 14px; font-weight: 700; }
.ic-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.ic-status { font-size: 12px; font-weight: 700; margin-top: 4px; }
.ic-status.ok { color: var(--green); }
.ic-status.miss { color: var(--red); }
.ic-offers { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 6px; }
.io-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.io-seller { flex: 1; min-width: 0; font-weight: 600; }
.io-stock { font-size: 11px; color: var(--text-dim); }
.io-price { font-weight: 800; color: var(--gold-bright); }
.io-add {
  background: var(--gold-deep);
  color: #1a1510;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  min-height: 36px;
}
.io-add:active { background: var(--gold); }

/* ===== 求购详情：横向滑动大卡（和求购区一致） ===== */
.wanted-detail-hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.wanted-detail-card {
  position: relative;
  flex: 0 0 112px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.wanted-detail-link {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.wanted-detail-img {
  width: 84px;
  height: 118px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--gold-deep);
  background: var(--surface-2);
  display: block;
  margin: 0 auto;
}
.wanted-detail-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wanted-detail-meta {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
}
.wanted-detail-price {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  margin-top: 4px;
}
.wanted-detail-del {
  position: absolute;
  top: 6px;
  right: 6px;
}
.wanted-detail-del .remove-btn {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 12px;
  line-height: 26px;
  padding: 0;
  cursor: pointer;
}
