﻿/* 祕密花園 — 鼠尾草白霧主題 (style.css) */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Raleway:wght@300;400;500;600&display=swap');

:root {
  /* 設計系統顏色 Token — 鼠尾草白霧 */
  --bg-main: #f4f1e8;
  --bg-gradient: linear-gradient(170deg, #f8f5ec 0%, #eff0e4 45%, #eaede0 100%);
  --bg-card: rgba(255, 253, 246, 0.82);
  --bg-card-hover: rgba(255, 254, 250, 0.96);
  --border-color: rgba(148, 168, 130, 0.25);
  --border-color-glow: rgba(130, 158, 110, 0.38);

  --primary: hsl(88, 20%, 42%);        /* 深鼠尾草 */
  --primary-glow: rgba(130, 158, 110, 0.28);
  --accent: hsl(88, 18%, 52%);         /* 鼠尾草綠 */
  --accent-rgb: 145, 168, 118;
  --gold: hsl(42, 35%, 58%);           /* 暖稻草 */
  --gold-glow: rgba(175, 155, 100, 0.28);
  --danger: hsl(354, 55%, 52%);

  --text-primary: hsl(88, 14%, 22%);   /* 深橄欖 */
  --text-secondary: hsl(88, 10%, 48%); /* 灰鼠尾草 */
  --text-muted: hsl(88, 8%, 64%);      /* 淡苔色 */

  /* 字型 Family */
  --font-title: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* 圓角與陰影 */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 3px 14px rgba(100, 120, 80, 0.10);
  --shadow-md: 0 8px 28px rgba(100, 120, 80, 0.15);
  --shadow-lg: 0 16px 48px rgba(100, 120, 80, 0.20);
  --shadow-glow: 0 0 22px rgba(145, 168, 118, 0.22);
  --shadow-glow-gold: 0 0 22px rgba(175, 155, 100, 0.22);

  /* 轉場動畫時間 */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基礎重設 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: #f4f1e8;
  background-image:
    radial-gradient(ellipse 75% 50% at 6% 94%, rgba(130,158,110,0.13) 0%, transparent 65%),
    radial-gradient(ellipse 65% 42% at 94% 6%, rgba(145,168,118,0.11) 0%, transparent 58%),
    radial-gradient(ellipse 55% 65% at 50% 48%, rgba(200,215,180,0.06) 0%, transparent 78%),
    radial-gradient(ellipse 40% 30% at 22% 35%, rgba(175,195,148,0.07) 0%, transparent 55%),
    linear-gradient(170deg, #f8f5ec 0%, #eff0e4 45%, #eaede0 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-weight: 400;
}

/* 自訂捲軸樣式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(210, 175, 165, 0.15);
}
::-webkit-scrollbar-thumb {
  background: rgba(195, 140, 150, 0.35);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* 頁面背景裝飾粒子效果 */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.decor-blob {
  position: absolute;
  filter: blur(95px);
  opacity: 0.26;
  mix-blend-mode: multiply;
  animation: float-blob 28s infinite alternate ease-in-out;
}

.blob-1 {
  width: 560px;
  height: 460px;
  background: hsl(88, 42%, 70%);
  border-radius: 62% 38% 55% 45% / 48% 58% 42% 52%;
  top: -80px;
  right: -60px;
}

.blob-2 {
  width: 640px;
  height: 520px;
  background: hsl(88, 30%, 76%);
  border-radius: 45% 55% 38% 62% / 55% 42% 58% 45%;
  bottom: -130px;
  left: -80px;
  opacity: 0.20;
  animation-delay: -7s;
}

.blob-3 {
  width: 380px;
  height: 420px;
  background: hsl(42, 40%, 76%);
  border-radius: 55% 45% 62% 38% / 42% 55% 45% 58%;
  top: 36%;
  left: 26%;
  opacity: 0.16;
  animation-delay: -12s;
}

.blob-4 {
  width: 300px;
  height: 340px;
  background: hsl(88, 35%, 74%);
  border-radius: 40% 60% 45% 55% / 58% 40% 60% 42%;
  top: 18%;
  left: 55%;
  opacity: 0.13;
  animation-delay: -18s;
}

/* 植物插畫裝飾 */
.bg-botanical {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.bg-botanical-top {
  top: -20px;
  right: -30px;
  width: 420px;
  height: 520px;
  opacity: 0.70;
  animation: float-botanical 20s infinite alternate ease-in-out;
}

.bg-botanical-bottom {
  bottom: -20px;
  left: -20px;
  width: 380px;
  height: 480px;
  opacity: 0.62;
  animation: float-botanical 24s infinite alternate-reverse ease-in-out;
}

@keyframes float-botanical {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(6px, 12px) rotate(0.8deg); }
  100% { transform: translate(-4px, -8px) rotate(-0.5deg); }
}

@keyframes float-blob {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.1); }
  100% { transform: translate(-20px, -40px) scale(0.95); }
}

