/* 《云选集》视觉：米白底 + 墨色 + 暖金点缀，照相馆作品集气质 */
:root {
  --bg: #faf7f1;
  --bg-2: #f3ede3;
  --surface: #ffffff;
  --ink: #2b2722;
  --ink-2: #5c564c;
  --muted: #9a9183;
  --line: #ece3d5;
  --accent: #b08d57;
  --accent-deep: #8c6a39;
  --accent-soft: rgba(176, 141, 87, 0.12);
  --accent-glow: rgba(176, 141, 87, 0.35);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 4px 14px rgba(43, 39, 34, 0.06);
  --shadow: 0 14px 38px rgba(43, 39, 34, 0.10);
  --shadow-lg: 0 22px 60px rgba(43, 39, 34, 0.16);
  --font-title: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-body: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(176,141,87,0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.lock { overflow: hidden; }
img { display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 30px;
  background: rgba(250, 247, 241, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-family: var(--font-title); font-size: 25px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px var(--accent-glow);
}
.brand-text h1 { font-family: var(--font-title); font-size: 23px; font-weight: 700; letter-spacing: 5px; line-height: 1.1; }
.brand-text p { font-size: 12px; color: var(--muted); letter-spacing: 2px; margin-top: 2px; }

.cart-btn {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 10px 20px; font-size: 14px; color: var(--ink);
  transition: all 0.22s ease;
}
.cart-btn b { color: var(--accent-deep); font-weight: 700; }
.cart-btn:hover { border-color: var(--accent); }
.cart-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px var(--accent-glow);
}
.cart-btn.active b { color: #fff; }

/* ---------- 首屏 Hero ---------- */
.hero {
  padding: 26px 30px 26px;
  background:
    radial-gradient(900px 420px at 18% 0%, rgba(176,141,87,0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-2), rgba(243,237,227,0));
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 1280px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  font-size: 12.5px; letter-spacing: 3px; color: var(--accent-deep);
  background: var(--accent-soft); border: 1px solid rgba(176,141,87,0.28);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-title); font-weight: 700;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.25; letter-spacing: 2px;
  max-width: 18em;
}
.hero-stats {
  margin-top: 20px; display: flex; align-items: center; gap: 14px;
  font-size: 14px; color: var(--muted);
}
.hero-stats b { font-family: var(--font-title); font-size: 20px; color: var(--ink); font-weight: 700; margin-right: 4px; }
.hero-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

/* ---------- 布局 ---------- */
.layout {
  display: flex; gap: 30px; align-items: flex-start;
  max-width: 1280px; margin: 0 auto; padding: 30px;
}

/* 左侧分类 */
.sidebar {
  width: 220px; flex-shrink: 0;
  position: sticky; top: 96px;
  display: flex; flex-direction: column; gap: 4px;
  max-height: calc(100vh - 130px); overflow-y: auto;
  scrollbar-width: thin;
}
.side-title {
  font-size: 12px; color: var(--muted); letter-spacing: 3px;
  padding: 0 16px 10px; font-weight: 500;
}
.side-item {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent;
  font-size: 14.5px; color: var(--ink); text-align: left;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.side-item::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 26px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent-deep));
  transition: transform 0.2s ease;
}
.side-item:hover { background: var(--surface); }
.side-item.active {
  background: var(--surface); box-shadow: var(--shadow-sm);
  font-weight: 600; color: var(--accent-deep);
}
.side-item.active::before { transform: translateY(-50%) scaleY(1); }
.side-name { line-height: 1.35; }
.side-count {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.side-item.active .side-count { color: var(--accent-deep); }
/* 「已选」入口：名称带金色小圆点，与普通分类区分 */
.side-item.picked .side-name::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); margin-right: 8px;
  vertical-align: 2px;
}

/* 右侧内容 */
.content { flex: 1; min-width: 0; }
.cat-title {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px;
}
.cat-title h2 { font-family: var(--font-title); font-size: 25px; font-weight: 700; letter-spacing: 3px; }
.cat-title span { font-size: 13px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 24px;
  padding-bottom: 120px;
}

/* 案例卡片 */
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.26s cubic-bezier(.2,.7,.2,1), box-shadow 0.26s, border-color 0.26s;
  cursor: pointer;
  animation: cardIn 0.5s cubic-bezier(.2,.7,.2,1) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #e0d3bd; }
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}

.cover {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: linear-gradient(135deg, #efe7d9, #e6dccc);
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.card:hover .cover img { transform: scale(1.06); }
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.16) 0%, transparent 26%, transparent 70%, rgba(0,0,0,0.22) 100%);
  pointer-events: none; opacity: 0; transition: opacity 0.26s;
}
.card:hover .cover::after { opacity: 1; }

