* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: #f3fbf6;
  color: #073f2d;
  line-height: 1.7;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 7%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 24px rgba(0, 80, 50, 0.08);
}

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

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #00a86b, #78d98b);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.logo h1 {
  font-size: 1.1rem;
  color: #064b35;
  line-height: 1.2;
}

.logo p {
  font-size: 0.8rem;
  color: #6a8178;
}

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

nav a {
  color: #355f53;
  text-decoration: none;
  font-weight: 800;
}

/* Hero */

.hero {
  padding: 90px 7% 60px;
  background:
    linear-gradient(115deg, rgba(246,255,249,.96), rgba(225,247,238,.76)),
    radial-gradient(circle at 85% 15%, rgba(0,168,107,.18), transparent 30%);
}

.hero-content {
  max-width: 920px;
}

.badge {
  display: inline-block;
  color: #00a86b;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.hero h2 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  color: #053b2a;
  line-height: 1.15;
  margin-bottom: 18px;
}

.hero p {
  max-width: 880px;
  font-size: 1.15rem;
  color: #49695f;
}

/* Layout */

.container {
  padding: 56px 7%;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 120, 80, 0.12);
  border-radius: 28px;
  padding: 30px;
  box-shadow: 0 12px 32px rgba(0, 80, 50, 0.08);
}

.card h3 {
  color: #064b35;
  margin-bottom: 18px;
  font-size: 1.35rem;
}

.card p {
  margin-bottom: 12px;
  color: #49695f;
}

.card ul {
  padding-left: 22px;
  color: #49695f;
}

/* Form */

label {
  display: block;
  font-weight: 900;
  color: #064b35;
  margin: 14px 0 6px;
}

input,
select {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid rgba(0, 120, 80, 0.2);
  border-radius: 16px;
  font-size: 1rem;
  background: #fff;
  color: #073f2d;
}

input:focus,
select:focus {
  outline: none;
  border-color: #00a86b;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.12);
}

button {
  margin-top: 22px;
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, #007e55, #00b878);
  color: white;
  font-size: 1rem;
}

button:hover {
  opacity: 0.92;
}

/* Results */

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

#weatherRisk,
#climateAlert {
  color: #355f53;
}

/* Risk badges */

.risk-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.risk-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f3fbf6;
  border: 1px solid rgba(0, 120, 80, 0.12);
}

.risk-item strong {
  color: #064b35;
}

.risk-low {
  color: #057a4f;
  font-weight: 900;
}

.risk-mid {
  color: #b45309;
  font-weight: 900;
}

.risk-high {
  color: #b91c1c;
  font-weight: 900;
}

/* Link buttons */

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.link-btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 14px;
  background: #0ea66c;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.link-btn:hover {
  opacity: 0.9;
}

/* Alert box */

.alert-box {
  background: #fff7ed;
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 18px;
  padding: 18px;
}

.alert-box h4 {
  color: #9a3412;
  margin-bottom: 10px;
}

.typhoon-link {
  background: #f97316;
}

/* Footer */

footer {
  text-align: center;
  padding: 32px 7%;
  background: #053b2a;
  color: white;
}

/* Mobile */

@media (max-width: 900px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  nav {
    flex-wrap: wrap;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 42px 6%;
  }

  .card {
    padding: 24px;
  }
}

/* AI Prompt 區 */

.ai-prompt-card textarea {
  width: 100%;
  min-height: 260px;
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 120, 80, 0.18);
  background: #071b15;
  color: #d8fff0;
  font-size: 0.95rem;
  line-height: 1.8;
  resize: vertical;
}

/* 生態系 Footer */

footer {
  margin-top: 60px;
  padding: 56px 7% 32px;
  background:
    linear-gradient(135deg, #032f22, #065f46);
  color: white;
  text-align: left;
}

.footer-eco {
  max-width: 1200px;
  margin: auto;
}

.footer-eco h3 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.footer-eco p {
  color: rgba(255,255,255,.82);
  margin-bottom: 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.footer-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 18px;
  color: white;
  text-decoration: none;
}

.footer-card:hover {
  background: rgba(255,255,255,.15);
  transform: translateY(-3px);
}

.footer-card span {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.18);
  text-align: center;
  color: rgba(255,255,255,.72);
}