/* 全局排版 & 標題 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

/* 頂級毛玻璃面板基礎樣式 */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: rgba(130, 158, 110, 0.40);
  box-shadow: var(--shadow-md);
}

/* 頂部導航欄 (Navigation Bar) */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 245, 236, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 168, 130, 0.28);
  padding: 14px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background: linear-gradient(135deg, hsl(88,28%,52%) 0%, hsl(88,22%,68%) 100%);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(100,120,80,0.22);
  font-size: 20px;
  animation: pulse-icon 3s infinite alternate;
}

@keyframes pulse-icon {
  0% { box-shadow: 0 4px 14px rgba(100,120,80,0.18); }
  100% { box-shadow: 0 4px 20px rgba(100,120,80,0.36); }
}

.logo-text {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-style: italic;
  background: linear-gradient(to right, hsl(88,20%,28%) 10%, hsl(88,22%,52%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.05em;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: rgba(130, 158, 110, 0.12);
}

.nav-link i {
  font-size: 16px;
}

/* 主要佈局容器 */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 分頁視窗控制 */
.app-view {
  display: none;
  animation: fadeIn var(--transition-slow) forwards;
}

.app-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   1. 植物掃描主視窗 (Scanner & Dashboard View)
   ========================================================================== */
.scanner-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

/* 掃描工作區 */
.scan-card {
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}

.scan-title {
  font-size: 28px;
  margin-bottom: 8px;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.scan-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* 拖曳與上傳框 */
.upload-zone {
  width: 100%;
  max-width: 520px;
  height: 300px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  transition: all var(--transition-normal);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(84, 255, 189, 0.03);
  box-shadow: 0 0 20px rgba(84, 255, 189, 0.1);
}

.upload-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
  transition: transform var(--transition-normal) ease, color var(--transition-normal);
}

.upload-zone:hover .upload-icon {
  transform: translateY(-8px);
  color: var(--accent);
}

.upload-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* 預覽影像與雷射掃描動畫 */
.preview-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: none;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 雷射發光掃描線 */
.scan-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 15px var(--accent), 0 0 5px var(--accent);
  z-index: 5;
  display: none;
  animation: laser-scan 2.5s infinite linear;
}

@keyframes laser-scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scanning .scan-laser {
  display: block;
}

/* 隱藏的檔案輸入框 */
#file-input {
  display: none;
}

/* 精選一鍵測試區 (Demo Plants) */
.demo-section {
  width: 100%;
  margin-top: 32px;
}

.demo-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 520px;
}

.demo-item {
  position: relative;
  height: 70px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.demo-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.demo-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  transition: all var(--transition-normal);
}

.demo-item:hover .demo-img-placeholder {
  filter: brightness(1.2);
}

/* 掃描狀態與結果區 */
.result-card {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 480px;
  position: relative;
}

.status-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.status-placeholder i {
  font-size: 64px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.05);
}