.case-id {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  background: rgba(43, 39, 34, 0.55); color: #fff;
  font-size: 12px; letter-spacing: 1px; font-weight: 500;
  padding: 4px 11px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.case-id.big {
  position: static; display: inline-block; margin-bottom: 10px;
  background: var(--accent); letter-spacing: 2px; font-weight: 600;
  backdrop-filter: none;
}

.check {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); border: 1.5px solid rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: transparent;
  box-shadow: 0 4px 12px rgba(43,39,34,0.18);
  transition: all 0.2s ease;
}
.card:hover .check { color: rgba(176, 141, 87, 0.5); }
.card.selected .check {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent; color: #fff;
  animation: pop 0.34s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

.card-body { padding: 15px 17px 18px; }
.card-body h3 { font-family: var(--font-title); font-size: 18px; font-weight: 600; letter-spacing: 1px; line-height: 1.4; }
.card-body p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 空状态 ---------- */
.empty { padding: 60px 0 120px; }
.empty-card {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 52px 32px; box-shadow: var(--shadow-sm);
}
.empty-card h2 { font-family: var(--font-title); font-weight: 700; letter-spacing: 3px; margin-bottom: 12px; }
.empty-card p { color: var(--muted); font-size: 14px; line-height: 1.9; }

/* ---------- 底部已选栏 ---------- */
.select-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 40;
  display: flex; align-items: center; gap: 18px;
  background: rgba(34, 30, 25, 0.92); color: #fff;
  border-radius: 999px; padding: 11px 13px 11px 24px;
  box-shadow: 0 16px 40px rgba(34, 30, 25, 0.4);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  animation: riseBar 0.32s cubic-bezier(.2,.8,.2,1);
}
@keyframes riseBar { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.select-bar b { color: #e8c889; font-weight: 700; }
.bar-link { color: rgba(255, 255, 255, 0.7); font-size: 13px; transition: color 0.18s; }
.bar-link:hover { color: #fff; }

/* ---------- 按钮 ---------- */
.btn {
  border-radius: 999px; padding: 11px 24px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; transition: all 0.2s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; box-shadow: 0 8px 20px var(--accent-glow);
}
.btn.primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn.primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn.ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn.block { width: 100%; padding: 14px; font-size: 15px; font-weight: 600; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 16px; color: var(--muted); transition: all 0.18s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink); transform: rotate(90deg); }

/* ---------- 弹层通用 ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; }
.overlay-mask {
  position: absolute; inset: 0;
  background: rgba(34, 30, 25, 0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 详情页 */
.detail-panel {
  position: absolute; inset: 0;
  max-width: 960px; margin: 0 auto;
  background: var(--bg);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: rise 0.3s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 28px 32px 20px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.detail-head h2 { font-family: var(--font-title); font-size: 26px; font-weight: 700; letter-spacing: 2px; }
.detail-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.detail-imgs {
  flex: 1; overflow-y: auto; padding: 28px 32px;
  display: flex; flex-direction: column; gap: 20px;
}
.detail-intro {
  background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 18px 22px;
  font-size: 14px; color: var(--ink-2); line-height: 1.95;
  white-space: pre-line;
  box-shadow: var(--shadow-sm);
}
.detail-imgs img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line); background: linear-gradient(135deg, #efe7d9, #e6dccc);
  box-shadow: var(--shadow-sm);
}
.detail-foot {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 18px 32px; border-top: 1px solid var(--line);
  background: var(--surface);
}
.detail-foot .btn.selected-state {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px var(--accent-glow);
}

/* 提交弹窗 */
.modal {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 40px));
  max-height: calc(100vh - 56px); overflow-y: auto;
  background: var(--surface); border-radius: 20px;
  padding: 32px 32px 28px; box-shadow: var(--shadow-lg);
  animation: popModal 0.28s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes popModal { from { transform: translate(-50%, -46%) scale(0.96); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal h2 { font-family: var(--font-title); font-size: 23px; font-weight: 700; letter-spacing: 2px; }
.modal-sub { font-size: 13.5px; color: var(--muted); margin: 8px 0 18px; line-height: 1.7; }
.chosen-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500;
}
.chip i { font-style: normal; cursor: pointer; opacity: 0.55; font-size: 12px; }
.chip i:hover { opacity: 1; }
.modal label {
  display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 16px; font-weight: 500;
}
.modal input {
  display: block; width: 100%; margin-top: 7px;
  border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 15px; font-size: 15px; font-family: inherit;
  background: var(--bg); color: var(--ink); outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.modal input::placeholder { color: #bdb4a5; }
.modal input:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-err { color: #c0492f; font-size: 13px; min-height: 20px; margin-bottom: 6px; line-height: 1.5; }

/* 提交成功态 */
.modal.success { text-align: center; padding: 40px 32px 32px; }
.success-ring {
  width: 76px; height: 76px; margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-size: 38px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px var(--accent-glow);
  animation: pop 0.45s cubic-bezier(.2,1.4,.4,1);
}
.modal.success h2 { letter-spacing: 3px; }
.modal.success .modal-sub b { color: var(--accent-deep); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(12px);
  z-index: 60;
  background: rgba(34, 30, 25, 0.92); color: #fff;
  border-radius: 12px; padding: 13px 24px; font-size: 14px; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: all 0.28s;
  max-width: calc(100vw - 48px); text-align: center;
  box-shadow: 0 12px 30px rgba(34,30,25,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .topbar { padding: 12px 16px; }
  .brand-text p { display: none; }
  .hero { padding: 22px 18px 20px; }
  .hero-title { font-size: 26px; }
  .layout { flex-direction: column; padding: 18px; gap: 16px; }
  .sidebar {
    width: 100%; position: static;
    flex-direction: row; overflow-x: auto; padding-bottom: 6px; gap: 8px;
  }
  .side-title { display: none; }
  .side-item { flex-shrink: 0; border-color: var(--line); background: var(--surface); padding: 10px 14px; }
  .side-item::before { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding-bottom: 110px; }
  .detail-head, .detail-imgs, .detail-foot { padding-left: 18px; padding-right: 18px; }
  .detail-head h2 { font-size: 22px; }
  .select-bar { bottom: 14px; padding-left: 20px; gap: 12px; }
  .modal { padding: 26px 22px 22px; }
}
