/* ==========================================================================
   天府智能绿化系统 — “一树一码”扫码科普与实体树牌系统 (qrcode-badge.css)
   Apple Design Language + 现代林业植物铭牌工艺美学
   ========================================================================== */

/* ---------- 1. 实物树牌模态浮层 (Sheet Modal Backdrop & Container) ---------- */
.qr-badge-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.qr-badge-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.qr-badge-sheet {
  position: relative;
  background: var(--canvas, #ffffff);
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.1));
  border-radius: 28px;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px;
  transform: scale(0.94) translateY(16px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.qr-badge-backdrop.is-open .qr-badge-sheet {
  transform: scale(1) translateY(0);
}

[data-theme="dark"] .qr-badge-sheet {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.65);
}

.qr-badge-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.qr-badge-sheet-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qr-badge-sheet-title h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink, #1d1d1f);
}

.qr-badge-sheet-title .badge-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(52, 199, 89, 0.15);
  color: #248a3d;
  letter-spacing: 0.02em;
}

.qr-badge-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
  background: var(--surface-pearl, #f5f5f7);
  color: var(--ink-muted-80, #555);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.qr-badge-close:hover {
  background: #e8e8ed;
  color: #000;
  transform: scale(1.06);
}

/* 材质切换分段控件 */
.qr-material-switcher {
  display: inline-flex;
  background: var(--surface-pearl, #f5f5f7);
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
  border-radius: 9999px;
  padding: 3px;
  gap: 4px;
  margin-bottom: 20px;
}

.qr-mat-btn {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted-80, #666);
  cursor: pointer;
  transition: all 0.2s ease;
}

.qr-mat-btn.is-active {
  background: #ffffff;
  color: var(--ink, #1d1d1f);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

[data-theme="dark"] .qr-mat-btn.is-active {
  background: #2c2c2e;
  color: #fff;
}

/* ---------- 2. 真实植物实物标牌 (Botanical Plaque Component) ---------- */
.botanical-plaque {
  position: relative;
  border-radius: 20px;
  padding: 28px 30px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}

/* 材质 1：森林黑曜合金 (Forest Obsidian Anodized Metal) */
.botanical-plaque.theme-forest {
  background: linear-gradient(145deg, #13241b 0%, #0d1a13 55%, #08110c 100%);
  border: 2px solid #234735;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 18px 40px rgba(0, 0, 0, 0.45);
  color: #f5f5f7;
}

/* 材质 2：白玉晶致亚克力 (Frosted Satin Crystal Acrylic) */
.botanical-plaque.theme-acrylic {
  background: linear-gradient(135deg, #ffffff 0%, #f7f9f8 100%);
  border: 2px solid #d2ded7;
  box-shadow: inset 0 1px 0 #ffffff, 0 16px 36px rgba(0, 50, 20, 0.08);
  color: #1d1d1f;
}

/* 四角高精金属固定螺孔/铆钉 (Simulation Screws / Rivets) */
.plaque-rivet {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
}

.botanical-plaque.theme-forest .plaque-rivet {
  background: radial-gradient(circle at 35% 35%, #9fa8a3, #43544c 70%, #1f2a24 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.6);
  border: 1px solid #16241c;
}

.botanical-plaque.theme-acrylic .plaque-rivet {
  background: radial-gradient(circle at 35% 35%, #ffffff, #cfd8d3 70%, #8a9c92 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.15);
  border: 1px solid #a3b5ab;
}

.plaque-rivet.tl { top: 14px; left: 14px; }
.plaque-rivet.tr { top: 14px; right: 14px; }
.plaque-rivet.bl { bottom: 14px; left: 14px; }
.plaque-rivet.br { bottom: 14px; right: 14px; }

/* 标牌顶端 Header */
.plaque-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.botanical-plaque.theme-acrylic .plaque-header {
  border-bottom-color: rgba(0, 60, 20, 0.1);
}

.plaque-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plaque-emblem {
  font-size: 18px;
}

.plaque-brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.botanical-plaque.theme-forest .plaque-brand-title {
  color: #7ce59f;
}

.botanical-plaque.theme-acrylic .plaque-brand-title {
  color: #1a7d38;
}

.plaque-id-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.botanical-plaque.theme-forest .plaque-id-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

.botanical-plaque.theme-acrylic .plaque-id-badge {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
}

/* 标牌主体 Grid：左侧植物学档案，右侧超清二维码 */
.plaque-body {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 24px;
  align-items: center;
}

@media (max-width: 640px) {
  .plaque-body {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.plaque-names {
  margin-bottom: 14px;
}

.plaque-cname {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 6px 0;
}

.botanical-plaque.theme-forest .plaque-cname {
  color: #ffffff;
}

.botanical-plaque.theme-acrylic .plaque-cname {
  color: #16241b;
}

.plaque-latin {
  font-size: 13.5px;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
  margin: 0;
  opacity: 0.85;
}

.botanical-plaque.theme-forest .plaque-latin {
  color: #a7e3b8;
}

.botanical-plaque.theme-acrylic .plaque-latin {
  color: #236338;
}

/* 标牌属性徽章流 */
.plaque-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .plaque-tags {
    justify-content: center;
  }
}

.plaque-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.botanical-plaque.theme-forest .plaque-tag {
  background: rgba(52, 199, 89, 0.18);
  color: #72e096;
  border: 1px solid rgba(52, 199, 89, 0.25);
}

.botanical-plaque.theme-acrylic .plaque-tag {
  background: rgba(52, 199, 89, 0.12);
  color: #1a7d38;
  border: 1px solid rgba(52, 199, 89, 0.25);
}

/* 标牌参数矩阵 */
.plaque-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 640px) {
  .plaque-specs {
    text-align: left;
  }
}

.plaque-spec-item {
  font-size: 12px;
  line-height: 1.4;
}

.plaque-spec-label {
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.plaque-spec-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.botanical-plaque.theme-forest .plaque-spec-val {
  color: #e5e7eb;
}

.botanical-plaque.theme-acrylic .plaque-spec-val {
  color: #1f2937;
}

/* 右侧二维码卡盒 (QR Code Container) */
.plaque-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
}

.plaque-qr-canvas-wrap {
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.plaque-qr-canvas-wrap canvas,
.plaque-qr-canvas-wrap img {
  width: 148px !important;
  height: 148px !important;
  display: block;
  border-radius: 4px;
}

/* 二维码中心极简绿叶微标 */
.plaque-qr-center-leaf {
  position: absolute;
  width: 30px;
  height: 30px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  font-size: 16px;
  pointer-events: none;
}

.plaque-qr-tip {
  font-size: 10.5px;
  font-weight: 600;
  color: #1d1d1f;
  margin-top: 8px;
  text-align: center;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.plaque-qr-tip span {
  display: block;
  font-size: 9.5px;
  color: #6e6e73;
  font-weight: 400;
}

/* 标牌底部落款 */
.plaque-footer {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.botanical-plaque.theme-acrylic .plaque-footer {
  border-top-color: rgba(0, 60, 20, 0.1);
  color: #555;
}

/* ---------- 3. 模态动作栏 (Sheet Actions) ---------- */
.qr-badge-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
}

.qr-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.1));
}

@media (max-width: 640px) {
  .qr-badge-sheet {
    padding: 24px 18px;
    border-radius: 20px;
  }
  .qr-badge-actions {
    flex-direction: column;
    gap: 8px;
  }
  .qr-btn-action {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

.qr-btn-primary {
  background: var(--primary, #0066cc);
  color: #ffffff;
  border-color: transparent;
}

.qr-btn-primary:hover {
  background: #0077ed;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.qr-btn-pearl {
  background: var(--surface-pearl, #f5f5f7);
  color: var(--ink, #1d1d1f);
}

.qr-btn-pearl:hover {
  background: #e8e8ed;
  transform: translateY(-1px);
}

[data-theme="dark"] .qr-btn-pearl {
  background: #2c2c2e;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

/* ---------- 4. 移动端与扫码游客科普展台 (Visitor Science Hub) ---------- */
.qr-science-hub {
  background: linear-gradient(135deg, rgba(235, 247, 238, 0.75) 0%, rgba(243, 250, 255, 0.75) 100%);
  border: 1px solid rgba(52, 199, 89, 0.25);
  border-radius: 24px;
  padding: 22px 26px;
  margin-bottom: var(--sp-lg, 28px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.06);
}

[data-theme="dark"] .qr-science-hub {
  background: linear-gradient(135deg, rgba(20, 38, 28, 0.8) 0%, rgba(18, 30, 42, 0.8) 100%);
  border-color: rgba(52, 199, 89, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.qr-hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.qr-hub-welcome {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qr-hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #34c759;
  color: #ffffff;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
}

.qr-hub-welcome h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #1d1d1f);
}

.qr-hub-welcome p {
  margin: 2px 0 0 0;
  font-size: 12.5px;
  color: var(--ink-muted-80, #666);
}

/* 语音伴游讲解控制器 */
.voice-tour-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--canvas, #ffffff);
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
  border-radius: 16px;
  padding: 12px 18px;
  margin-top: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .voice-tour-bar {
  background: rgba(30, 30, 32, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

.voice-tour-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #34c759;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.35);
  transition: transform 0.2s ease, background 0.2s;
  flex-shrink: 0;
}

.voice-tour-btn:hover {
  transform: scale(1.08);
  background: #2ebd52;
}

.voice-tour-btn.is-playing {
  background: #ff9500;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(255, 149, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0); }
}

.voice-tour-content {
  flex: 1;
}

.voice-tour-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #1d1d1f);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.voice-wave span {
  width: 2px;
  height: 4px;
  background: #34c759;
  border-radius: 1px;
  transition: height 0.2s;
}

.voice-tour-btn.is-playing ~ .voice-tour-content .voice-wave span {
  animation: wave-anim 0.8s ease-in-out infinite alternate;
}

.voice-tour-btn.is-playing ~ .voice-tour-content .voice-wave span:nth-child(2) { animation-delay: 0.15s; }
.voice-tour-btn.is-playing ~ .voice-tour-content .voice-wave span:nth-child(3) { animation-delay: 0.3s; }
.voice-tour-btn.is-playing ~ .voice-tour-content .voice-wave span:nth-child(4) { animation-delay: 0.45s; }

@keyframes wave-anim {
  0% { height: 3px; }
  100% { height: 14px; }
}

.voice-tour-sub {
  font-size: 11.5px;
  color: var(--ink-muted-48, #888);
  margin: 2px 0 0 0;
}

/* 生态效益科普 Bento 矩阵 */
.eco-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 680px) {
  .eco-bento-grid {
    grid-template-columns: 1fr;
  }
}

.eco-bento-card {
  background: var(--canvas, #ffffff);
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .eco-bento-card {
  background: rgba(30, 30, 32, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

.eco-bento-card:hover {
  transform: translateY(-2px);
}

.eco-bento-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(52, 199, 89, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.eco-bento-label {
  font-size: 11px;
  color: var(--ink-muted-48, #888);
  margin-bottom: 2px;
}

.eco-bento-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #1d1d1f);
}

/* 访客打卡互动按钮 */
.visitor-interactive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(52, 199, 89, 0.25);
  flex-wrap: wrap;
  gap: 8px;
}

.punch-water-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 199, 89, 0.15);
  color: #1a7d38;
  border: 1px solid rgba(52, 199, 89, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.punch-water-btn:hover {
  background: rgba(52, 199, 89, 0.25);
  transform: scale(1.03);
}

.punch-water-btn:active {
  transform: scale(0.97);
}

/* ---------- 5. 打印专属排版样式 (Print Signboard Specification) ---------- */
@media print {
  /* 仅打印树牌实体本身，隐藏整站导航、页脚、侧边与按钮 */
  body * {
    visibility: hidden;
  }

  #plaque-print-mount,
  #plaque-print-mount * {
    visibility: visible;
  }

  #plaque-print-mount {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .botanical-plaque {
    width: 160mm !important;
    height: 105mm !important;
    max-width: 160mm !important;
    box-sizing: border-box !important;
    border: 2pt solid #000000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "SimSun", "宋体", serif !important;
  }

  .botanical-plaque * {
    color: #000000 !important;
    background: transparent !important;
    border-color: #000000 !important;
  }

  .plaque-rivet {
    border: 1.5pt solid #000000 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .plaque-qr-box {
    border: 1.5pt solid #000000 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  .plaque-cut-guide {
    display: block !important;
    position: absolute;
    inset: -6mm;
    border: 0.5pt dashed #888888;
    pointer-events: none;
  }

  .plaque-cut-hint {
    display: block !important;
    font-size: 8pt;
    color: #666;
    text-align: center;
    margin-top: 6mm;
  }
}