/* 分析進度條 (Console-like UI) */
.console-loader {
  display: none;
  font-family: 'Courier New', Courier, monospace;
  background: rgba(0,0,0,0.3);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(84, 255, 189, 0.15);
  color: var(--accent);
  font-size: 14px;
  text-align: left;
  line-height: 1.8;
  height: 240px;
  overflow-y: auto;
}

.typing-line {
  margin-bottom: 8px;
  opacity: 0;
  animation: console-fade 0.2s forwards;
}

@keyframes console-fade {
  to { opacity: 1; }
}

/* AI 匹配雷達與詳細匹配清單 */
.match-results {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.match-header {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.match-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  transform: translateX(6px);
}

.match-item.primary-match {
  background: rgba(84, 255, 189, 0.03);
  border-color: rgba(84, 255, 189, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.match-item.primary-match:hover {
  border-color: var(--accent);
}

.match-info-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.match-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.match-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-cn-name {
  font-size: 18px;
  font-weight: 700;
}

.match-en-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.match-score-right {
  text-align: right;
}

.match-percentage {
  font-size: 22px;
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--accent);
}

.match-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 4px;
}

.primary-match .match-percentage {
  text-shadow: 0 0 10px rgba(84, 255, 189, 0.4);
}

/* ==========================================================================
   2. 我的虛擬花園 (My Garden View)
   ========================================================================== */
.garden-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.garden-title {
  font-size: 32px;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.garden-stats {
  display: flex;
  gap: 24px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.stat-badge i {
  color: var(--accent);
}

.stat-value {
  font-family: var(--font-title);
  font-weight: 700;
  color: #fff;
}

/* 花園空值狀態 */
.garden-empty {
  text-align: center;
  padding: 80px 40px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.garden-empty i {
  font-size: 80px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--bg-card-hover), var(--border-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.garden-empty p {
  font-size: 18px;
  margin-bottom: 24px;
}

/* 智能通用按鈕樣式 */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  color: #000;
  font-family: var(--font-title);
  font-weight: 700;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-normal);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(84, 255, 189, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 500;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(84, 255, 189, 0.05);
}

/* 我的花園網格與卡片 */
.garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.garden-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 280px;
  justify-content: space-between;
}

.garden-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--plant-color, var(--accent));
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.plant-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plant-nickname {
  font-size: 22px;
  font-weight: 700;
}

.plant-species {
  font-size: 13px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.plant-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
}

.plant-decor-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  opacity: 0.9;
}

/* 澆水計時與進度條 */
.water-status-area {
  margin: 20px 0;
}

.timer-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.timer-countdown {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.timer-countdown.danger {
  color: var(--danger);
  animation: pulse-danger 1.5s infinite alternate;
}

@keyframes pulse-danger {
  0% { text-shadow: 0 0 4px rgba(255, 74, 74, 0.1); opacity: 0.8; }
  100% { text-shadow: 0 0 12px rgba(255, 74, 74, 0.6); opacity: 1; }
}

.water-progress-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.water-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  width: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.water-progress-bar.danger {
  background: var(--danger);
}

/* 卡片底部控制區 */
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.location-text {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.btn-water {
  background: rgba(84, 255, 189, 0.08);
  border: 1px solid rgba(84, 255, 189, 0.2);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-water:hover {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 12px rgba(84, 255, 189, 0.3);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 74, 74, 0.05);
}

/* ==========================================================================
   3. 植物照護大百科 (Encyclopedia View)
   ========================================================================== */
.encyclopedia-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.search-filter-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-box-wrapper i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px 14px 48px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.05);
  box-shadow: var(--shadow-glow);
}

.filter-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* 百科植物網格與卡片 */
.encyclopedia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.plant-card {
  height: 380px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.plant-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--plant-color);
}

