/* 水贝找款 · 全局主题（色值严格按 imge/CLAUDE_UI_REPLACE_INSTRUCTIONS.md 第二节，不要自行调色） */
:root {
  /* 主色 - 深棕色系 */
  --brown-900: #1F120B;
  --brown-800: #2C1810;
  --brown-700: #3E2723;
  --brown-600: #4E342E;
  /* 强调色 - 香槟金 */
  --gold-600: #B8943F;
  --gold-500: #C9A961;
  --gold-400: #D4B87A;
  --gold-100: #F5EBD7;
  /* 背景与卡片 */
  --bg-page: #F5F0E8;
  --bg-card: #FFFFFF;
  --bg-input: #FAFAFA;
  /* 文字 */
  --text-primary: #2C1810;
  --text-secondary: #6D5D54;
  --text-muted: #9E9089;
  --text-on-dark: #FFFFFF;
  --text-gold: #C9A961;
  /* 功能色 */
  --success: #2E7D32;
  --warning: #E65100;
  --danger: #C62828;
  --info: #1565C0;
  /* 边框与阴影 */
  --border-light: #E8E0D5;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 8px rgba(44, 24, 16, 0.08);
  --shadow-float: 0 8px 24px rgba(44, 24, 16, 0.15);
  /* 派生（只由上面的变量组合，不引入新色相） */
  --grad-gold: linear-gradient(135deg, #D4B87A, #C9A961);
  --grad-brown: linear-gradient(180deg, var(--brown-800) 0%, var(--brown-700) 100%);
  --overlay: rgba(31, 18, 11, 0.5);
  --row-alt: #FAF7F2;
}

/* ───────── 重置与排版 ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.caption { font-size: 12px; color: var(--text-secondary); }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.price { color: var(--gold-500); font-weight: 700; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.gold-text { color: var(--gold-500); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── 图标 ───────── */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }

/* ───────── 按钮 ───────── */
.btn-primary, .btn-secondary, .btn-danger, .btn-dark, .btn-text {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm); line-height: 1.4; white-space: nowrap;
  transition: transform .1s ease, filter .15s ease, background .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn-primary {
  background: linear-gradient(135deg, #D4B87A, #C9A961);
  color: var(--brown-800);
  font-weight: 600;
  border: none;
  padding: 10px 24px;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { background: #D7CCC8; color: #9E9E9E; cursor: not-allowed; filter: none; }
.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--gold-400);
  padding: 9px 20px;
}
.btn-secondary:hover { background: var(--gold-100); }
.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 9px 20px;
}
.btn-danger:hover { background: #FFEBEE; }
.btn-dark { background: var(--brown-800); color: var(--gold-400); border: none; padding: 10px 20px; font-weight: 600; }
.btn-text { background: none; border: none; padding: 0; color: var(--gold-600); }
.btn-text:hover { color: var(--gold-500); }
.btn-text.danger { color: var(--danger); }
.btn-primary:active:not(:disabled), .btn-secondary:active:not(:disabled), .btn-danger:active:not(:disabled), .btn-dark:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-secondary:disabled, .btn-danger:disabled, .btn-dark:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 14px !important; font-size: 13px; }
.btn-lg { padding: 13px 28px !important; font-size: 16px; border-radius: 999px; }
.btn-block { display: flex; width: 100%; }
.is-loading { pointer-events: none; opacity: .85; }
.is-loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: zk-spin .7s linear infinite; flex: none;
}
@keyframes zk-spin { to { transform: rotate(360deg); } }

