:root {
  --bg: #f4f7ef;
  --card: #ffffff;
  --text: #203326;
  --muted: #71806f;
  --green: #4f7f52;
  --green-dark: #315c36;
  --green-soft: #e7f1df;
  --warn: #b56b22;
  --danger: #b43b3b;
  --line: #e3eadc;
  --shadow: 0 14px 35px rgba(43, 71, 43, .12);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.app-shell { min-height: 100vh; max-width: 520px; margin: 0 auto; padding: env(safe-area-inset-top) 16px 88px; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:18px 2px 12px; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: 28px; letter-spacing: -1px; }
h2 { font-size: 22px; letter-spacing: -.5px; }
h3 { font-size: 17px; margin: 22px 0 10px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.hero-card { background: linear-gradient(135deg,#fff,#e8f4df); border:1px solid var(--line); border-radius:28px; padding:20px; box-shadow:var(--shadow); display:flex; align-items:center; justify-content:space-between; gap:16px; }
.hero-icon { width:70px; height:70px; display:grid; place-items:center; font-size:42px; background:#fff; border-radius:24px; }
.quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:16px 0 4px; }
button { border:0; cursor:pointer; font:inherit; }
.primary-btn,.secondary-btn,.ghost-btn { min-height:44px; border-radius:16px; padding:0 14px; font-weight:700; }
.primary-btn { background:var(--green); color:#fff; box-shadow:0 8px 18px rgba(79,127,82,.24); }
.secondary-btn { background:var(--green-soft); color:var(--green-dark); }
.ghost-btn { background:#ffffffaa; color:var(--green-dark); border:1px solid var(--line); }
.screen { display:none; animation: fade .18s ease; }
.screen.active { display:block; }
@keyframes fade { from { opacity:.5; transform:translateY(4px)} to {opacity:1; transform:none} }
.list, .plant-grid { display:grid; gap:10px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:22px; padding:15px; box-shadow:0 8px 20px rgba(43,71,43,.06); }
.task-card { display:flex; gap:12px; align-items:flex-start; }
.task-dot { width:12px; height:12px; margin-top:5px; border-radius:50%; background:var(--green); flex:0 0 auto; }
.task-card.high .task-dot { background:var(--danger); }
.task-card.medium .task-dot { background:var(--warn); }
.task-title { font-weight:800; margin-bottom:5px; }
.pill { display:inline-flex; align-items:center; min-height:26px; border-radius:999px; background:var(--green-soft); color:var(--green-dark); padding:3px 10px; font-size:12px; font-weight:800; }
.pill.warn { background:#fff2df; color:var(--warn); }
.pill.danger { background:#ffe8e8; color:var(--danger); }
.section-title { display:flex; justify-content:space-between; align-items:center; margin: 8px 0 14px; }
.plant-card { display:grid; grid-template-columns:76px 1fr; gap:12px; align-items:center; }
.plant-photo { width:76px; height:76px; object-fit:cover; border-radius:20px; background:var(--green-soft); display:grid; place-items:center; font-size:34px; }
.plant-meta { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.form-card { background:var(--card); border:1px solid var(--line); border-radius:26px; padding:16px; display:grid; gap:14px; box-shadow:var(--shadow); }
label { display:grid; gap:7px; color:var(--green-dark); font-size:14px; font-weight:800; }
input, textarea, select { width:100%; border:1px solid var(--line); border-radius:15px; padding:13px 14px; font:inherit; color:var(--text); background:#fbfcf8; outline:none; }
textarea { min-height:88px; resize:vertical; }
select { appearance:none; background:#fbfcf8; }
.guide-block h3 { margin-top:0; }
.checklist { padding-left:18px; margin:8px 0 0; color:var(--muted); line-height:1.6; }
.ban { border-left:5px solid var(--danger); }
.ok { border-left:5px solid var(--green); }
.detail-photo { width:100%; max-height:260px; object-fit:cover; border-radius:26px; margin:14px 0; background:var(--green-soft); }
.advice { white-space:pre-line; line-height:1.55; }
.record-actions { display:grid; grid-template-columns: repeat(2,1fr); gap:8px; margin-top:12px; }
.record-actions button { background:var(--green-soft); color:var(--green-dark); min-height:38px; border-radius:13px; font-weight:700; }
.tabbar { position:fixed; left:50%; bottom:0; transform:translateX(-50%); max-width:520px; width:100%; padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:rgba(244,247,239,.86); backdrop-filter:blur(18px); display:grid; grid-template-columns:repeat(3,1fr); gap:8px; border-top:1px solid var(--line); }
.tab { min-height:48px; border-radius:18px; background:transparent; color:var(--muted); font-weight:800; }
.tab.active { background:#fff; color:var(--green-dark); box-shadow:0 8px 18px rgba(43,71,43,.08); }
.empty-state:empty::before { content:'暂无数据，先新增一盆植物。'; display:block; color:var(--muted); background:#ffffff88; border:1px dashed var(--line); border-radius:20px; padding:18px; text-align:center; }
@media (max-width: 360px) { .quick-actions { grid-template-columns:1fr; } h1{font-size:25px} }

.photo-thumb{width:100%;max-height:220px;object-fit:cover;border-radius:18px;margin:10px 0;background:var(--green-soft)}
.analysis-card{border-left:5px solid var(--green)}
.analysis-card.high{border-left-color:var(--danger)}
.analysis-card.medium{border-left-color:var(--warn)}

.full-btn{width:100%;margin:0 0 14px 0}
.form-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}

.tool-card{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.weather-badge{display:inline-flex;border-radius:999px;background:#eef6ff;color:#35607a;padding:3px 10px;font-size:12px;font-weight:800}
.action-list{padding-left:18px;margin:8px 0 0;line-height:1.65}

.detail-btn{margin-top:8px;min-height:32px;border-radius:999px;padding:0 12px;background:var(--green-soft);color:var(--green-dark);font-size:12px;font-weight:800}
.task-summary {
  margin: 8px 0 10px;
  padding-left: 18px;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}
.task-summary li + li { margin-top: 4px; }
.quick-action-btn{border:0;border-radius:999px;background:#2f6f43;color:#fff;font-size:13px;font-weight:800;padding:9px 12px;min-height:36px}
.quick-action-btn:disabled{background:#d7eadc;color:#2f6f43}

.task-reason{margin:10px 0;padding:10px 12px;border-radius:14px;background:#f6f8ef;color:#42553b;font-size:13px;line-height:1.55}
.task-reason strong{display:block;margin-bottom:4px;color:#2f6f43}
.task-reason p{margin:0}

/* V1.1 action cards */
.voice-panel{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0 6px;align-items:center}
.voice-panel p{grid-column:1/-1}
.task-card.v11{position:relative;overflow:hidden}
.task-card.v11 .task-body{width:100%}
.plant-line{font-size:12px;color:var(--muted);font-weight:700;margin-bottom:6px}
.action-title{display:flex;gap:8px;align-items:center;font-size:18px;margin-bottom:6px;line-height:1.25}
.action-reason{font-size:14px;line-height:1.55;color:#334155;margin:0 0 8px}
.task-card.water_now{border-left:5px solid #2f7d4a}
.task-card.skip_water{border-left:5px solid #d49a2f;background:linear-gradient(180deg,#fff,#fffaf0)}
.task-card.check_leaf,.task-card.check_soil{border-left:5px solid #3b82a0}
.task-card.fertilize{border-left:5px solid #4f7f52}
.check-guide{background:#f6f8ef;border:1px solid var(--line);border-radius:16px;padding:10px 12px;margin:10px 0;color:#42553b;font-size:13px;line-height:1.5}
.check-guide ul{margin:6px 0 0;padding-left:18px}
.action-buttons{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:12px}
.action-buttons .quick-action-btn:first-child{grid-column:span 1}
.quick-action-btn.secondary-action{background:#edf4e7;color:#315c36;border:1px solid #dbe8d3}
.evidence{margin-top:10px;background:#fbfcf8;border:1px solid var(--line);border-radius:14px;padding:9px 11px;color:#42553b;font-size:13px}
.evidence summary{cursor:pointer;font-weight:800;color:#2f6f43}
.evidence ul{margin:8px 0 0;padding-left:18px;line-height:1.6}
@media (max-width: 360px){.voice-panel{grid-template-columns:1fr}.action-buttons{grid-template-columns:1fr}}
.voice-input-label{grid-column:1/-1;color:var(--green-dark);font-size:14px;font-weight:800}
#voiceTextInput{min-height:72px;margin-top:7px;background:#fff;border:1px solid #cfe0c7}

/* V1.2 floating NPC assistant */
.npc-button{position:fixed;right:18px;bottom:calc(88px + env(safe-area-inset-bottom));z-index:50;display:flex;align-items:center;gap:8px;border:0;border-radius:999px;padding:8px 12px 8px 8px;background:linear-gradient(135deg,#fff8d8,#dff3d4);box-shadow:0 14px 32px rgba(50,94,56,.24);color:#315c36;font-weight:900}
.npc-face{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:#fff;font-size:28px;box-shadow:inset 0 -4px 0 rgba(79,127,82,.12)}
.npc-bubble{font-size:13px;white-space:nowrap}
.npc-panel{position:fixed;left:14px;right:14px;bottom:calc(88px + env(safe-area-inset-bottom));z-index:60;max-width:492px;margin:0 auto;background:#fff;border:1px solid var(--line);border-radius:28px;box-shadow:0 24px 60px rgba(31,55,35,.28);transform:translateY(16px) scale(.98);opacity:0;pointer-events:none;transition:.18s ease;overflow:hidden}
.npc-panel.open{transform:none;opacity:1;pointer-events:auto}
.npc-panel-head{display:flex;gap:10px;align-items:center;padding:14px 14px 10px;background:linear-gradient(135deg,#f7ffe9,#e3f2d9)}
.npc-avatar{width:46px;height:46px;border-radius:18px;background:#fff;display:grid;place-items:center;font-size:28px;box-shadow:0 6px 16px rgba(79,127,82,.15)}
.npc-panel-head p{margin-top:2px;color:var(--muted);font-size:12px}
.npc-close{margin-left:auto;width:34px;height:34px;border-radius:50%;background:#fff;color:#315c36;font-size:22px;line-height:1}
.npc-messages{max-height:260px;overflow:auto;padding:12px;display:grid;gap:8px;background:#fbfcf8}
.npc-msg{max-width:86%;padding:10px 12px;border-radius:16px;font-size:14px;line-height:1.5;white-space:pre-line}
.npc-msg.bot{background:#edf6e8;color:#28452d;border-bottom-left-radius:6px}
.npc-msg.user{justify-self:end;background:#4f7f52;color:#fff;border-bottom-right-radius:6px}
.npc-chips{display:flex;gap:8px;overflow:auto;padding:10px 12px 0;background:#fff}
.npc-chips button{flex:0 0 auto;border-radius:999px;background:#f0f6ea;color:#315c36;padding:8px 10px;font-size:12px;font-weight:800}
.npc-input-row{display:grid;grid-template-columns:1fr auto;gap:8px;padding:10px 12px 12px;background:#fff}
#npcInput{min-height:48px;max-height:96px;padding:11px 12px;border-radius:16px;background:#fbfcf8}
.npc-input-row .primary-btn{min-height:48px;border-radius:16px}
@media (max-width:360px){.npc-bubble{display:none}.npc-button{padding-right:8px}.npc-messages{max-height:220px}}