.plant-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.plant-card-visual {
  height: 140px;
  border-radius: var(--radius-md);
  background: var(--plant-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.plant-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.plant-card:hover .plant-card-visual img {
  transform: scale(1.08);
}

.plant-card-visual::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  top: -50px;
  right: -50px;
}

.plant-card-info {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.plant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plant-card-title {
  font-size: 22px;
  font-weight: 700;
}

.plant-card-difficulty {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
}

.plant-card-difficulty.easy { background: rgba(56, 239, 125, 0.15); color: #38ef7d; }
.plant-card-difficulty.medium { background: rgba(243, 161, 131, 0.15); color: #f3a183; }
.plant-card-difficulty.hard { background: rgba(255, 74, 74, 0.15); color: var(--danger); }

.plant-card-sci {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
}

.plant-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
}

.plant-card-tags {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.plant-card-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ==========================================================================
   4. 植物病蟲害醫生診斷 (Plant Doctor View)
   ========================================================================== */
.doctor-container {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.doctor-wizard-panel {
  padding: 32px;
}

.wizard-title-area {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.wizard-title {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-title i {
  color: var(--accent);
}

.wizard-step-indicator {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.wizard-step {
  display: none;
  animation: fadeIn var(--transition-fast) forwards;
}

.wizard-step.active {
  display: block;
}

.question-text {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 自訂選擇卡 */
.option-card {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-fast);
}

.option-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--accent);
}

.option-card.selected {
  background: rgba(84, 255, 189, 0.05);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(84, 255, 189, 0.1);
}

.option-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.option-card:hover .option-circle {
  border-color: var(--accent);
}

.option-card.selected .option-circle {
  border-color: var(--accent);
  background: var(--accent);
}

.option-card.selected .option-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
}

.option-label {
  font-size: 15px;
  font-weight: 500;
}

.wizard-nav-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* 診斷報告輸出區 */
.doctor-report-panel {
  padding: 32px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.report-empty {
  text-align: center;
  color: var(--text-muted);
}

.report-empty i {
  font-size: 64px;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.03);
}

.report-content {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.report-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.report-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.report-tag-danger {
  background: rgba(255, 74, 74, 0.15);
  color: var(--danger);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  text-transform: uppercase;
}

.diagnosis-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-top: 8px;
}

.diagnosis-possibility {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.report-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 15px;
  text-transform: uppercase;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-text {
  font-size: 15px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.15);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.03);
}

.treatment-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-item {
  display: flex;
  gap: 14px;
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: var(--radius-md);
}

.step-num {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.step-desc {
  font-size: 14px;
  color: var(--text-primary);
}

/* ==========================================================================
   5. 植物詳情側邊面板 (Detailed Profile Draw / Side Sheet)
   ========================================================================== */
.side-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.side-sheet {
  position: fixed;
  top: 0;
  right: -100vw;
  width: 100vw;
  max-width: none;
  height: 100vh;
  background: var(--bg-main);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  overflow: hidden;
  transition: right var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: row;
}

.side-sheet.active {
  right: 0;
}

/* 左欄：植物照片 */
.sheet-photo-col {
  flex: 0 0 42%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #c8d8b0 0%, #a8c090 100%);
}
.sheet-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.4s ease;
}

/* 右欄：照護內容 */
.sheet-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-main);
}

.side-sheet-backdrop.active {
  display: block;
  opacity: 1;
}

.sheet-header {
  padding: 28px 28px 20px;
  color: var(--text-primary);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(135deg, rgba(195,215,168,0.22) 0%, rgba(244,241,232,0) 100%);
  border-bottom: 1px solid var(--border-color);
}

.sheet-header::before { display: none; }
.sheet-header::after  { display: none; }

.btn-close-sheet {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(130,158,110,0.12);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.btn-close-sheet:hover {
  background: rgba(130,158,110,0.22);
  transform: rotate(90deg);
}

.sheet-title-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sheet-cn-name {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: none;
  font-family: var(--font-title);
}

.sheet-en-name {
  font-size: 15px;
  color: var(--text-secondary);
  font-style: italic;
}

.sheet-tags-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sheet-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.profile-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 視覺化照護指標卡網格 */
.care-widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.care-widget {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-title i {
  color: var(--accent);
  font-size: 14px;
}

.widget-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.widget-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.full-width-widget {
  grid-column: span 2;
}

/* 土壤黃金配比小圖 */
.soil-ratio-visual {
  display: flex;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0;
  border: 1px solid var(--border-color);
}

.ratio-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: 700;
}

/* 病蟲害特寫區 */
.pests-sect-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pest-item-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 74, 74, 0.02);
  border: 1px solid rgba(255, 74, 74, 0.1);
}

.pest-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 8px;
}

