/* ==========================================================
   農Prompt  —  全站樣式（沉穩專業風格）
   主色深墨綠，其餘以灰階為主；琥珀 / 紅只用於提醒與警示
   ========================================================== */
:root {
  --green: #1f5d3a;
  --green-700: #184a2e;
  --green-100: #e5eee7;
  --green-50: #f2f6f2;
  --orange: #b0681c;
  --orange-700: #8a4f12;
  --orange-100: #f7efe3;
  --blue: #2f5f8a;
  --blue-700: #244a6c;
  --blue-100: #e8eef4;
  --purple: #5b4d7a;
  --purple-700: #463b5f;
  --purple-100: #efedf4;
  --red: #a53d3a;
  --red-100: #f7e8e7;
  --yellow-100: #faf3e2;
  --bg: #f4f5f2;
  --card: #ffffff;
  --text: #1c2420;
  --muted: #5f6b64;
  --line: #e1e5df;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 1px 3px rgba(20, 30, 25, .05);
  --shadow-lg: 0 10px 30px rgba(20, 30, 25, .14);
  --sidebar-w: 248px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.35; font-weight: 700; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
ul { padding-left: 1.2em; }
button { font-family: inherit; }
img { max-width: 100%; }

/* 線條圖示 */
.i { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -.18em; }
.i.ok { color: var(--green); } .i.off { color: #b6bdb8; }
.w-sun { color: #c08a1e; } .w-cloud-sun, .w-cloud-sun-rain { color: #7d8a84; } .w-cloud-rain { color: var(--blue); } .w-cloud { color: #8a948f; }

/* 作物字章 */
.crop-mark {
  --cm: #6b7a72;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 6px; font-size: 14px; font-weight: 700; line-height: 1;
  color: var(--cm); background: color-mix(in srgb, var(--cm) 14%, #fff);
}
.crop-mark.sm { width: 20px; height: 20px; font-size: 12px; border-radius: 5px; }
.crop-mark.lg { width: 60px; height: 60px; font-size: 26px; border-radius: 10px; }

/* ---------- 版面 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-logo .i { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text b { font-size: 24px; color: var(--green-700); letter-spacing: .5px; line-height: 1.2; }
.brand-text small { font-size: 12.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; }
.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: 8px;
  color: #33403a; font-weight: 500; font-size: 17px;
  border-left: 3px solid transparent;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--green-50); color: var(--green-700); font-weight: 700; border-left-color: var(--green); border-radius: 0 8px 8px 0; }
.nav-ico { display: inline-flex; color: #6b7771; }
.nav-ico .i { width: 22px; height: 22px; }
.nav a.active .nav-ico { color: var(--green); }
.sidebar-foot { margin-top: auto; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.mode-badge { background: var(--yellow-100); color: #7a5410; font-size: 12px; padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.mode-badge.live { background: var(--green-100); color: var(--green-700); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: rgba(244,245,242,.92);
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid transparent;
}
.topbar-title { font-weight: 700; font-size: 19px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; width: 40px; height: 40px; border-radius: 8px;
  cursor: pointer; font-size: 18px; position: relative; color: #3d4a43;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: #c9d0ca; }
.icon-btn .i { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid #fff; box-sizing: content-box; }
.menu-btn { display: none; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); font-weight: 600; font-size: 15px; color: var(--text); }
.user-chip .i { color: var(--muted); }
.user-chip:hover { text-decoration: none; border-color: #c9d0ca; }
.view { padding: 10px 28px 40px; flex: 1; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-links a { color: var(--muted); margin-left: 16px; }

/* ---------- 通用元件 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 20px 22px; margin-bottom: 20px;
}
.card.tight { padding: 14px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.card-head .ico { display: inline-flex; width: 32px; height: 32px; border-radius: 8px; align-items: center; justify-content: center; }
.card-head .ico .i { width: 18px; height: 18px; }
.ico.g { background: var(--green-100); color: var(--green); } .ico.o { background: var(--orange-100); color: var(--orange); } .ico.b { background: var(--blue-100); color: var(--blue); } .ico.p { background: var(--purple-100); color: var(--purple); } .ico.r { background: var(--red-100); color: var(--red); }
.link { color: var(--green); font-size: 14px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.link .i { width: 16px; height: 16px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-side { grid-template-columns: 2fr 1fr; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 15px; color: #fff; background: var(--green);
  transition: background .15s, border-color .15s, transform .08s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--green-700); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-orange { background: var(--orange); } .btn-orange:hover { background: var(--orange-700); }
.btn-blue { background: var(--blue); } .btn-blue:hover { background: var(--blue-700); }
.btn-purple { background: var(--purple); } .btn-purple:hover { background: var(--purple-700); }
.btn-red { background: var(--red); } .btn-red:hover { background: #8a312f; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); border-color: #c9d0ca; }
.btn-light { background: var(--green-50); color: var(--green-700); border-color: #cfdcd2; }
.btn-light:hover { background: var(--green-100); }
.btn-white { background: #fff; color: var(--green-700); }
.btn-white:hover { background: #eef3ef; }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline-white:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 14.5px; color: var(--text); transition: .15s;
}
.chip:hover { border-color: var(--green); color: var(--green-700); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tag-g { background: var(--green-100); color: var(--green-700); }
.tag-o { background: var(--orange-100); color: var(--orange-700); }
.tag-b { background: var(--blue-100); color: var(--blue-700); }
.tag-p { background: var(--purple-100); color: var(--purple-700); }
.tag-r { background: var(--red-100); color: var(--red); }
.tag-y { background: var(--yellow-100); color: #7a5410; }
.tag-gray { background: #eef0ed; color: var(--muted); }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; color: #34413a; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd6d0; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 16px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,93,58,.14); }
textarea { resize: vertical; min-height: 90px; }
.form-row { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-group { display: flex; gap: 8px; }
.input-group > * { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- 語音輸入 ---------- */
.voice-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.voice-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--green); background: var(--green-50); color: var(--green-700);
  font-weight: 600; font-size: 15px; cursor: pointer; transition: .15s; font-family: inherit;
}
.voice-btn:hover { background: var(--green-100); }
.voice-btn.listening { background: var(--red); border-color: var(--red); color: #fff; animation: voicePulse 1.2s ease-in-out infinite; }
.voice-btn .voice-ico { display: inline-flex; }
.voice-langs .chip-sm { padding: 4px 11px; font-size: 13px; }
.voice-status { font-size: 13px; color: var(--muted); }
@keyframes voicePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(165,61,58,.4) } 50% { box-shadow: 0 0 0 7px rgba(165,61,58,0) } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: none; padding: 11px 16px; cursor: pointer; font-size: 16px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--green-700); border-color: var(--green); }

