/* 宁夏12316助农增收智能体 —— 移动端样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --green: #2E7D32; --green-light: #4CAF50; --green-pale: #E8F5E9;
  --green-deep: #1B5E20; --orange: #FF8F00; --red: #D32F2F; --blue: #1976D2;
  --gray: #666; --gray-light: #F5F5F5; --border: #E0E0E0;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F0F2F5; color: #333; font-size: 15px; line-height: 1.6;
  max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }

/* 顶部栏 */
.navbar { position: sticky; top: 38px; z-index: 100;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
  color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.navbar .back { font-size: 20px; cursor: pointer; width: 24px; }
.navbar h1 { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.navbar .placeholder { width: 24px; }

/* 页面容器 */
.page { display: none; padding-bottom: 70px; }
.page.active { display: block; }

/* 首页头部卡片 */
.hero { background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
  color: #fff; padding: 20px 16px 46px; }
.hero .greet { font-size: 13px; opacity: .9; }
.hero .name { font-size: 21px; font-weight: 600; margin: 4px 0 2px; }
.hero .meta { font-size: 12.5px; opacity: .92; }
.hero .weather { margin-top: 10px; background: rgba(255,255,255,.18); border-radius: 10px;
  padding: 8px 12px; font-size: 12.5px; display: flex; justify-content: space-between; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; margin: 12px; padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.card-title { font-size: 15.5px; font-weight: 600; color: var(--green-deep);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.card-title::before { content: ''; width: 3.5px; height: 15px; background: var(--green-light);
  border-radius: 2px; }

/* 上浮卡片（首页功能入口） */
.float-card { margin-top: -34px; }

/* 功能网格 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.entry { background: #fff; border-radius: 10px; padding: 13px 6px; text-align: center;
  cursor: pointer; transition: .18s; border: 1px solid transparent; }
.entry:active { transform: scale(.96); background: var(--green-pale); }
.entry .ico { font-size: 25px; display: block; margin-bottom: 5px; }
.entry .nm { font-size: 12.5px; color: #333; font-weight: 500; }
.entry .sub { font-size: 10.5px; color: var(--gray); margin-top: 1px; }

/* 列表项 */
.list-item { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .label { color: var(--gray); font-size: 14px; }
.list-item .value { font-weight: 500; text-align: right; }
.list-item .value.big { font-size: 17px; color: var(--green-deep); }

/* 按钮 */
.btn { display: block; width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--green); color: #fff; font-size: 15.5px; font-weight: 500;
  cursor: pointer; margin-top: 10px; transition: .15s; }
.btn:active { transform: scale(.98); opacity: .9; }
.btn.secondary { background: var(--green-pale); color: var(--green-deep); }
.btn.small { padding: 8px 14px; width: auto; font-size: 13.5px; display: inline-block; margin: 0; }

/* 标签 */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { background: var(--green-pale); color: var(--green-deep); padding: 3px 10px;
  border-radius: 14px; font-size: 12px; }
.tag.orange { background: #FFF3E0; color: #E65100; }
.tag.blue { background: #E3F2FD; color: #0D47A1; }
.tag.red { background: #FFEBEE; color: #C62828; }

/* 上传区 */
.upload-box { border: 2px dashed var(--green-light); border-radius: 12px; padding: 26px 16px;
  text-align: center; background: var(--green-pale); cursor: pointer; margin-bottom: 12px; }
.upload-box .ico { font-size: 34px; }
.upload-box .txt { color: var(--green-deep); font-size: 14px; margin-top: 6px; font-weight: 500; }
.upload-box .hint { color: var(--gray); font-size: 12px; margin-top: 3px; }
.upload-box img.preview { max-width: 100%; max-height: 190px; border-radius: 8px; }

/* 语音按钮 */
.voice-btn { width: 96px; height: 96px; border-radius: 50%; margin: 18px auto;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 16px rgba(46,125,50,.35); font-size: 13px; transition: .2s; }
.voice-btn .ico { font-size: 30px; }
.voice-btn.recording { animation: pulse 1.2s infinite; background: linear-gradient(135deg, #E53935, #EF5350); }
@keyframes pulse { 0%,100% { transform: scale(1); box-shadow: 0 4px 16px rgba(229,57,53,.4); }
  50% { transform: scale(1.07); box-shadow: 0 8px 26px rgba(229,57,53,.6); } }

/* 结果区 */
.result { background: var(--gray-light); border-radius: 10px; padding: 14px; margin-top: 12px;
  font-size: 14px; }
.result .row { display: flex; padding: 6px 0; border-bottom: 1px dashed #DDD; }
.result .row:last-child { border-bottom: none; }
.result .row .k { color: var(--gray); width: 92px; flex-shrink: 0; }
.result .row .v { flex: 1; font-weight: 500; word-break: break-all; }

/* 加载 */
.loading { text-align: center; padding: 22px; color: var(--green); font-size: 14px; }
.loading .spin { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--green-pale);
  border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 标签页 */
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 88px; z-index: 50; }
.tabs .tab { flex: 1; text-align: center; padding: 12px 4px; font-size: 14px; color: var(--gray); cursor: pointer;
  border-bottom: 2.5px solid transparent; }
.tabs .tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

/* 农事日历 */
.cal-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.cal-item:last-child { border-bottom: none; }
.cal-date { width: 76px; flex-shrink: 0; color: var(--green); font-weight: 600; font-size: 13px; }
.cal-body { flex: 1; }
.cal-stage { font-weight: 600; font-size: 14px; }
.cal-task { font-size: 13px; color: var(--gray); margin-top: 2px; }
.cal-item.current { background: var(--green-pale); border-radius: 8px; padding: 11px 8px; }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 12px 0; }
.chart .bar { flex: 1; background: linear-gradient(180deg, var(--green-light), var(--green));
  border-radius: 4px 4px 0 0; position: relative; min-height: 4px; }
.chart .bar span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; color: var(--green-deep); white-space: nowrap; }
.chart-labels { display: flex; gap: 6px; font-size: 10.5px; color: var(--gray); }
.chart-labels span { flex: 1; text-align: center; }

/* 底部导航 */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; border-top: 1px solid var(--border);
  display: flex; z-index: 90; padding-bottom: env(safe-area-inset-bottom); }
.tabbar .tb { flex: 1; text-align: center; padding: 7px 0 8px; cursor: pointer; color: var(--gray); font-size: 10.5px; }
.tabbar .tb.active { color: var(--green); }
.tabbar .tb .ico { font-size: 20px; display: block; }

/* 提示 */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.78); color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 14px; z-index: 999; display: none; max-width: 80%; text-align: center; }

.progress-bar { height: 7px; background: var(--green-pale); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-bar .fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: 4px; transition: width .6s; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px;
  background: var(--green-pale); color: var(--green-deep); }
.badge.warn { background: #FFF3E0; color: #E65100; }
.badge.danger { background: #FFEBEE; color: #C62828; }

.note { font-size: 12px; color: var(--gray); margin-top: 8px; line-height: 1.5; }
.answer { background: var(--green-pale); border-left: 3px solid var(--green); padding: 12px;
  border-radius: 0 8px 8px 0; margin-top: 10px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }


/* ===== SVG 图标（替代 emoji，跨设备100%一致显示）===== */
.ic {
  width: 1.15em; height: 1.15em;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.22em; display: inline-block; flex-shrink: 0;
}
.ico .ic { width: 1.75em; height: 1.75em; stroke-width: 1.6; }
.tb .ico .ic { width: 1.5em; height: 1.5em; }
.card-title .ic { width: 1.25em; height: 1.25em; }


/* ===== 图标配色美化：彩色圆角底板 ===== */
.entry .ico, .card .ico {
  width: 46px; height: 46px; margin: 0 auto 8px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 7px rgba(0,0,0,.07);
  transition: transform .18s ease, box-shadow .18s ease;
}
.entry .ico .ic, .card .ico .ic { width: 24px; height: 24px; stroke-width: 1.75; }
.entry:active .ico { transform: scale(.9); }

/* 九色配色（同明度、同饱和度，整体协调） */
.c-green  { background: linear-gradient(140deg,#E8F5E9,#C8E6C9); color: #2E7D32; }
.c-orange { background: linear-gradient(140deg,#FFF3E0,#FFE0B2); color: #E65100; }
.c-teal   { background: linear-gradient(140deg,#E0F2F1,#B2DFDB); color: #00695C; }
.c-blue   { background: linear-gradient(140deg,#E3F2FD,#BBDEFB); color: #1565C0; }
.c-purple { background: linear-gradient(140deg,#F3E5F5,#E1BEE7); color: #6A1B9A; }
.c-red    { background: linear-gradient(140deg,#FFEBEE,#FFCDD2); color: #C62828; }
.c-cyan   { background: linear-gradient(140deg,#E0F7FA,#B2EBF2); color: #00838F; }
.c-gold   { background: linear-gradient(140deg,#FFF8E1,#FFECB3); color: #EE8100; }
.c-indigo { background: linear-gradient(140deg,#E8EAF6,#C5CAE9); color: #283593; }

/* 卡片标题图标：统一主题色，尺寸更精致 */
.card-title .ic { width: 1.15em; height: 1.15em; stroke-width: 2; color: var(--green); }

/* 底部导航图标 */
.tabbar .tb .ico .ic { width: 1.45em; height: 1.45em; stroke-width: 1.9; }
.tabbar .tb.active .ico .ic { stroke-width: 2.2; }


/* ===== 九宫格文字排版优化 ===== */
.entry { padding: 14px 4px 12px; }
.entry .nm { font-size: 13px; color: #2b2b2b; font-weight: 600; letter-spacing: .2px; }
.entry .sub { font-size: 10.5px; color: #9aa0a6; margin-top: 3px; }