@media(max-width:900px){
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.ai-prompt-card .button-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-prompt-card .button-group button,
.ai-prompt-card .button-group .link-btn {

  height: 52px;

  padding: 0 24px;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  border-radius: 16px;

  font-size: 1rem;

  font-weight: 900;

  white-space: nowrap;
}

.ai-prompt-card .button-group .link-btn {
  background: linear-gradient(135deg,#007e55,#00b878);
}

/* =========================
   AI 氣象儀表板
========================= */

.weather-dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.weather-card {
  background: linear-gradient(135deg, #ffffff, #effdf5);
  border: 1px solid rgba(0, 120, 80, 0.15);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(0, 80, 50, 0.08);
  text-align: center;
}

.weather-card span {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.weather-card p {
  font-weight: 900;
  color: #49695f;
  margin-bottom: 4px;
}

.weather-card strong {
  font-size: 1.35rem;
  color: #064b35;
}

@media(max-width:900px) {
  .weather-dashboard {
    grid-template-columns: 1fr;
  }
}

/* 修正 AI 氣象儀表板排列 */
.weather-dashboard {
  width: 100%;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 28px;
}

.weather-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 修正 AI 指令區按鈕大小一致 */
.ai-prompt-card .button-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ai-prompt-card .button-group button,
.ai-prompt-card .button-group .link-btn {
  width: 190px;
  height: 52px;
  margin-top: 16px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

@media(max-width:900px) {
  .weather-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ai-prompt-card .button-group button,
  .ai-prompt-card .button-group .link-btn {
    width: 100%;
  }
}

.ai-prompt-card .button-group{
    align-items:flex-end !important;
}

.ai-prompt-card .button-group .link-btn{
    margin-top:16px;
    box-sizing:border-box;
}

/* =========================
   高價值升級區：病害燈號、建議卡、歷史圖表、情境推演
========================= */

.smart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.section-note {
  color: #5f7f74;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  background: #f3fbf6;
  border: 1px dashed rgba(0,120,80,.25);
  color: #527268;
  font-weight: 800;
}

.disease-lights {
  display: grid;
  gap: 14px;
}

.disease-light {
  border-radius: 18px;
  padding: 16px;
  background: #f7fffb;
  border: 1px solid rgba(0,120,80,.14);
}

.disease-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.disease-head strong {
  flex: 1;
  color: #064b35;
}

.disease-head b {
  font-size: 1.05rem;
}

.risk-low-box {
  border-left: 7px solid #10b981;
}

.risk-mid-box {
  border-left: 7px solid #f59e0b;
}

.risk-high-box {
  border-left: 7px solid #ef4444;
}

.risk-dot {
  font-size: 1.3rem;
}

.advice-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.farm-advice-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #effdf5);
  border: 1px solid rgba(0,120,80,.14);
  box-shadow: 0 8px 20px rgba(0,80,50,.06);
}

.advice-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.farm-advice-card h4 {
  color: #064b35;
  margin-bottom: 6px;
}

.history-card,
.simulation-card {
  margin-top: 24px;
}

.history-toolbar {
  margin-bottom: 18px;
}

.history-toolbar .btn-clear {
  margin-top: 0;
}

.mini-chart-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.mini-chart {
  background: #ffffff;
  border: 1px solid rgba(0,120,80,.14);
  border-radius: 20px;
  padding: 18px;
}

.mini-chart-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: #064b35;
}

.mini-bars {
  height: 170px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding-top: 10px;
  border-bottom: 1px solid rgba(0,80,50,.12);
}

.mini-bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: end;
  flex-direction: column;
  gap: 6px;
}

.mini-bar {
  width: 100%;
  min-height: 10px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #00b878, #007e55);
}

.mini-bar-wrap small {
  font-size: 0.68rem;
  color: #6a8178;
  writing-mode: vertical-rl;
  height: 36px;
}

.scenario-question,
.scenario-feedback {
  padding: 18px;
  border-radius: 18px;
  background: #f3fbf6;
  border: 1px solid rgba(0,120,80,.14);
  color: #355f53;
}

.scenario-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.scenario-options button {
  margin-top: 0;
  white-space: normal;
  line-height: 1.5;
}

@media(max-width:900px) {
  .smart-grid,
  .mini-chart-row,
  .scenario-options,
  .advice-card-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   歷史氣象圖表：表格＋座標軸版
========================= */

.history-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
}

.history-table th,
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,120,80,.12);
  text-align: center;
}

.history-table th {
  background: #e8f8ef;
  color: #064b35;
  font-weight: 900;
}

.chart-stack {
  display: grid;
  gap: 24px;
}

.axis-chart {
  background: #ffffff;
  border: 1px solid rgba(0,120,80,.14);
  border-radius: 20px;
  padding: 20px;
}

.axis-chart h4 {
  color: #064b35;
  margin-bottom: 14px;
}

.axis-chart-body {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  height: 260px;
}

.y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  color: #527268;
  font-weight: 800;
  font-size: 0.85rem;
}

.plot-area {
  position: relative;
  border-left: 2px solid rgba(0,80,50,.3);
  border-bottom: 2px solid rgba(0,80,50,.3);
  padding: 12px 10px 0;
}

.grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(0,80,50,.18);
}

.grid-line.top { top: 0; }
.grid-line.mid { top: 50%; }
.grid-line.bottom { bottom: 0; }

.bar-area {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: end;
  gap: 12px;
}

.axis-bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 6px;
}

.axis-bar-value {
  font-size: 0.8rem;
  font-weight: 900;
  color: #064b35;
}

.axis-bar {
  width: 80%;
  min-height: 8px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #00b878, #007e55);
}