.pest-detail-row {
  font-size: 13px;
  margin-bottom: 6px;
}

.pest-detail-row strong {
  color: var(--text-primary);
}

/* 詳情操作按鈕 */
.sheet-action-bar {
  padding: 20px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  background: var(--bg-main);
  margin-top: auto;
}

.sheet-action-bar button {
  flex: 1;
}

/* 快速加入花園的 Modal 樣式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  transition: color var(--transition-fast);
}

.btn-close-modal:hover {
  color: #fff;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.form-input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent);
}

/* ==========================================================================
   6. 響應式微調 (Responsive Settings)
   ========================================================================== */
@media (max-width: 1024px) {
  .scanner-grid {
    grid-template-columns: 1fr;
  }
  .doctor-container {
    grid-template-columns: 1fr;
  }
  .app-container {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 16px 20px;
  }
  .logo-text {
    font-size: 20px;
  }
  .nav-link span {
    display: none; /* 行動端僅顯示圖標 */
  }
  .nav-link {
    padding: 10px;
  }
  .care-widget-grid {
    grid-template-columns: 1fr;
  }
  .care-widget.full-width-widget {
    grid-column: span 1;
  }
  .sheet-body {
    padding: 20px;
  }
  .sheet-header {
    padding: 20px;
    min-height: 180px;
  }
  .sheet-cn-name {
    font-size: 26px;
  }
  .demo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .demo-item {
    height: 60px;
  }
}

/* ===== 影片識別功能樣式 ===== */

/* 媒體類型徽章（照片 / 影片） */
.upload-media-badges {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px;
}

.upload-media-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.upload-media-badge.video-badge {
  background: rgba(243, 161, 131, 0.08);
  border-color: rgba(243, 161, 131, 0.25);
  color: var(--gold);
}

/* 影片預覽元素 */
.preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
  border-radius: 0;
}

/* 影格縮圖條 */
.frame-strip {
  width: 100%;
  max-width: 520px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(84,255,189,0.15);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 10px 14px 12px;
  margin-top: -4px;
}

.frame-strip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.frame-strip-label i {
  color: var(--accent);
}

.frame-strip-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.frame-strip-thumbs::-webkit-scrollbar { height: 3px; }
.frame-strip-thumbs::-webkit-scrollbar-thumb { background: rgba(84,255,189,0.3); border-radius: 2px; }

.frame-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.frame-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

/* ── 世界植物地圖 ─────────────────────────────────────────────── */
#world-view.active {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.world-header {
  flex-shrink: 0;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border-color);
}

.world-header h2 {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-title);
  margin-bottom: 5px;
}

.world-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.world-layout {
  display: flex;
  flex: 1;
  min-height: 500px;
  overflow: hidden;
}

/* 地圖容器 */
.world-map-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #08110a;
  border-right: 1px solid var(--border-color);
  overflow: hidden;
}

#world-map-chart {
  width: 100%;
  height: 100%;
  min-height: 500px;
}

.map-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #f0ede4;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 18px;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* 國家資訊面板 */
.country-plant-panel {
  width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 24px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.country-plant-panel::-webkit-scrollbar { width: 4px; }
.country-plant-panel::-webkit-scrollbar-track { background: transparent; }
.country-plant-panel::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

/* 佔位符（未選擇國家時） */
.panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  gap: 16px;
  text-align: center;
}

.placeholder-globe { font-size: 56px; opacity: 0.2; }

.placeholder-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* 面板標頭（國旗 + 國名） */
.country-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.country-flag { font-size: 34px; line-height: 1; }

