/* 萨满鼓工坊 — 全站样式（沿用原 samangu.html 设计） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f0e8; color: #3d3429; }
.container { max-width: 1300px; margin: 0 auto; padding: 20px; }
/* Login */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.login-box { background: linear-gradient(160deg, #fdf8ee 0%, #ffffff 38%, #fdf3e3 72%, #fbeed7 100%); background-size: 220% 220%; animation: loginGrad 14s ease-in-out infinite alternate; padding: 40px; border-radius: 16px; box-shadow: 0 4px 24px rgba(139,105,20,0.16); width: 100%; max-width: 440px; border: 1px solid rgba(139,105,20,0.10); }
@keyframes loginGrad {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 60% 100%; }
  100% { background-position: 100% 40%; }
}
@media (prefers-reduced-motion: reduce) {
  .login-box { animation: none; }
}
.login-box h1 { text-align: center; margin-bottom: 6px; font-size: 24px; }
.login-box .sub { text-align: center; color: #888; margin-bottom: 24px; font-size: 13px; }
.login-box input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 16px; }
.login-box select { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; }
.login-box .btn-main { width: 100%; padding: 12px; background: #8b6914; color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; margin-bottom: 10px; }
.login-box .btn-main:hover { background: #6d5210; }
.login-box .btn-wechat { width: 100%; padding: 12px; background: #07c160; color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; margin-bottom: 10px; display:flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; }
.login-box .btn-wechat:hover { background: #06ad56; }
.login-box .btn-wechat.disabled { background: #b9e6cc; cursor: not-allowed; }
.login-box .toggle-link { text-align: center; font-size: 14px; color: #888; margin-top: 8px; line-height: 1.8; }
.login-box .toggle-link a { color: #8b6914; cursor: pointer; }
.login-box .role-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.login-box .role-tabs button { flex:1; padding: 10px; border: 1px solid #ddd; background: white; border-radius: 8px; cursor: pointer; font-size: 14px; }
.login-box .role-tabs button.active { background: #8b6914; color: white; border-color: #8b6914; }
.login-box .err { color: #c33; font-size: 13px; margin-bottom: 10px; text-align:center; }
.hint { font-size: 12px; color: #888; margin-top: 4px; }
/* Header */
header { background: white; padding: 15px 30px; border-radius: 12px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); flex-wrap: wrap; gap: 10px; }
header h1 { font-size: 22px; color: #8b6914; }
header .whoami { font-size: 13px; color: #666; }
header .whoami b { color: #8b6914; }
nav button { padding: 8px 16px; margin-left: 10px; border: 1px solid #8b6914; background: white; color: #8b6914; border-radius: 6px; cursor: pointer; }
nav button.active { background: #8b6914; color: white; }
/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-card { background: white; padding: 20px; border-radius: 12px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-card .num { font-size: 32px; font-weight: bold; color: #8b6914; }
.stat-card .label { color: #888; font-size: 14px; margin-top: 5px; }
/* Toolbar */
.toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.toolbar input { flex: 1; min-width: 200px; }
.toolbar button { padding: 10px 20px; background: #8b6914; color: white; border: none; border-radius: 8px; cursor: pointer; }
.toolbar .view-toggle { background: #5a4818; }
/* Grid - List View */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
/* Gallery View — 图片预览模式（卡片式） */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; align-items: stretch; }
.gallery-card { background: white; border-radius: 14px; padding: 14px 16px 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease; }
.gallery-card:hover { box-shadow: 0 6px 22px rgba(0,0,0,0.14); transform: translateY(-2px); }
.gallery-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid #f3ece0; }
.gallery-code { font-size: 15px; font-weight: 700; color: #5a4818; line-height: 1.35; word-break: break-all; }
.gallery-subname { font-size: 12px; font-weight: 400; color: #a09483; margin-top: 2px; }
.gallery-head .status-badge { flex-shrink: 0; margin-top: 1px; }
.gallery-main { display: flex; gap: 14px; align-items: stretch; }
.gallery-img-wrap { width: 148px; min-width: 148px; height: 148px; background: #faf7f2; border: 1px solid #efe7d8; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; flex-shrink: 0; }
.gallery-img-wrap img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform 0.25s; }
.gallery-img-wrap img:hover { transform: scale(1.06); }
.gallery-img-placeholder { color: #ccc; font-size: 44px; }
/* 无图时的可爱 emoji 占位（按客户名哈希生成） */
.gallery-emoji { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 64px; user-select: none; }
.gallery-steps { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gallery-steps-title { font-size: 13px; font-weight: 600; color: #8b6914; margin-bottom: 4px; }
.gallery-steps .step-item { padding: 3px 0; font-size: 12.5px; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-todo { background: #fee; color: #c33; }
.status-doing { background: #ffa; color: #860; }
.status-done { background: #dfd; color: #393; }
.gallery-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid #f3ece0; }
.gallery-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.gallery-progress .pct { font-size: 12px; color: #8b6914; font-weight: 700; flex-shrink: 0; }
.gallery-progress .progress-bar { flex: 1; height: 7px; background: #eee; border-radius: 4px; overflow: hidden; margin-top: 0; }
.gallery-progress .progress-fill { height: 100%; background: linear-gradient(90deg, #8b6914, #c49b38); transition: width 0.3s; }
.gallery-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.gallery-chip { padding: 3px 10px; background: #f7f2e8; color: #6b5a2e; border: 1px solid #ece1cc; border-radius: 12px; font-size: 12px; white-space: nowrap; cursor: default; }
.gallery-chip.hasimg { cursor: zoom-in; }
.gallery-chip.hasimg:hover { background: #8b6914; color: #fff; border-color: #8b6914; }
.gallery-chip.empty { background: #fafafa; color: #b5a98f; border-style: dashed; border-color: #e5e0d5; }
.customer-badge { position: absolute; left: 8px; bottom: 8px; background: rgba(139,105,20,0.92); color: white; font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 600; display:flex; align-items:center; gap:4px; max-width: calc(100% - 16px); overflow: hidden; white-space: nowrap; }
.customer-badge.list { position:static; display:inline-flex; margin-top:8px; }
.mini-icons { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.mini-icon { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; position: relative; }
.mini-icon img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 2px solid #e0d5c0; }
.mini-icon:hover img { border-color: #8b6914; transform: scale(1.1); }
.mini-icon .mini-label { font-size: 10px; color: #666; max-width: 50px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-note { font-size: 12px; color: #c33; margin-top: 6px; }
.gallery-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.gallery-actions button { padding: 5px 12px; border: 1px solid #ddd; background: white; border-radius: 6px; cursor: pointer; font-size: 12px; }
.gallery-actions button:hover { background: #f5f0e8; }
.gallery-meta { font-size: 12px; color: #999; margin-top: 2px; }
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-main { flex-direction: column; }
  .gallery-img-wrap { width: 100%; min-width: 0; height: 190px; }
}
/* Card (list view) */
.card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: relative; }
.card h3 { margin-bottom: 10px; color: #5a4818; }
.progress-bar { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #8b6914, #c49b38); transition: width 0.3s; }
.progress-text { font-size: 12px; color: #888; margin-bottom: 12px; }
.attr { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f5f0e8; font-size: 14px; }
.attr:last-child { border-bottom: none; }
.attr-label { font-weight: 600; min-width: 70px; color: #666; }
.attr-img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; cursor: pointer; }
.attr-img:hover { transform: scale(2); z-index: 10; position: relative; }
.card-actions { margin-top: 12px; display: flex; gap: 8px; }
.card-actions button { flex: 1; padding: 6px; border: 1px solid #ddd; background: white; border-radius: 6px; cursor: pointer; font-size: 13px; }
.card-actions button:hover { background: #f5f0e8; }
/* Steps */
.steps { margin: 12px 0; padding: 10px; background: #faf7f2; border-radius: 8px; }
.steps-title { font-size: 13px; font-weight: 600; color: #8b6914; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.step-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.step-check { width: 20px; height: 20px; border-radius: 4px; border: 2px solid #ccc; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.step-check.done { background: #8b6914; border-color: #8b6914; color: white; }
.step-check.readonly { cursor: default; }
.step-name { flex: 1; }
.step-name.done { text-decoration: line-through; color: #999; }
/* Modal */
.modal-overlay { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); z-index: 100; justify-content: center; align-items: center; padding: 20px; overflow-y: auto; }
.modal { background: white; border-radius: 16px; padding: 30px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal h2 { margin-bottom: 20px; color: #8b6914; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 10px; align-items: center; }
.preview-img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; }
.design-img-preview { width: 100%; max-width: 200px; height: 120px; object-fit: cover; border-radius: 8px; border: 2px solid #ddd; margin-top: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-actions button { padding: 10px 20px; border-radius: 8px; cursor: pointer; border: none; }
.btn-primary { background: #8b6914; color: white; }
.btn-cancel { background: #eee; color: #333; }
/* Admin */
.admin-section { background: white; border-radius: 12px; padding: 20px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.admin-section h3 { color: #8b6914; margin-bottom: 12px; cursor: pointer; user-select: none; }
.admin-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
.admin-item input { flex: 1; padding: 6px; border: 1px solid #ddd; border-radius: 4px; min-width: 120px; }
.admin-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.add-btn { padding: 6px 12px; background: #8b6914; color: white; border: none; border-radius: 6px; cursor: pointer; margin-top: 10px; }
.delete-btn { padding: 4px 8px; background: #fee; color: #c33; border: 1px solid #fcc; border-radius: 4px; cursor: pointer; }
.role-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.role-admin { background: #fee; color: #c33; }
.role-customer { background: #eef; color: #36c; }
.role-designer { background: #e6f4ea; color: #1a7f37; }
.role-artist { background: #efe6f7; color: #6b3fa0; }
/* 绘制进度按钮（设计师） */
.draw-actions { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.draw-btn { padding: 5px 12px; border: 1px solid #d8c9a8; background: #fff; color: #8b6914; border-radius: 6px; cursor: pointer; font-size: 13px; }
.draw-btn:hover { background: #f7f0e0; }
.draw-btn.active { background: #8b6914; color: #fff; border-color: #8b6914; }
/* Zoom */
.zoom-img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.empty { text-align:center; color:#aaa; padding:40px; background:white; border-radius:12px; }
/* ===== 新增：二维码弹窗 ===== */
.qr-box { text-align: center; padding: 10px 0; }
.qr-box img { width: 260px; height: 260px; border: 1px solid #eee; border-radius: 10px; }
.qr-status { margin-top: 12px; font-size: 14px; color: #666; }
.qr-status.ok { color: #1a7f37; }
.qr-status.err { color: #c33; }
/* ===== 新增：邀请链接 ===== */
.invite-url { flex: 2; min-width: 200px; font-size: 12px; padding: 6px; border: 1px solid #ddd; border-radius: 4px; background: #fafafa; color: #555; }
.copy-btn { padding: 5px 12px; background: #8b6914; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; }
.tag-valid { color:#1a7f37; font-size:12px; font-weight:600; }
.tag-used { color:#888; font-size:12px; }
.tag-expired { color:#c33; font-size:12px; }
/* ===== Toast ===== */
#toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(40,32,18,.92); color: #fff; padding: 10px 22px; border-radius: 24px; font-size: 14px; z-index: 999; display: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* ===== 大自然散落特效（落叶 + 光斑，不挡操作） ===== */
.nature-fx { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.nfx { position: absolute; pointer-events: none; will-change: transform, opacity; }
.nfx-leaf { top: -40px; opacity: .6; animation: nfxFall var(--n-dur,14s) linear var(--n-delay,0s) infinite; }
@keyframes nfxFall {
  0%   { transform: translate(0,-5vh) rotate(0deg); opacity: 0; }
  8%   { opacity: .7; }
  50%  { transform: translate(var(--n-drift,40px),48vh) rotate(200deg); }
  92%  { opacity: .55; }
  100% { transform: translate(calc(var(--n-drift,40px) * .4),102vh) rotate(380deg); opacity: 0; }
}
.nfx-bokeh {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,155,56,.14) 0%, rgba(196,155,56,0) 65%);
  animation: nfxBokeh var(--n-dur,20s) ease-in-out var(--n-delay,0s) infinite alternate;
}
@keyframes nfxBokeh {
  from { transform: translate(0,0) scale(.9); opacity: .5; }
  to   { transform: translate(var(--n-dx,40px),var(--n-dy,30px)) scale(1.1); opacity: .9; }
}
/* 内容层始终在特效层之上 */
.login-wrap, .container, .site-footer { position: relative; z-index: 2; }
@media (max-width: 480px) {
  .nfx-bokeh { opacity: .7; }
  .nfx-leaf { opacity: .6; }
}
@media (prefers-reduced-motion: reduce) {
  .nature-fx { display: none; }
}

/* ===== 页脚 / 备案信息 ===== */
.site-footer {
  width: 100%; max-width: 1300px; margin: 50px auto 0;
  background: #ffffff; border-top: 1px solid rgba(139,105,20,.14);
  border-radius: 12px 12px 0 0; padding: 26px 20px 22px;
  text-align: center; font-size: 13px; color: #8a7f6d; line-height: 2;
}
.site-footer .footer-brand { font-size: 15px; color: #8b6914; font-weight: 600; margin-bottom: 8px; letter-spacing: .5px; }
.site-footer .footer-beian { font-size: 12px; padding-top: 8px; border-top: 1px solid rgba(139,105,20,.08); }
.site-footer .footer-beian a { color: #8a7f6d; text-decoration: none; }
.site-footer .footer-beian a:hover { color: #8b6914; text-decoration: underline; }

/* ===== v202609-0.1.06 追加：Logo / 横向工序 / 手机双列 ===== */
/* 站点 Logo（透明底烈焰马） */
h1 { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.container header h1 { justify-content: flex-start; }
.site-logo { height: 46px; width: auto; vertical-align: middle; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.site-logo.sm { height: 24px; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* 图片预览模式：工序点选按钮横向排列 */
.gallery-main { justify-content: center; }
.gallery-steps { flex: none; margin-top: 10px; }
.gallery-steps-row { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.gallery-steps-row .step-item { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; font-size: 12.5px; }
@media (max-width: 560px) {
  .gallery-main { flex-direction: row; }
  .gallery-img-wrap { width: 100%; min-width: 0; height: 170px; }
}

/* 手机端列表模式：一行左右两面鼓 */
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 12px; border-radius: 10px; }
  .card h3 { font-size: 13px; line-height: 1.4; margin-bottom: 6px; word-break: break-all; }
  .card .status-badge { font-size: 10px; padding: 2px 6px; }
  .steps { margin: 8px 0; padding: 6px; }
  .steps .steps-title { font-size: 11px; }
  .steps .step-item { font-size: 11px; padding: 2px 0; gap: 4px; }
  .step-check { width: 16px; height: 16px; font-size: 10px; }
  .progress-text { font-size: 11px; }
  .attr { font-size: 11px; margin: 3px 0; }
  .attr-img { width: 20px; height: 20px; }
  .card-actions { gap: 4px; }
  .card-actions button { padding: 4px 6px; font-size: 11px; }
  .customer-badge { font-size: 10px; }
  .draw-btn { padding: 4px 8px; font-size: 11px; }
}