.x-label {
  font-size: 0.8rem;
  color: #527268;
  font-weight: 900;
}

.x-axis-title {
  margin-top: 12px;
  color: #527268;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

@media(max-width:900px){
  .axis-chart-body {
    grid-template-columns: 56px 1fr;
  }

  .bar-area {
    gap: 6px;
  }
}


/* =========================
   V3.0 AI 決策中心首頁儀表板
========================= */

.v3-dashboard-section {
  padding-top: 32px;
  padding-bottom: 20px;
}

.v3-dashboard-card {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(3, 47, 34, .96), rgba(6, 95, 70, .94)),
    radial-gradient(circle at 90% 10%, rgba(120, 217, 139, .25), transparent 30%);
  color: #ffffff;
  box-shadow: 0 22px 55px rgba(0, 80, 50, .22);
}

.v3-dashboard-head {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 24px;
  align-items: center;
}

.v3-kicker {
  color: #8ff0bd;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.v3-dashboard-head h3 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 10px 0 12px;
  color: #ffffff;
}

.v3-dashboard-head p {
  color: rgba(255,255,255,.82);
  max-width: 860px;
}

.v3-score-box {
  border-radius: 26px;
  padding: 22px;
  text-align: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
}

.v3-score-box span,
.v3-score-box small {
  display: block;
  color: rgba(255,255,255,.75);
  font-weight: 800;
}

.v3-score-box strong {
  display: block;
  font-size: 2.4rem;
  line-height: 1.1;
  color: #b7ffd1;
}

.v3-dashboard-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.v3-metric {
  border-radius: 22px;
  padding: 20px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
}

.v3-metric span {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.v3-metric small {
  display: block;
  color: rgba(255,255,255,.72);
  font-weight: 800;
}

.v3-metric strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 1.05rem;
}

.v3-flow {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.v3-flow div {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 900;
  color: rgba(255,255,255,.9);
}

.v3-flow span {
  color: #8ff0bd;
  font-weight: 900;
}

@media(max-width:900px) {
  .v3-dashboard-head,
  .v3-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .v3-dashboard-card {
    padding: 26px;
  }
}



/* =========================
   V3.0 AI 決策中心：三站融合、可信度、決策矩陣
========================= */

.decision-center-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  margin-bottom: 24px;
}

.decision-center-grid-second {
  grid-template-columns: .8fr 1.2fr;
}

.station-fusion-panel,
.ai-confidence-panel,
.decision-confidence-panel,
.decision-matrix-panel {
  display: grid;
  gap: 16px;
}

.station-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.station-compare-card {
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff, #f0fff7);
  border: 1px solid rgba(0,120,80,.14);
  box-shadow: 0 8px 22px rgba(0,80,50,.06);
}

.station-compare-card h4 {
  color: #064b35;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.station-compare-card small {
  color: #5f7f74;
  font-weight: 800;
}

.station-data-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  color: #355f53;
  font-weight: 800;
}

.fusion-summary {
  border-radius: 22px;
  padding: 20px;
  background: #073f2d;
  color: #d8fff0;
}

.fusion-summary strong {
  color: #b7ffd1;
}

.confidence-big {
  text-align: center;
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #053b2a, #087a55);
  color: white;
}

.confidence-big strong {
  display: block;
  font-size: 3rem;
  line-height: 1;
  color: #b7ffd1;
}

.confidence-big span {
  display: block;
  margin-top: 8px;
  font-weight: 900;
  color: rgba(255,255,255,.84);
}

.confidence-detail-list {
  display: grid;
  gap: 10px;
}

.confidence-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3fbf6;
  color: #355f53;
  font-weight: 900;
}

.decision-meter {
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #effdf5);
  border: 1px solid rgba(0,120,80,.14);
}

.decision-meter-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.decision-circle {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #ffffff 48%, transparent 49%),
    conic-gradient(#00b878 var(--score), #d9f2e5 0);
  font-size: 1.8rem;
  font-weight: 1000;
  color: #064b35;
}

.decision-meter-text strong {
  color: #064b35;
  font-size: 1.35rem;
}

.decision-meter-text p {
  color: #49695f;
  margin-top: 8px;
}

.matrix-table-wrap {
  overflow-x: auto;
}

.decision-matrix {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
}

.decision-matrix th,
.decision-matrix td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(0,120,80,.12);
  text-align: center;
}

.decision-matrix th {
  background: #e8f8ef;
  color: #064b35;
  font-weight: 1000;
}

.matrix-good {
  color: #057a4f;
  font-weight: 1000;
}

.matrix-watch {
  color: #b45309;
  font-weight: 1000;
}

.matrix-danger {
  color: #b91c1c;
  font-weight: 1000;
}

@media(max-width:900px) {
  .decision-center-grid,
  .decision-center-grid-second,
  .station-card-grid {
    grid-template-columns: 1fr;
  }

  .decision-meter-main {
    flex-direction: column;
    text-align: center;
  }
}