.progress { height: 8px; background: #e7ebe7; border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .4s; }
/* 模式選擇卡（Prompt 學堂：Prompt 醫生／Prompt 積木） */
.mode-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 6px 0 20px; }
.mode-card { position: relative; display: flex; align-items: center; gap: 16px; text-align: left; font-family: inherit; color: var(--text); background: #eef4ee; border: 1.5px solid #a9c2ae; border-radius: 12px; padding: 18px 20px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, background .15s, box-shadow .15s; }
.mode-card:hover { background: #e2ece3; border-color: var(--green); box-shadow: 0 6px 16px rgba(20,30,25,.14); }
.mode-card:focus-visible { outline: 3px solid rgba(31,93,58,.3); outline-offset: 2px; }
.mode-card .mc-ico { flex: none; width: 52px; height: 52px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--green-700); }
.mode-card .mc-ico .i { width: 28px; height: 28px; }
.mode-card .mc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mode-card b { font-size: 18px; }
.mode-card small { font-size: 15px; color: var(--muted); }
.mode-card .mc-prog { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 13.5px; color: var(--green-700); font-weight: 600; }
.mode-card .mc-prog .progress { width: 120px; height: 6px; background: #d3dfd4; }
.mode-card .mc-go { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 7px 10px 7px 14px; border-radius: 8px; background: #fff; border: 1px solid #a9c2ae; color: var(--green-700); font-size: 14px; font-weight: 700; }
.mode-card .mc-go .i { width: 16px; height: 16px; }
.mode-card:hover .mc-go { background: var(--green); border-color: var(--green); color: #fff; }
.mode-card .mc-check { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; display: none; align-items: center; justify-content: center; background: #fff; color: var(--green); }
.mode-card .mc-check .i { width: 16px; height: 16px; stroke-width: 3; }
/* 選中的卡：深綠底白字；沒選中的卡：淡綠底＋「切換」鈕，一看就知道可以點 */
.mode-card.on { background: var(--green); border-color: var(--green); color: #fff; cursor: default; }
.mode-card.on:hover { box-shadow: var(--shadow); }
.mode-card.on small { color: rgba(255,255,255,.85); }
.mode-card.on .mc-ico { background: rgba(255,255,255,.16); color: #fff; }
.mode-card.on .mc-prog { color: #fff; }
.mode-card.on .mc-prog .progress { background: rgba(255,255,255,.25); }
.mode-card.on .mc-prog .progress > span { background: #fff; }
.mode-card.on .mc-go { display: none; }
.mode-card.on .mc-check { display: inline-flex; }
.mode-cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mode-cards.four .mode-card { padding: 12px 14px; gap: 12px; }
.mode-cards.four .mc-ico { width: 42px; height: 42px; border-radius: 10px; }
.mode-cards.four .mc-ico .i { width: 23px; height: 23px; }
.mode-cards.four b { font-size: 16.5px; }
.mode-cards.four small { font-size: 13.5px; }
.mode-cards.four .mc-go { display: none; }
.mode-cards.four .mc-check { top: 8px; right: 8px; width: 22px; height: 22px; }
.mode-cards.four .mc-check .i { width: 14px; height: 14px; }
@media (max-width: 1100px) { .mode-cards.four .mode-card small { display: none; } }
@media (max-width: 640px) { .mode-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
/* 天氣地圖（js/weather-map.js） */
.wx-layout { display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.wx-layout .map-card { padding: 16px; }
.wx-layout .map-card h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.wx-layout .map-card .hint { margin: 0 0 8px; }
.twmap { position: relative; width: 100%; max-width: 440px; margin: 0 auto; }
.twmap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tw-c { fill: #d3e0cd; stroke: #fff; stroke-width: 1; stroke-linejoin: round; cursor: pointer; transition: fill .15s; }
.tw-c:hover, .tw-c.hi { fill: #b3cbae; }
.tw-c.on { fill: var(--green); }
.tw-c.off { fill: #e8ebe6; cursor: default; }
.tw-lab { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 0; padding: 2px 7px 3px; border-radius: 8px; border: 1px solid #b7c9b5; background: rgba(255,255,255,.95); box-shadow: 0 2px 6px rgba(20,30,25,.14); font-family: inherit; color: var(--text); cursor: pointer; line-height: 1.15; white-space: nowrap; }
.tw-lab:hover { border-color: var(--green); }
.tw-lab .tw-l1 { display: inline-flex; align-items: center; gap: 3px; }
.tw-lab .tw-l1 svg { flex: none; width: 15px; height: 15px; position: static; margin: 0; }
.tw-lab b { font-size: 14px; }
.tw-lab small { font-size: 11.5px; color: var(--muted); }
.tw-lab.on { background: #fff; border: 2px solid var(--green-700); box-shadow: 0 4px 12px rgba(20,30,25,.25); z-index: 2; }
.tw-lab.on small { color: var(--green-700); font-weight: 700; }
@media (max-width: 860px) { .wx-layout { grid-template-columns: 1fr; } }
.twmap { container-type: inline-size; }
@container (max-width: 360px) {   /* 地圖太小：標籤只留溫度，選中的縣市才顯示名稱 */
  .tw-lab { padding: 1px 5px; border-radius: 6px; }
  .tw-lab b { font-size: 12.5px; }
  .tw-lab .tw-l1 svg { width: 12px; height: 12px; }
  .tw-lab small { display: none; }
  .tw-lab.on small { display: block; }
}
@media (max-width: 640px) { .mode-cards { grid-template-columns: 1fr; gap: 10px; } .mode-card { padding: 14px 16px; } .mode-card .mc-ico { width: 44px; height: 44px; } }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.list li:last-child { border-bottom: none; }
.num { width: 24px; height: 24px; border-radius: 6px; background: var(--green-100); color: var(--green-700); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .mt-lg { margin-top: 24px; }
.center { text-align: center; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { margin-bottom: 10px; color: #9aa59f; }
.empty .big .i { width: 40px; height: 40px; stroke-width: 1.5; }
.callout { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14.5px; }
.callout > .i:first-child { margin-right: 4px; }
.callout-g { background: var(--green-50); border: 1px solid #cfdcd2; }
.callout-g > .i:first-child { color: var(--green); }
.callout-y { background: var(--yellow-100); border: 1px solid #ecdcb4; }
.callout-y > .i:first-child { color: var(--orange); }
.callout-r { background: var(--red-100); border: 1px solid #ebc9c7; }
.callout-r > .i:first-child { color: var(--red); }
.callout-b { background: var(--blue-100); border: 1px solid #cbd8e5; }
.callout-b > .i:first-child { color: var(--blue); }
pre.prompt-box {
  background: #f8f9f7; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; white-space: pre-wrap; font-family: "Cascadia Code", Consolas, "Noto Sans TC", monospace;
  font-size: 14px; line-height: 1.65; margin: 0; max-height: 420px; overflow: auto;
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.tbl td .crop-mark { margin-right: 6px; vertical-align: middle; }
.up { color: var(--red); font-weight: 700; } .down { color: var(--green); font-weight: 700; }

/* ---------- Modal / Toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,28,24,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 580px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 16px 22px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; }
.close-x { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #25302a; color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 15px; box-shadow: var(--shadow-lg); animation: pop .2s; }
.toast.ok { background: var(--green-700); } .toast.err { background: var(--red); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

/* ---------- 首頁：問候列（果園剪影；時段 t-* 與天氣 sky-* 由 js/pages/home.js 設定） ---------- */
.hero {
  --sky1: #dcebf2; --sky2: #eef3e8; --ink: #1d3a29; --ink2: #4f5f56; --hill-far: #c6d3bb; --hill-mid: #b1c19d; --field: #b8c6a2; --furrow: #93a67e;
  position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 100%);
  color: var(--ink); padding: 24px 30px; margin-bottom: 20px; min-height: 150px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  transition: background .6s;
}
.hero.t-morning { --sky1: #f5e7cb; --sky2: #eef1e3; }
.hero.t-dusk { --sky1: #efd3b6; --sky2: #efe5d4; --hill-far: #c9c8b0; }
.hero.t-night { --sky1: #2f3d46; --sky2: #43524a; --ink: #eef2ec; --ink2: #c5cfc8; --hill-far: #56645a; --hill-mid: #4b5a4e; --field: #52604f; --furrow: #3f4c3d; }
.hero.sky-overcast, .hero.sky-rain { --sky1: #d5dcdc; --sky2: #e6eae3; }
.hero.sky-rain.t-night, .hero.sky-overcast.t-night { --sky1: #2c353b; --sky2: #3d4842; }
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hs-hill-far { fill: var(--hill-far); }
.hs-hill-mid { fill: var(--hill-mid); }
.hs-field { fill: var(--field); }
.hs-furrows line { stroke: var(--furrow); stroke-width: 1.3; opacity: .7; }
.hs-disc { fill: #f2c661; }
.hs-glow { fill: #f6d98f; opacity: .35; animation: hsGlow 6s ease-in-out infinite alternate; }
.hs-moon { fill: #e6e2cf; display: none; }
.hs-cloud ellipse { fill: #fdfefe; opacity: .92; }
.hs-cloud .hs-cloud-shade { fill: #c9d6db; opacity: .55; }
.hs-clouds .hs-cloud { animation: hsDrift 38s ease-in-out infinite alternate; }
.hs-clouds .c2 { animation-duration: 52s; } .hs-clouds .c3 { animation-duration: 46s; animation-delay: -12s; }
.hs-extra { display: none; }
.hs-tree { transform-box: fill-box; transform-origin: 50% 100%; animation: hsSway 6s ease-in-out infinite; }
.hs-rain { display: none; }
.hs-rain line { stroke: #7f95a1; stroke-width: 1.1; opacity: .55; stroke-linecap: round; animation: hsRain .9s linear infinite; }
.hs-rain line:nth-child(3n) { animation-delay: -.3s; } .hs-rain line:nth-child(3n+1) { animation-delay: -.6s; }
/* 天氣 */
.sky-cloudy .hs-extra { display: inline; }
.sky-cloudy .hs-sun { opacity: .65; }
.sky-overcast .hs-sun, .sky-rain .hs-sun { display: none; }
.sky-overcast .hs-extra, .sky-rain .hs-extra { display: inline; }
.sky-overcast .hs-cloud ellipse, .sky-rain .hs-cloud ellipse { fill: #c3cbcc; opacity: .95; }
.sky-overcast .hs-cloud-shade, .sky-rain .hs-cloud-shade { fill: #a9b3b5 !important; }
.sky-rain .hs-rain { display: inline; }
/* 夜晚：月亮取代太陽 */
.t-night .hs-sun { display: none; }
.t-night .hs-moon { display: inline; }
.t-night.sky-overcast .hs-moon, .t-night.sky-rain .hs-moon { display: none; }
.t-night .hs-cloud ellipse { fill: #6c7a78; opacity: .6; }
.t-night .hs-tree circle { fill: #3d4c40; }
@keyframes hsSway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes hsDrift { from { transform: translateX(-40px); } to { transform: translateX(40px); } }
@keyframes hsGlow { from { opacity: .25; } to { opacity: .45; } }
@keyframes hsRain { from { transform: translate(0, -12px); } to { transform: translate(-4px, 24px); } }
.hero-content { position: relative; z-index: 1; min-width: 0; max-width: 56%; animation: heroIn .6s ease-out both; }
.hero-date { font-size: 14px; color: var(--ink2); letter-spacing: .3px; }
.hero h1 { font-size: 26px; font-weight: 700; margin: 2px 0 4px; color: var(--ink); }
.hero p { margin: 0; font-size: 16px; color: var(--ink2); }
.hero p b { color: var(--orange-700); font-size: 18px; }
.t-night p b { color: #f3cf86; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; align-self: flex-start; margin-left: auto; animation: heroIn .6s .1s ease-out both; }
.hero-actions .btn { box-shadow: 0 2px 8px rgba(20, 30, 25, .15); }
@keyframes heroIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 首頁：功能卡（整張可點） */
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-height: 170px; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.feature:hover { text-decoration: none; border-color: #b8cbbd; box-shadow: 0 6px 18px rgba(20,30,25,.08); transform: translateY(-2px); }
.feature .f-ico { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--green-100); color: var(--green); margin-bottom: 6px; }
.feature .f-ico .i { width: 22px; height: 22px; }
.feature h3 { font-size: 18px; margin: 0; }
.feature p { color: var(--muted); font-size: 14.5px; flex: 1; margin: 0; }
.feature .f-link { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-weight: 600; font-size: 14.5px; margin-top: 6px; }
.feature .f-link .i { transition: transform .15s; }
a.feature:hover .f-link .i { transform: translateX(3px); }

/* 首頁：天氣卡 */
.feature.w-card { position: relative; gap: 10px; outline: none; }
.w-head { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.w-head .i { color: var(--green); }
.w-head span { font-size: 14px; }
.w-head .link { margin-left: auto; font-size: 13.5px; }
.w-now { display: flex; align-items: center; gap: 12px; }
.w-now .w-big { width: 36px; height: 36px; stroke-width: 1.6; }
.w-now .temp { font-size: 28px; font-weight: 700; line-height: 1.1; }
.w-now small { font-size: 13.5px; }
.w-stats { display: flex; flex-direction: column; gap: 1px; margin-left: auto; font-size: 13px; color: #3d4a43; }
.w-stats span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.w-stats .i { color: var(--muted); }
.w-fc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; }
.w-fc div { display: flex; flex-direction: column; align-items: center; background: var(--bg); border-radius: 6px; padding: 4px 2px; }
.w-fc span { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: #3d4a43; }
.w-fc .i { width: 16px; height: 16px; }
.w-fc small { font-size: 12.5px; }
.w-tip {
  position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 10px 12px; border-radius: 8px;
  background: #25302a; color: #fff; font-size: 13.5px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .18s, transform .18s;
}
.w-card:hover .w-tip, .w-card:focus-within .w-tip { opacity: 1; transform: none; }
.w-src { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.72); }
.w-head .tag { font-size: 11px; padding: 0 6px; }

.home-grid { margin-top: 20px; align-items: stretch; }
.notice-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.notice-item:last-child { border-bottom: none; }
.notice-item a { color: var(--text); }
.notice-item small { white-space: nowrap; }
.weather-main { display: flex; align-items: center; gap: 16px; }
.weather-main .w-ico .i { width: 48px; height: 48px; stroke-width: 1.5; }
.weather-main .temp { font-size: 32px; font-weight: 700; line-height: 1; }
.weather-stats { display: grid; gap: 8px; font-size: 15px; min-width: 150px; }
.weather-stats div { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; }
.weather-stats span { display: inline-flex; align-items: center; gap: 6px; }
.weather-stats .i { color: var(--muted); }
.weather-stats b { font-weight: 600; }
.forecast { display: flex; gap: 8px; margin-top: 12px; }
.forecast > div { flex: 1; text-align: center; background: var(--bg); border-radius: 8px; padding: 8px 4px; font-size: 14px; }
.forecast .fi .i { width: 24px; height: 24px; margin: 2px 0; }
.wx-recent { font-size: 13px; color: #3d4a43; background: var(--bg); border-radius: 8px; padding: 8px 10px; line-height: 1.6; }
.wx-recent b { display: block; font-size: 12.5px; color: var(--muted); }

/* 首頁：我的農場 2D / 3D */
.home-side .card { margin-bottom: 20px; }
.home-side .notice-item { flex-direction: column; gap: 2px; }
/* 首頁今日農務提醒、政府公告、鈴鐺提醒清單：字放大 */
.home-side .list li, .home-side .notice-item, .rem-list li { font-size: 17px; padding-top: 14px; padding-bottom: 14px; line-height: 1.55; }
.home-side .tag, .rem-list .tag { font-size: 14px; padding: 3px 10px; }
.home-side .notice-item small { font-size: 14.5px; }
.home-side .num, .rem-list .num { width: 26px; height: 26px; font-size: 14px; }
.farm-card { display: flex; flex-direction: column; }
.farm-card .card-head { flex-wrap: wrap; }
.farm-card .card-head h2 { white-space: nowrap; }
.farm-card .farm-stage { flex: 1; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg button { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; padding: 5px 12px; border-radius: 6px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--green-700); box-shadow: 0 1px 2px rgba(20,30,25,.12); }
.farm-stage { position: relative; isolation: isolate; min-height: 420px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }   /* isolation：場景上的標籤不會蓋過小視窗 */
.fs-list { position: absolute; inset: 0; overflow: auto; padding: 14px; background: #e6ebe8; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-content: start; }
.fs-li { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 10px 12px; }
.fs-li:hover { border-color: var(--green); }
.fs-li > a { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.fs-li > a:hover { text-decoration: none; }
.fs-li > a > span:not(.fs-badges) { display: flex; flex-direction: column; min-width: 0; }
.fs-li small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-li-add { justify-content: center; border-style: dashed; color: var(--green-700); font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit; }
.fs-li-add .i { width: 16px; height: 16px; }
.farm-empty { display: flex; align-items: center; justify-content: center; }
.farm-empty .fs-empty-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.farm-empty .empty { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-width: 440px; }
.fs-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: #e6ebe8; color: var(--green-700); font-weight: 600; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(31,93,58,.2); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fs-3d { position: absolute; inset: 0; background: #e6ebe8; }
.fs-3d canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.fs-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fs-label {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px 4px 8px; box-shadow: 0 4px 12px rgba(20,30,25,.14);
  color: var(--text); white-space: nowrap; transition: box-shadow .2s, border-color .2s; font-family: inherit;
}
.fs-label::after { content: ""; position: absolute; bottom: -6px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.fs-label.on { border-color: var(--green); box-shadow: 0 6px 18px rgba(20,30,25,.2); }
.fs-l-row { display: flex; align-items: center; gap: 4px; }
.fs-l-main { display: flex; align-items: center; gap: 6px; color: var(--text); padding: 2px 2px; }
.fs-l-main:hover { text-decoration: none; }
.fs-l-main b { font-size: 14px; font-weight: 700; }
.fs-l-edit { border: none; background: none; width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.fs-l-edit:hover { background: var(--green-100); color: var(--green-700); }
.fs-l-edit .i { width: 15px; height: 15px; }
.fs-label small { font-size: 12px; display: none; padding: 0 4px 2px; }
.fs-label.on small, .fs-label:hover small { display: block; }
.fs-badges { display: inline-flex; gap: 2px; }
.fs-narrow .fs-label { padding: 3px 6px; }
.fs-narrow .fs-badges, .fs-narrow .fs-l-edit { display: none; }
.fs-narrow .fs-l-main b { font-size: 12.5px; }
.fs-badges .i { width: 15px; height: 15px; }
.fs-label-add { flex-direction: row; gap: 6px; padding: 6px 12px; border: 1px dashed #9fb3a4; color: var(--green-700); font-weight: 600; font-size: 14px; cursor: pointer; }
.fs-label-add:hover, .fs-label-add.on { border-style: solid; border-color: var(--green); background: var(--green-50); }
.fs-ctrl { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.fs-ctrl button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #3d4a43; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.fs-ctrl button:hover { border-color: var(--green); color: var(--green-700); }
.fs-ctrl .i { width: 17px; height: 17px; }
.fs-hint { position: absolute; left: 12px; bottom: 12px; font-size: 12.5px; color: #3d4a43; background: rgba(255,255,255,.85); padding: 4px 10px; border-radius: 6px; pointer-events: none; }
/* 田區詳情：場景上的重點圖示與點開的小視窗 */
.fs-hot { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 5px; box-shadow: 0 3px 10px rgba(20,30,25,.16); font-family: inherit; font-size: 13px; color: var(--text); white-space: nowrap; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.fs-hot::after { content: ""; position: absolute; bottom: -5px; left: 50%; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #fff; }
.fs-hot:hover, .fs-hot.on { border-color: var(--green); box-shadow: 0 6px 16px rgba(20,30,25,.22); }
.fs-hot .hi { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, currentColor 13%, #fff); }
.fs-hot .hi .i { width: 14px; height: 14px; }
.fs-hot b { font-weight: 700; }
.fs-hot small { color: var(--muted); font-size: 12px; }
.fs-hot-sign { border-radius: 8px; padding: 5px 10px 5px 6px; }
.fs-hot-sign .crop-mark { width: 26px; height: 26px; }
.fs-hot-sign > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.fs-hot-warn { border-color: #e7c9a4; }
.fs-hot-bad { border-color: #e2b4b1; }
.fs-narrow .fs-hot { padding: 3px 5px; }
.fs-narrow .fs-hot > span:not(.hi):not(.crop-mark) { display: none; }
.fs-narrow .fs-hot-sign > span { display: flex; }
.fs-narrow .fs-hot-sign small { display: none; }
.fs-pop { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(20,30,25,.22); padding: 14px 16px; }
.fs-pop h4 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.fs-pop h4 .hi { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, currentColor 13%, #fff); }
.fs-pop h4 .hi .i { width: 16px; height: 16px; }
.fs-pop h4 .x { margin-left: auto; border: none; background: none; cursor: pointer; color: var(--muted); padding: 4px; display: inline-flex; }
.fs-pop ul { list-style: none; margin: 0; padding: 0; }
.fs-pop li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid #eef0ec; font-size: 14px; }
.fs-pop li:first-child { border-top: none; }
.fs-pop li .d { color: var(--muted); font-size: 13px; white-space: nowrap; min-width: 74px; }
.fs-pop .kv { margin: 0; }
.fs-pop .pop-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fs-pop.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none; border-radius: 14px 14px 0 0; max-height: 65vh; }
.fd-scene .farm-stage { height: 440px; min-height: 0; }
/* 田區資料卡：寬版浮在場景左右兩側，窄版排到場景下方 */
.fd-stagewrap { position: relative; container-type: inline-size; }
.fd-side { position: absolute; top: 50%; transform: translateY(-50%); width: 240px; z-index: 2; background: rgba(255,255,255,.93); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: 0 6px 18px rgba(20,30,25,.1); transition: box-shadow .3s, border-color .3s; }
.fd-side-l { left: 16px; } .fd-side-r { right: 16px; }
.fd-side h4 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; color: var(--green-700); }
.fd-side h4 .i { width: 17px; height: 17px; }
.fd-side dl { display: grid; grid-template-columns: 56px 1fr; gap: 7px 10px; margin: 0; font-size: 15px; }
.fd-side dt { color: var(--muted); }
.fd-side dd { margin: 0; min-width: 0; }
.fd-side dd.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-side .fd-side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef0ec; }
.fd-side .fd-side-foot small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.fd-side.flash { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,93,58,.18), 0 6px 18px rgba(20,30,25,.1); }
@container (max-width: 999px) {
  .fd-stagewrap .fd-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
  .fd-side { position: static; transform: none; width: auto; box-shadow: none; background: #fff; }
}
.fd-noscene .fd-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fd-noscene .fd-side { position: static; transform: none; width: auto; box-shadow: none; background: #fff; }
@container (max-width: 559px) {
  .fd-stagewrap .fd-sides { grid-template-columns: 1fr; }
}
.fd-stagebar { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.fd-stagebar .fc-stage { flex: 1; margin: 0; }
.fd-stagebar > b { font-size: 14px; white-space: nowrap; }

/* ---------- 我的農場 ---------- */
/* 田區總覽 */
.farm-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 20px; }
.farm-summary > div:not(.grow) { display: flex; align-items: baseline; gap: 6px; padding-right: 16px; border-right: 1px solid var(--line); }
.farm-summary b { font-size: 24px; font-weight: 700; color: var(--green-700); line-height: 1.1; }
.farm-summary .warn b { color: var(--orange-700); }
.farm-summary small { color: var(--muted); font-size: 14px; }
.farm-summary .grow { font-size: 14px; min-width: 200px; }
/* 田區卡片 */
.field-card2 { padding: 0; overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.field-card2:hover, .field-card2:focus-visible { border-color: #b8cbbd; box-shadow: 0 6px 18px rgba(20,30,25,.08); outline: none; }
.fc-band { position: relative; height: 40px; background: #eef2ec; }
.fc-band .fc-crop-ico { position: absolute; right: 60px; top: 5px; width: 30px; height: 30px; stroke-width: 1.5; }
.fc-body { padding: 14px 20px 18px; }
.fc-head { display: flex; align-items: center; gap: 12px; }
.fc-head .crop-mark { width: 38px; height: 38px; font-size: 18px; border-radius: 8px; margin-top: -30px; border: 3px solid #fff; box-sizing: content-box; }
.fc-head h3 { margin: 0; font-size: 18px; }
.fc-menu { position: relative; }
.fc-menu summary { list-style: none; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.fc-menu summary::-webkit-details-marker { display: none; }
.fc-menu summary:hover, .fc-menu[open] summary { background: var(--bg); color: var(--text); }
.fc-menu-pop { position: absolute; right: 0; top: 36px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 140px; display: flex; flex-direction: column; }
.fc-menu-pop button { display: flex; align-items: center; gap: 8px; border: none; background: none; padding: 8px 10px; border-radius: 6px; font-size: 14.5px; cursor: pointer; color: var(--text); text-align: left; font-family: inherit; }
.fc-menu-pop button:hover { background: var(--bg); }
.fc-menu-pop button.danger { color: var(--red); }
.fc-stage { margin: 12px 0 4px; }
.fc-track { display: flex; gap: 4px; }
.fc-track span { flex: 1; height: 6px; border-radius: 3px; background: #e5e9e3; }
.fc-track span.done { background: #b9cdb9; }
.fc-track span.now { background: var(--green); }
.fc-stage small { display: block; margin-top: 5px; font-size: 13.5px; }
.fc-stage small b { color: var(--green-700); }
.fc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.fc-stats div { background: var(--bg); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.fc-stats b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-stats small { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.fc-status, .fc-logs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 8px; font-size: 14px; }
.fc-label { font-size: 13px; color: var(--muted); min-width: 60px; }
.fc-status .tag .i { width: 13px; height: 13px; }
.fc-logs > span:not(.fc-label):not(.muted) { display: inline-flex; align-items: center; gap: 4px; color: #3d4a43; }
.fc-logs .i { color: var(--muted); width: 15px; height: 15px; }
.fc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 520px) { .fc-stats { grid-template-columns: repeat(2, 1fr); } .farm-summary > div:not(.grow) { border-right: none; } }
.field-card { display: flex; gap: 16px; align-items: flex-start; }
.field-card .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); margin: 6px 0 10px; }
.field-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.field-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.log-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.log-item:last-child { border-bottom: none; }
.log-item .d { color: var(--muted); white-space: nowrap; width: 92px; }

/* ---------- AI 問診 ---------- */
.stepper { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.stepper div { flex: 1; min-width: 110px; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px 6px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.stepper div.done, .stepper button.done { background: var(--green-100); color: var(--green-700); border-color: transparent; }
.stepper button { flex: 1; min-width: 110px; text-align: center; font-size: 14px; font-weight: 600; padding: 8px 6px; border-radius: 8px; border: 1px solid var(--line); font-family: inherit; cursor: pointer; }
.stepper button.done:hover { background: #d3e5d7; text-decoration: underline; }
.stepper div.now { background: var(--green); color: #fff; border-color: transparent; }
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 480px; overflow-y: auto; padding: 6px 2px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 10px; font-size: 15px; line-height: 1.6; animation: pop .2s; }
.msg.sys { background: var(--green-50); border: 1px solid #cfdcd2; align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.user { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.msg .who { font-size: 12px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.answer-area { padding: 14px; border-top: 1px solid var(--line); margin-top: 8px; }
.context-panel .kv { grid-template-columns: 118px 1fr; }
.context-panel .kv dt { white-space: nowrap; }
.context-panel .unknown { color: #9a6a1a; }
.cause { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cause:last-child { border-bottom: none; }
.cause .bar { height: 6px; background: #eceeeb; border-radius: 3px; margin: 6px 0; overflow: hidden; }
.cause .bar span { display: block; height: 100%; background: var(--orange); }
/* 可能原因的名次（取代百分比與進度條） */
.cause > b { font-size: 16.5px; }
.cause > small { display: block; margin-top: 4px; }
.rank { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 6px; margin-right: 8px; background: #eceeeb; color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.rank.first { background: var(--green); color: #fff; }
/* 反問的地區題：縣市依區域分組 */
.reg-group { display: flex; gap: 10px; align-items: baseline; margin-top: 8px; }
.reg-group > span { flex: none; width: 36px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.reg-group .chips { margin: 0; }
@media (max-width: 560px) { .reg-group { flex-direction: column; gap: 4px; } .reg-group > span { width: auto; } }
/* AI 問診簡答：先看重點，按鈕再產生／展開詳答 */
.brief-lab { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.brief-main { font-size: 20px; font-weight: 700; color: var(--green-700); background: var(--green-50); border-left: 4px solid var(--green); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; line-height: 1.5; }
.brief-main .tag { font-size: 13px; font-weight: 600; vertical-align: middle; }
.brief-do { margin: 0 0 16px; padding-left: 1.4em; font-size: 17px; }
.brief-do li { margin-bottom: 8px; }
.brief-note { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.brief-note .i { flex: none; margin-top: 3px; width: 15px; height: 15px; }
.brief-toggle { margin-top: 16px; font-size: 16px; white-space: normal; }
.brief-toggle .i { transition: transform .2s; transform: rotate(90deg); }
.brief-toggle[aria-expanded="true"] .i { transform: rotate(-90deg); }
.source-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fbfbfa; font-size: 14px; }
.source-item b { display: block; }
.source-item .org { color: var(--blue-700); font-weight: 600; font-size: 12.5px; }
.ai-badge { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.ai-badge.official { background: var(--blue-100); color: var(--blue-700); }
.ai-badge.ai { background: var(--purple-100); color: var(--purple-700); }
.skeleton { background: linear-gradient(90deg, #eceeeb 25%, #f6f7f5 50%, #eceeeb 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; margin: 10px 0; }
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 20px; justify-content: center; }
.thinking i { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: bounce 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s } .thinking i:nth-child(3) { animation-delay: .3s }
@keyframes bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.photo-preview { max-height: 140px; border-radius: 8px; border: 1px solid var(--line); }
/* 頂部「說明」按鈕與引導式說明（js/tour.js） */
.help-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; font-size: 15px; color: var(--green-700); cursor: pointer; }
.help-btn[hidden] { display: none; }
.help-btn .i { width: 19px; height: 19px; }
.help-btn:hover { border-color: #c9d0ca; background: var(--green-50); }
@media (max-width: 600px) { .help-btn .help-txt { display: none; } .help-btn { padding: 0 11px; } }
.tour-block { position: fixed; inset: 0; z-index: 899; }
.tour-hole { position: fixed; z-index: 900; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(20, 30, 25, .55); outline: 3px solid #f2e3b3; outline-offset: 2px; transition: all .25s ease; pointer-events: none; }
.tour-hole.none { width: 1px; height: 1px; left: 50%; top: 40%; outline: none; }
.tour-pop { position: fixed; z-index: 901; width: min(360px, calc(100vw - 32px)); background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 18px 20px 16px; transition: top .25s ease, left .25s ease; }
.tour-pop .t-step { font-size: 13px; color: var(--muted); font-weight: 600; }
.tour-pop h3 { margin: 4px 0 6px; font-size: 18px; color: var(--green-700); }
.tour-pop p { margin: 0; font-size: 16px; line-height: 1.65; }
.tour-pop .t-dots { display: flex; gap: 5px; margin: 14px 0 12px; }
.tour-pop .t-dots i { width: 7px; height: 7px; border-radius: 50%; background: #d6ddd7; }
.tour-pop .t-dots i.on { background: var(--green); width: 18px; border-radius: 4px; }
.tour-pop .t-btns { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.tour-pop .t-skip { margin-right: auto; background: none; border: none; font: inherit; font-size: 14.5px; color: var(--muted); cursor: pointer; padding: 6px 2px; text-decoration: underline; }
@media (max-width: 600px) { .tour-pop { left: 16px !important; right: 16px; width: auto; top: auto !important; bottom: 16px; } }
.photo-picked { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.example-q { font-size: 14px; }
/* 反問：一輪 2～3 題 */
.rq { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rq:last-of-type { border-bottom: none; }
.rq-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 16px; line-height: 1.5; }
.rq-head .num { margin-top: 1px; }
.rq-head b { flex: 1; font-weight: 600; }
.rq-head .tag { margin-top: 2px; }
.rq-text { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.rq-text input { flex: 1; }
.rq-text .voice-bar { margin-top: 0; }
.rq-text .voice-label { display: none; }
.rq-text .voice-btn { padding: 9px 11px; }
.rq-text .voice-status:empty { display: none; }
.rq-sug { color: var(--purple-700); margin-top: 6px; }
.ai-status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #3d4a43; background: var(--bg); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.ai-status.ok { background: var(--purple-100); color: var(--purple-700); }
.ai-status.ok .i { color: var(--purple); }
.card.tight .ai-status { margin-bottom: 0; }
.link-btn { border: none; background: none; padding: 0 2px; color: var(--green); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.context-panel .kv dt .tag { font-size: 11px; padding: 0 5px; }

/* ---------- Prompt 學堂 ---------- */
.case-card { cursor: pointer; border: 1px solid var(--line); transition: border-color .15s; }
.case-card:hover { border-color: var(--green); }
.case-card.done { border-color: #b9ccbe; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; margin-bottom: 8px; background: #fff; }
.check-item input { width: 18px; height: 18px; }
.check-item.correct { border-color: var(--green); background: var(--green-50); }
.check-item.wrong { border-color: var(--red); background: var(--red-100); }
.check-item.missed { border-color: var(--orange); background: var(--orange-100); }
.score-ring { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--green-700); background: conic-gradient(var(--green) var(--pct), #e7ebe7 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.score-ring span { position: relative; z-index: 1; }
.block-group { margin-bottom: 14px; }
.block-group h4 { margin-bottom: 6px; }
.meter { display: flex; gap: 4px; }
.meter i { flex: 1; height: 8px; border-radius: 3px; background: #e7ebe7; }
.meter i.on { background: var(--green); }

/* Prompt 積木：積木盒 → 組合台（js/blocks.js） */
.pb-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.pb-side { position: sticky; top: 76px; }
.pb-group { margin-bottom: 16px; }
.pb-group-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.pb-group-head small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.pb-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--bc); }
.pb-list { display: flex; flex-wrap: wrap; gap: 14px 10px; padding-bottom: 6px; }
/* 積木本體：上方凹槽（::before，填背景色）、下方凸榫（::after，填積木色） */
.pb { --pb-bg: #fff; position: relative; display: inline-flex; align-items: center; gap: 7px; background: var(--bc); color: #fff; border-radius: 6px; padding: 10px 13px 10px 11px;
  font-size: 14px; font-weight: 500; line-height: 1.35; user-select: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); }
.pb::before { content: ""; position: absolute; left: 14px; top: 0; width: 20px; height: 5px; background: var(--pb-bg); border-radius: 0 0 5px 5px; }
.pb::after { content: ""; position: absolute; left: 14px; bottom: -5px; width: 20px; height: 5px; background: var(--bc); border-radius: 0 0 5px 5px; z-index: 1; }
.pb-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: .9; }
.pb-pick { cursor: pointer; transition: transform .12s, filter .12s, opacity .15s; }
.pb-pick:hover, .pb-pick:focus-visible { filter: brightness(1.08); transform: translateY(-2px); outline: none; }
.pb-pick.used { opacity: .45; }
.pb-pick.used:hover { opacity: .7; }
.pb-pick[draggable="true"]:active { cursor: grabbing; }
.pb-custom { display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed var(--bc); color: var(--bc); background: transparent; border-radius: 6px; padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.pb-custom:hover { background: color-mix(in srgb, var(--bc) 8%, #fff); }
/* 組合台 */
.pb-stage { --pb-bg: #f4f5f2; background: #f4f5f2; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; transition: box-shadow .3s; }
.pb-stage.complete { box-shadow: inset 0 0 0 2px var(--green); }
.pb-slot { position: relative; min-height: 42px; margin-bottom: 7px; }
.pb-slot:not(.filled) { display: flex; align-items: center; border: 1.5px dashed color-mix(in srgb, var(--bc) 40%, #fff); border-radius: 6px; padding: 0 12px; color: color-mix(in srgb, var(--bc) 75%, #6b7a72); font-size: 13.5px; transition: background .15s, border-color .15s; }
.pb-slot.filled { margin-bottom: 0; }
.pb-slot.filled + .pb-slot:not(.filled) { margin-top: 7px; }
.pb-slot.target:not(.filled) { border-color: var(--bc); border-style: solid; }
.pb-slot.over { background: color-mix(in srgb, var(--bc) 12%, #fff); }
.pb-ghost { display: inline-flex; align-items: center; gap: 6px; }
.pb-ghost .i { width: 15px; height: 15px; }
.pb-placed { --pb-bg: #f4f5f2; display: flex; width: 100%; }
.pb-placed .pb-text { flex: 1; }
.pb-x { border: none; background: rgba(255, 255, 255, .18); color: #fff; width: 24px; height: 24px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.pb-x:hover { background: rgba(255, 255, 255, .32); }
.pb-x .i { width: 14px; height: 14px; }
.pb-done { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--green-50); color: var(--green-700); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pb-out summary { cursor: pointer; font-weight: 600; color: var(--green-700); font-size: 14.5px; }
@media (max-width: 1100px) { .pb-wrap { grid-template-columns: 1fr; } .pb-side { position: static; } }

/* ---------- 農業資訊 ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar select { width: auto; min-width: 140px; }
.info-card { border-left: 3px solid var(--green); }
.info-card.lvl-高 { border-left-color: var(--red); }
.info-card.lvl-中 { border-left-color: var(--orange); }
.info-card.lvl-低 { border-left-color: var(--green); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 36px; }
.spark i { flex: 1; background: var(--green-100); border-radius: 2px 2px 0 0; min-height: 3px; }
.spark i:last-child { background: var(--green); }

/* ---------- 工具箱 ---------- */
.result-box { background: var(--green-50); border: 1px solid #cfdcd2; border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px; margin-top: 12px; }
.result-box b { font-size: 22px; color: var(--green-700); }

/* ---------- 登入 / 註冊 ---------- */
[hidden] { display: none !important; }
.auth-wrap { max-width: 480px; margin: 24px auto; }
.auth-wrap .tabs button { flex: 1; justify-content: center; }
.big-ico { display: inline-flex; width: 56px; height: 56px; border-radius: 12px; background: var(--green-100); color: var(--green); align-items: center; justify-content: center; margin-bottom: 8px; }
.big-ico .i { width: 30px; height: 30px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- 感測器需求整理 ---------- */
.sensor-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.sensor-item ul { margin: 8px 0 4px; padding-left: 1.2em; font-size: 15px; }
.sensor-item li { margin-bottom: 4px; }
.sensor-line { font-size: 15px; margin-top: 4px; }
.sensor-line > .i { color: var(--muted); margin-right: 2px; }
.src-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; background: var(--blue-100); color: var(--blue-700); border-radius: 5px; padding: 1px 7px; margin-left: 4px; white-space: nowrap; }
.src-chip .i { width: 12px; height: 12px; }
.src-chip.generic { background: #eef0ed; color: var(--muted); }
pre.spec-doc { background: #fbfbfa; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; white-space: pre-wrap; font-family: inherit; font-size: 15px; line-height: 1.75; margin: 0; }
.vendor-q li { margin-bottom: 10px; font-size: 15px; }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; font-size: 15px; margin: 0; }
.glossary dt { font-weight: 700; color: var(--green-700); }
.glossary dd { margin: 0; }
@media (max-width: 520px) { .glossary { grid-template-columns: 1fr; } .glossary dd { margin-bottom: 6px; } }

/* 只列印需求單 */
@media print {
  body.print-spec * { visibility: hidden !important; }
  body.print-spec #specCard, body.print-spec #specCard * { visibility: visible !important; }
  body.print-spec #specCard { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: none; }
  body.print-spec .no-print { display: none !important; }
  body.print-spec pre.spec-doc { border: none; padding: 0; font-size: 12pt; }
}

/* ---------- 網站管理 ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; margin-bottom: 0; }
.stat b { font-size: 26px; color: var(--text); }
.stat b.green { color: var(--green-700); } .stat b.red { color: var(--red); } .stat b.purple { color: var(--purple-700); }
#stats { margin-bottom: 20px; }
.tbl-wrap { overflow-x: auto; }
.tbl-wrap .tbl td { vertical-align: middle; }
.row-off td { opacity: .55; }

/* ---------- 減少動態效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-content, .hero-actions, .hs-tree, .hs-cloud, .hs-glow, .hs-rain line { animation: none !important; }
  a.feature:hover, a.feature:hover .f-link .i { transform: none; }
}

/* ---------- RWD ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar, .view, .footer { padding-left: 16px; padding-right: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 20px; min-height: 170px; align-items: flex-start; }
  .hero h1 { font-size: 22px; }
  .hero-content { max-width: 100%; }
  .hero-actions { margin-left: 0; }
  .hero-scene { opacity: .55; }
  .farm-stage { min-height: 340px; }
  .fd-scene .farm-stage { height: 320px; }
  .feature { min-height: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .user-chip { padding: 7px 10px; font-size: 14px; }
  .topbar-title { font-size: 17px; }
}