/* ───────── 卡片 ───────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
}
.card-link { display: block; transition: transform .15s ease, box-shadow .15s ease; cursor: pointer; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }

/* ───────── 状态标签 ───────── */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.tag-success { background: #E8F5E9; color: var(--success); }
.tag-warning { background: #FFF3E0; color: var(--warning); }
.tag-danger  { background: #FFEBEE; color: var(--danger); }
.tag-info    { background: #E3F2FD; color: var(--info); }
.tag-gold    { background: var(--gold-100); color: var(--gold-600); }
.tag-muted   { background: #ECEFF1; color: #78909C; }
.tag-yellow  { background: #FFF8E1; color: #A1740B; }      /* 待处理/新手（黄） */
.tag-solid-danger { background: var(--danger); color: #fff; border-radius: 4px; }
.tag-outline-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); border-radius: 4px; }
.tag-ai { background: #E3F2FD; color: var(--info); font-size: 11px; padding: 0 6px; border-radius: 4px; font-weight: 600; }

/* ───────── 表单 ───────── */
.field { display: block; margin-bottom: 14px; }
.field > .label { display: block; font-size: 12px; color: var(--text-primary); margin-bottom: 6px; font-weight: 500; }
.field > .label .req, .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  height: 40px;
  padding: 0 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  color: var(--text-primary);
}
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236D5D54' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:disabled, .input[readonly] { background: var(--bg-input); color: var(--text-secondary); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { flex: 1; }
.input-group .suffix { position: absolute; right: 12px; color: var(--text-muted); pointer-events: none; }
.input-group .prefix { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.input-group .prefix ~ .input { padding-left: 36px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--gold-500); margin: 0; }
.radio-row { display: flex; gap: 24px; flex-wrap: wrap; }

/* 选择标签（多选品类等） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-light); background: #fff; color: var(--text-secondary);
  font-size: 13px; cursor: pointer; transition: all .15s ease; user-select: none;
}
.chip.on { background: linear-gradient(135deg, #F5EBD7, #D4B87A); border-color: var(--gold-400); color: var(--brown-800); font-weight: 600; }

/* ───────── 提示条 ───────── */
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6; }
.notice .ic { margin-top: 2px; }
.notice-gold { background: var(--gold-100); color: var(--brown-700); border: 1px solid #EADBBB; }
.notice-danger { background: #FFEBEE; color: var(--danger); border: 1px solid #F5C6C6; }
.notice-success { background: #E8F5E9; color: var(--success); border: 1px solid #C8E6C9; }
.notice-muted { background: #F1ECE4; color: var(--text-secondary); }

/* ───────── Toast / 遮罩 / 弹窗 ───────── */
.toast-wrap { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(31, 18, 11, .92); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px;
  max-width: min(86vw, 420px); text-align: center; box-shadow: var(--shadow-float); animation: zk-fade .2s ease; }
.toast.ok { background: rgba(46, 125, 50, .95); }
.toast.err { background: rgba(198, 40, 40, .95); }
@keyframes zk-fade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mask { position: fixed; inset: 0; background: var(--overlay); z-index: 900; animation: zk-fade-in .2s ease; }
@keyframes zk-fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 901;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px; }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 空状态 / 加载 */
.empty { text-align: center; color: var(--text-muted); padding: 48px 16px; }
.empty .ic { width: 44px; height: 44px; color: var(--gold-400); margin: 0 auto 10px; display: block; }
.skeleton { background: linear-gradient(90deg, #EFE8DE 25%, #F7F2EA 50%, #EFE8DE 75%); background-size: 200% 100%;
  animation: zk-shimmer 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes zk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--gold-400); border-right-color: transparent;
  animation: zk-spin .7s linear infinite; margin: 30px auto; }

/* 倒计时：最后 15 分钟红色闪烁 */
.cd { font-variant-numeric: tabular-nums; }
.cd-urgent { color: var(--danger); font-weight: 700; animation: zk-blink 1s steps(2, start) infinite; }
@keyframes zk-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .cd-urgent, .skeleton, .is-loading::before { animation: none; } }

/* 看大图（H5 与 PC 后台共用；原来只在 h5.css 里，PC 后台点图片看不到大图） */
.lightbox { position: fixed; inset: 0; z-index: 990; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: zk-fade-in .15s ease; }
.lightbox img, .lightbox video { max-width: 100vw; max-height: 100vh; }
@media (min-width: 768px) { .lightbox img, .lightbox video { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.5); } }
