/* ============ 花鸟艺术坊 · 全局样式（水墨 + 鎏金） ============ */
:root {
  --ink: #2b2620;
  --gold: #b8860b;
  --gold-light: #d4a83c;
  --paper: #faf5ea;
  --paper-deep: #f3ead8;
  --line: #e3d5b5;
  --red: #a83232;
  --muted: #8a7a5a;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(120, 90, 30, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -100px, #fbf3dd 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 页头 ---------- */
.site-header {
  background: linear-gradient(135deg, #2b2115 0%, #4a3415 55%, #6b4a10 100%);
  color: #f6e7c8;
  padding: 30px 0 26px;
  border-bottom: 3px solid var(--gold-light);
}
.brand h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 6px;
  font-family: "STZhongsong", "SimSun", serif;
  color: #ffe9b0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.brand p { margin: 6px 0 0; color: #d9c48f; font-size: 14px; letter-spacing: 2px; }

.db-warn {
  margin-top: 16px;
  background: #fdecec;
  border: 1px solid #f3c1c1;
  color: #a33;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.db-warn a { color: #a33; font-weight: 600; }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex;
  gap: 10px;
  margin: 22px 0 16px;
}
.tab {
  flex: 1;
  padding: 14px 0;
  font-size: 17px;
  letter-spacing: 2px;
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s;
}
.tab:hover { border-color: var(--gold-light); }
.tab.active {
  background: linear-gradient(135deg, #d4a83c, #b8860b);
  color: #fff;
  border-color: #b8860b;
  box-shadow: var(--shadow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ---------- 面板 ---------- */
.panel {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 16px;
  font-size: 16px;
  color: #6b4a10;
  border-left: 4px solid var(--gold-light);
  padding-left: 10px;
  letter-spacing: 1px;
}
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .panel-grid { grid-template-columns: 1fr; } }

/* ---------- 上传区 ---------- */
.dropzone {
  border: 2px dashed #cbb987;
  border-radius: var(--radius);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #fffcf4;
  transition: all .18s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--gold);
  background: #fff8e8;
}
.dz-icon {
  width: 54px; height: 54px; margin: 0 auto 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a83c, #b8860b);
  color: #fff; font-size: 30px; line-height: 54px;
}
.dz-hint p { margin: 4px 0; font-size: 15px; color: #6b4a10; }
.dz-hint small { color: var(--muted); }
.src-preview {
  max-width: 100%; max-height: 340px;
  object-fit: contain;
  border-radius: 8px;
}

/* ---------- 边框选择 ---------- */
.shape-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}
.shape-label { color: var(--muted); }
.shape-btns { display: inline-flex; gap: 6px; }
.shape-btn, .rotate-btn {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.shape-btn:hover, .rotate-btn:hover { border-color: var(--gold-light); }
.shape-btn.active {
  background: #6b4a10;
  border-color: #6b4a10;
  color: #fff;
}
.cat-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  font-size: 12px; padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.chip.active { background: #6b4a10; border-color: #6b4a10; color: #fff; }

.border-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.border-item {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  background: #f7f0df;
  text-align: center;
  transition: all .15s;
}
.border-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.border-item span { display: block; font-size: 12px; color: #6b4a10; margin-top: 4px; }
.border-item:hover { border-color: var(--gold-light); }
.border-item.selected { border-color: var(--gold); background: #fff4d6; box-shadow: 0 0 0 2px rgba(184, 134, 11, .25); }

.loading { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* ---------- 结果区 ---------- */
.result-panel { margin-top: 16px; }
.result-row { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.result-row img {
  width: 260px; height: 260px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: repeating-conic-gradient(#f0e9d8 0 25%, #faf5ea 0 50%) 0 0 / 20px 20px;
}
.result-actions { flex: 1; min-width: 220px; padding-top: 8px; }
.result-tip { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.btn.primary {
  background: linear-gradient(135deg, #d4a83c, #b8860b);
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); margin-left: 10px; }
.btn.ghost:hover { border-color: var(--gold-light); }
.btn.big { width: 100%; margin-top: 8px; padding: 13px 0; font-size: 16px; letter-spacing: 2px; }

/* ---------- 艺术字 ---------- */
.name-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  letter-spacing: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf7;
  color: var(--ink);
  outline: none;
}
.name-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 134, 11, .15); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.style-card {
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #f7f0df;
  transition: all .15s;
  position: relative;
}
.style-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.style-card span {
  display: block;
  text-align: center;
  padding: 6px 0;
  font-size: 13px;
  color: #6b4a10;
  background: #fffdf7;
}
.style-card:hover { border-color: var(--gold-light); }
.style-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(184, 134, 11, .25); }
.style-card.selected::after {
  content: "✓";
  position: absolute;  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  text-align: center;
  line-height: 26px;
  font-size: 14px;
}

/* ---------- 历史 ---------- */
.history-panel { margin-top: 16px; }
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.history-item { text-align: center; }
.history-item img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .15s;
  background: #f7f0df;
}
.history-item img:hover { transform: scale(1.04); }
.history-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 16px 0; }

/* ---------- 页脚 / Toast ---------- */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 26px 0 30px;
}
.site-footer .footer-main { margin-bottom: 8px; }
.beian-row {
  display: inline-block;
  margin-top: 6px;
}
.beian-row a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.12);
  padding-bottom: 1px;
  transition: color .18s ease;
}
.beian-row a:hover { color: var(--accent, #b8860b); }
.admin-flower-link {
  display: inline-block;
  vertical-align: middle;
  margin-left: 2px;
  opacity: .85;
  transition: transform .18s ease, opacity .18s ease;
}
.admin-flower-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.toast {
  position: fixed;
  left: 50%; bottom: 40px;
  transform: translateX(-50%);
  background: rgba(43, 38, 32, .92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

/* ---------- 姓名花鸟字 ---------- */
.hnz-intro { text-align: center; }
.hnz-intro img { width: 100%; max-width: 260px; border-radius: 10px; border: 1px solid var(--line); }
.hnz-intro p { color: var(--muted); font-size: 13px; line-height: 1.7; margin-top: 12px; text-align: left; }