.country-title { flex: 1; }

.country-name {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-title);
  line-height: 1.2;
}

.country-en-name {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-title);
  color: var(--text-primary);
  margin-top: 2px;
  line-height: 1.3;
}

/* 國花卡 */
.national-flower-card {
  background: rgba(243, 161, 131, 0.05);
  border: 1px solid rgba(243, 161, 131, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.flower-emoji {
  float: right;
  font-size: 38px;
  line-height: 1;
  margin: -2px -2px 8px 10px;
}

.flower-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.flower-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 7px;
  font-family: var(--font-title);
  line-height: 1.3;
}

.flower-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
  clear: both;
}

/* 代表植物清單標題 */
.plants-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plants-section-title i { color: var(--accent); }

/* 國花圖片區塊 */
.flower-img-wrapper {
  width: calc(100% + 32px);
  margin: -16px -16px 14px;
  height: 170px;
  overflow: hidden;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.flower-wiki-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 植物縮圖 */
.plant-wiki-img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

/* 骨架載入動畫 */
.wiki-img-loading {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: wikiShimmer 1.4s infinite;
}

@keyframes wikiShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 單一植物項目 */
.world-plant-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.world-plant-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(84, 255, 189, 0.2);
}

.world-plant-info { flex: 1; min-width: 0; }

.world-plant-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
  font-family: var(--font-title);
}

.world-plant-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* 無資料時的提示 */
.no-data-hint {
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* 響應式 */
@media (max-width: 860px) {
  .world-layout { flex-direction: column; }
  .world-map-wrapper { border-right: none; border-bottom: 1px solid var(--border-color); }
  #world-map-chart { min-height: 300px; }
  .country-plant-panel { width: 100%; padding: 20px 16px; }
}

/* ── 購買管道區塊 ───────────────────────────────────────────── */
#seller-section {
  margin-top: 28px;
  border-top: 1px solid var(--border-color);
  padding-top: 22px;
}

.seller-section-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.seller-section-header i { color: var(--gold); }

.seller-search-hint {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 2px 10px;
}

.seller-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.seller-tab {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-title);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.seller-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.seller-tab.active {
  background: rgba(84,255,189,0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.seller-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.seller-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.seller-card:not(.offline-card):hover {
  background: rgba(84,255,189,0.04);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.offline-card:hover {
  background: rgba(243,161,131,0.04);
  border-color: rgba(243,161,131,0.3);
}

.seller-logo {
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.seller-info { flex: 1; min-width: 0; }

.seller-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seller-desc {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seller-hours {
  font-size: 11px;
  color: var(--gold);
  margin-top: 4px;
}

.seller-link-icon {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.seller-card:not(.offline-card):hover .seller-link-icon { color: var(--accent); }

/* 側邊詳情頁植物照片背景 */
.sheet-header-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* 花園卡片植物圖片縮圖 */
.plant-thumb-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

/* 通知發送樣式 */
.toast-notice {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(10, 24, 16, 0.95);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-glow);
  padding: 12px 24px;
  border-radius: 30px;
  color: #fff;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notice.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== 植物醫生 - 診斷模式分頁 ===== */
.doctor-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.doctor-tab {
  flex: 1;
  padding: 9px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.doctor-tab.active {
  background: rgba(84,255,189,0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.doctor-tab:hover:not(.active) {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}

/* ===== 植物醫生 - 照片上傳區 ===== */
.doctor-upload-zone {
  border: 2px dashed rgba(84,255,189,0.30);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(84,255,189,0.03);
}

.doctor-upload-zone:hover,
.doctor-upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(84,255,189,0.07);
}

.doc-upload-icon {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.7;
}

.doc-upload-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.doc-upload-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.doc-preview-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 14px;
  display: block;
}

/* ===== 植物醫生 - AI Console 動畫 ===== */
.console-loader {
  background: rgba(0,0,0,0.50);
  border: 1px solid rgba(84,255,189,0.20);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  color: #54FFBD;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.7;
}

.console-line { display: block; animation: consoleFadeIn 0.2s ease; }
.console-line.warn { color: var(--gold); }
.console-line.ok   { color: #54FFBD; }
.console-line.info { color: var(--text-secondary); }

@keyframes consoleFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== 藥物推薦 Medicine Section ===== */
.medicine-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.medicine-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
}

.medicine-num {
  width: 28px;
  height: 28px;
  background: rgba(84,255,189,0.15);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.medicine-info { flex: 1; }

.medicine-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.medicine-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.medicine-type.bio  { background: rgba(84,255,189,0.15); color: var(--accent); }
.medicine-type.chem { background: rgba(255,179,0,0.15);  color: var(--gold);   }
.medicine-type.phys { background: rgba(120,180,255,0.15); color: #7eb4ff;      }

.medicine-dosage {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.med-buy-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.med-buy-tab {
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.med-buy-tab.active {
  background: rgba(84,255,189,0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.med-buy-tab:hover:not(.active) {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}

.med-seller-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* ============================================================
   鼠尾草白霧主題 — 全域 Override
   ============================================================ */

/* 捲軸 */
::-webkit-scrollbar-track  { background: rgba(148,168,130,0.10) !important; }
::-webkit-scrollbar-thumb  { background: rgba(130,158,110,0.30) !important; }
::-webkit-scrollbar-thumb:hover { background: var(--accent) !important; }

/* 狀態佔位圖示 */
.status-placeholder i { color: rgba(130,158,110,0.15) !important; }

/* 掃描上傳區 */
.upload-zone {
  background: rgba(255,252,244,0.55) !important;
  border-color: rgba(148,168,130,0.32) !important;
}
.upload-zone:hover, .upload-zone.dragover {
  background: rgba(255,253,248,0.80) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 20px rgba(130,158,110,0.15) !important;
}

/* Console AI 分析 */
.console-loader {
  background: rgba(242,242,234,0.88) !important;
  border-color: rgba(148,168,130,0.28) !important;
  color: hsl(88, 28%, 38%) !important;
}

/* 匹配結果列表 */
.match-item {
  background: rgba(255,253,245,0.65) !important;
  border-color: rgba(148,168,130,0.24) !important;
}
.match-item:hover {
  background: rgba(255,254,250,0.92) !important;
  border-color: var(--accent) !important;
}
.match-item.primary-match {
  background: rgba(145,168,118,0.07) !important;
  border-color: rgba(130,158,110,0.32) !important;
  box-shadow: 0 6px 20px rgba(100,120,80,0.12) !important;
}

/* 信心指數進度條 */
.confidence-bar-fill {
  background: linear-gradient(90deg, hsl(88,22%,52%), hsl(42,32%,60%)) !important;
}

/* 按鈕 */
.btn-primary {
  background: linear-gradient(135deg, hsl(88,22%,46%) 0%, hsl(88,18%,60%) 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(100,120,80,0.25) !important;
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(100,120,80,0.38) !important;
}
.btn-secondary {
  background: rgba(255,252,244,0.72) !important;
  border-color: rgba(148,168,130,0.35) !important;
  color: var(--text-primary) !important;
}

/* 掃描雷射線 */
.scan-laser {
  background: linear-gradient(90deg, transparent, hsl(88,28%,52%), transparent) !important;
  box-shadow: 0 0 12px hsl(88,28%,52%) !important;
}

/* 掃描標題 */
.scan-title {
  background: linear-gradient(to right, hsl(88,14%,22%), hsl(88,20%,48%)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* 搜尋欄 / Input */
.search-input, input[type="text"], input[type="search"], textarea, select {
  background: rgba(255,252,244,0.78) !important;
  border: 1px solid rgba(148,168,130,0.30) !important;
  color: var(--text-primary) !important;
}
.search-input::placeholder { color: var(--text-muted) !important; }
.search-input:focus, input:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(130,158,110,0.15) !important;
  background: rgba(255,254,250,0.96) !important;
  outline: none !important;
}

/* 過濾標籤 */
.filter-chip {
  background: rgba(255,252,244,0.68) !important;
  border-color: rgba(148,168,130,0.28) !important;
  color: var(--text-secondary) !important;
}
.filter-chip:hover, .filter-chip.active {
  background: rgba(130,158,110,0.12) !important;
  border-color: var(--accent) !important;
  color: var(--primary) !important;
}

/* 植物卡片 */
.plant-card {
  background: rgba(255,253,246,0.80) !important;
  border-color: rgba(148,168,130,0.24) !important;
}
.plant-card:hover {
  background: rgba(255,254,250,0.96) !important;
  border-color: rgba(130,158,110,0.42) !important;
}
.plant-card-title { color: var(--text-primary) !important; }
.plant-card-sci   { color: var(--text-muted) !important; font-style: italic; }
.plant-card-desc  { color: var(--text-secondary) !important; }

/* 難易度徽章 */
.plant-card-difficulty.easy   { background: rgba(100,148,88,0.15)  !important; color: hsl(110,30%,38%) !important; }
.plant-card-difficulty.medium { background: rgba(170,148,80,0.15)  !important; color: hsl(42,38%,40%)  !important; }
.plant-card-difficulty.hard   { background: rgba(180,90,90,0.14)   !important; color: hsl(354,48%,45%) !important; }

/* 植物卡片 tag */
.plant-card-tag {
  background: rgba(130,158,110,0.14) !important;
  color: hsl(88,18%,46%) !important;
  border: none !important;
}

/* Wikipedia shimmer */
.wiki-img-loading {
  background: linear-gradient(90deg,
    rgba(220,228,210,0.55) 25%,
    rgba(238,242,230,0.80) 50%,
    rgba(220,228,210,0.55) 75%
  ) !important;
  background-size: 200% 100% !important;
  animation: shimmer 1.5s infinite !important;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 側面板 */
.plant-profile-sheet {
  background: #f5f2e8 !important;
  box-shadow: -8px 0 40px rgba(100,120,80,0.18) !important;
}
.sheet-overlay { background: rgba(80,100,60,0.22) !important; }

/* 診斷 chip */
.diagnosis-chip {
  background: rgba(130,158,110,0.12) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(130,158,110,0.26) !important;
}

/* 藥物類型標籤 */
.medicine-type.bio  { background: rgba(100,150,88,0.15)  !important; color: hsl(110,32%,38%) !important; }
.medicine-type.chem { background: rgba(170,148,80,0.15)  !important; color: hsl(42,38%,40%)  !important; }
.medicine-type.phys { background: rgba(100,128,180,0.14) !important; color: hsl(220,35%,45%) !important; }

/* 分頁按鈕 */
.tab-btn, .doctor-tab, .seller-tab {
  background: rgba(255,252,244,0.65) !important;
  border-color: rgba(148,168,130,0.26) !important;
  color: var(--text-secondary) !important;
}
.tab-btn.active, .tab-btn:hover,
.doctor-tab.active, .doctor-tab:hover,
.seller-tab.active, .seller-tab:hover {
  background: rgba(130,158,110,0.12) !important;
  border-color: var(--accent) !important;
  color: var(--primary) !important;
}

/* 醫生上傳區 */
.doctor-upload-zone {
  border-color: rgba(148,168,130,0.34) !important;
  background: rgba(255,252,244,0.55) !important;
}

/* 藥物/賣家卡片 */
.medicine-card, .seller-card, .garden-card, .garden-item {
  background: rgba(255,252,244,0.72) !important;
  border-color: rgba(148,168,130,0.22) !important;
}
.seller-card:hover {
  border-color: var(--accent) !important;
  background: rgba(255,254,250,0.95) !important;
}

/* 統計數字 */
.stat-value { color: var(--primary) !important; }
.stat-label { color: var(--text-muted) !important; }