/* 工商财税服务 H5 - 全部样式（无外部依赖） */
:root {
  --primary: #165DFF;
  --teal: #0FC6C2;
  --orange: #FF7D00;
  --bg: #F5F7FA;
  --text: #1D2129;
  --text-muted: #86909C;
  --card: #FFFFFF;
  --border: #E5E6EB;
  --radius: 12px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; }

/* 壳：移动端优先，宽屏内容居中不拉伸 */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-main {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  flex: 1;
}

/* 通用卡片与排版 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(29, 33, 41, 0.04);
}
.section-gap { margin-top: 16px; }
.page-title { font-size: 20px; font-weight: 600; }
.page-sub { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 16px; font-weight: 600; }
.section-head a { font-size: 12px; color: var(--text-muted); }

/* 按钮 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 44px;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-outline { background: var(--card); color: var(--text); border: 1px solid var(--border); }

/* 标签 */
.tag-hot {
  display: inline-block;
  background: rgba(255, 125, 0, 0.1);
  color: var(--orange);
  font-size: 11px; font-weight: 500;
  padding: 1px 6px; border-radius: 4px;
}

/* 首页 Hero */
.hero {
  background: var(--primary);
  color: #fff;
  padding: 24px 16px 48px;
}
.hero h1 { font-size: 24px; font-weight: 600; }
.hero p { margin-top: 8px; font-size: 13px; opacity: 0.8; }
.hero-overlap { margin-top: -32px; }

/* 引导卡 */
.guide-card .guide-title { font-size: 14px; font-weight: 600; }
.guide-card .guide-desc { margin-top: 4px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.guide-card .btn { margin-top: 12px; }

/* 分类网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.cat-icon, .tool-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cat-icon svg { width: 20px; height: 20px; }
.cat-icon { background: rgba(22, 93, 255, 0.1); color: var(--primary); }
.cat-name { margin-top: 12px; font-size: 14px; font-weight: 600; }
.cat-desc {
  margin-top: 4px; font-size: 12px; color: var(--text-muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-icon { background: rgba(15, 198, 194, 0.1); color: var(--teal); }
.tool-icon svg { width: 20px; height: 20px; }
.tool-cell { text-align: center; }
.tool-cell .tool-icon { margin: 0 auto; width: 40px; height: 40px; }
.tool-name { margin-top: 8px; font-size: 12px; font-weight: 500; }
.tool-desc { margin-top: 2px; font-size: 10px; color: var(--text-muted); line-height: 1.4; }

/* 服务卡片 */
.service-card { display: block; }
.service-card .card-top { display: flex; align-items: flex-start; gap: 8px; }
.service-card h3 { flex: 1; font-size: 16px; font-weight: 600; }
.service-card .summary {
  margin-top: 6px; font-size: 13px; color: var(--text-muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.service-card .card-foot {
  margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.service-card .price { font-size: 16px; font-weight: 600; color: var(--orange); }
.service-card .duration { font-size: 12px; color: var(--text-muted); }
.hot-row { display: flex; align-items: center; gap: 6px; }
.hot-row p { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-meta { margin-top: 6px; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.hot-item { display: flex; align-items: center; gap: 12px; }
.hot-item .hot-main { flex: 1; min-width: 0; }
.hot-item .hot-right { text-align: right; flex-shrink: 0; }
.hot-item .hot-right .price { font-size: 14px; font-weight: 600; color: var(--orange); }

/* 服务列表分类筛选 */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 4px; }
.cat-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.cat-tab.active {
  background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 500;
}

/* 服务详情 */
.detail-top { display: flex; align-items: flex-start; gap: 8px; }
.detail-top h2 { flex: 1; font-size: 18px; font-weight: 600; }
.tag-key {
  display: inline-block; background: rgba(255,125,0,0.1); color: var(--orange);
  font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px;
}
.detail-cat { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.detail-summary { margin-top: 8px; font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.detail-meta {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.detail-meta .price { font-size: 18px; font-weight: 600; color: var(--orange); }
.detail-meta .duration { font-size: 12px; color: var(--text-muted); }
.block-title { font-size: 14px; font-weight: 600; }
.highlight-list li { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.highlight-list li:first-child { margin-top: 0; }
.highlight-list .check { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.highlight-list svg { width: 16px; height: 16px; }
.highlight-list span { font-size: 14px; line-height: 1.5; }
.case-item { background: var(--bg); border-radius: 8px; padding: 12px; }
.case-head { display: flex; align-items: center; gap: 8px; }
.case-no {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px;
  background: rgba(22,93,255,0.1); color: var(--primary);
  border-radius: 4px; font-size: 12px; font-weight: 600;
}
.case-head h4 { font-size: 14px; font-weight: 500; }
.case-item p { margin-top: 6px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.detail-bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto; padding: 16px;
  z-index: 20;
}

/* 返回按钮 */
.back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; background: transparent;
  color: var(--text); cursor: pointer; border-radius: 8px;
}
.back-btn svg { width: 20px; height: 20px; }
.back-row { display: flex; align-items: center; gap: 8px; }
.back-row h1 { flex: 1; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 表单 */
.form-card { display: flex; flex-direction: column; gap: 16px; }
.form-item label { display: block; font-size: 14px; font-weight: 500; }
.form-item .req { color: #F53F3F; }
.form-item input[type="text"],
.form-item input[type="tel"],
.form-item input[type="date"],
.form-item select,
.form-item textarea {
  margin-top: 8px; width: 100%; min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--card);
}
.form-item textarea { min-height: 84px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-error { margin-top: 6px; font-size: 12px; color: #F53F3F; }
.form-alert {
  margin-top: 16px; padding: 12px;
  border: 1px solid rgba(245, 63, 63, 0.3); background: rgba(245, 63, 63, 0.06);
  border-radius: var(--radius);
  font-size: 13px; color: #F53F3F;
}
.period-group { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.period-option {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  font-size: 14px; cursor: pointer;
}
.period-option input { accent-color: var(--primary); }
.form-tip { margin-top: 12px; text-align: center; font-size: 12px; color: var(--text-muted); }
.field-hint { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

/* 成功页 */
.success-card { text-align: center; padding: 24px 16px; }
.success-icon { color: var(--teal); margin-bottom: 16px; }
.success-icon svg { width: 64px; height: 64px; }
.success-card h2 { font-size: 18px; font-weight: 600; }
.success-card p { margin-top: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.success-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }

/* 查询页 */
.search-row { margin-top: 8px; display: flex; gap: 8px; }
.search-row input {
  flex: 1; min-width: 0; min-height: 44px;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
.search-row input:focus { outline: none; border-color: var(--primary); }
.search-wrap { position: relative; flex: 1; display: flex; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-icon svg { width: 16px; height: 16px; display: block; }
.search-row .btn { width: auto; padding: 0 20px; flex-shrink: 0; }
.result-count { margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.empty-card { text-align: center; padding: 24px 16px; }
.empty-card p strong { font-size: 14px; font-weight: 500; }
.empty-card .sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.empty-card .btn { margin-top: 16px; }
.status-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.status-submitted { background: rgba(22,93,255,0.1); color: var(--primary); }
.status-in_progress { background: rgba(255,125,0,0.1); color: var(--orange); }
.status-completed { background: rgba(15,198,194,0.1); color: #0AA5A1; }
.booking-card .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.booking-card h3 { font-size: 16px; font-weight: 600; }
.booking-info { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-muted); }
.booking-info .row { display: flex; align-items: center; gap: 8px; }
.booking-info .row strong { color: var(--text); font-weight: 400; }
.booking-info svg { width: 16px; height: 16px; flex-shrink: 0; }
.progress-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.timeline { margin-top: 12px; }
.timeline li { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.tl-dot-wrap { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(22,93,255,0.4); margin-top: 6px; flex-shrink: 0;
}
.timeline li:last-child .tl-dot { background: var(--primary); }
.tl-line { width: 1px; flex: 1; background: var(--border); margin-top: 4px; }
.tl-stage { font-size: 14px; font-weight: 500; }
.tl-desc { margin-top: 4px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.tl-time { margin-top: 4px; font-size: 12px; color: var(--text-muted); opacity: 0.8; }

/* 工具页 */
.tool-card .tool-toggle {
  display: flex; align-items: center; gap: 12px;
  width: 100%; background: transparent; border: none; text-align: left; cursor: pointer;
  padding: 0;
}
.tool-toggle .tool-icon { width: 36px; height: 36px; }
.tool-toggle .tt-main { flex: 1; min-width: 0; }
.tool-toggle .tt-title { display: block; font-size: 14px; font-weight: 600; }
.tool-toggle .tt-desc { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.tool-toggle .chevron { color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s; }
.tool-toggle .chevron svg { width: 16px; height: 16px; display: block; }
.tool-card.open .chevron { transform: rotate(180deg); }
.tool-panel { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.tool-panel[hidden] { display: none; }
.tool-panel .form-item { margin-bottom: 12px; }
.tool-result {
  margin-top: 12px; padding: 12px; border-radius: 8px;
  background: rgba(15, 198, 194, 0.08); font-size: 13px; line-height: 1.7;
}
.tool-result.err { background: rgba(245,63,63,0.06); color: #F53F3F; }
.tool-note { margin-top: 16px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.check-list { margin-top: 8px; }
.check-list li { font-size: 13px; margin-top: 6px; display: flex; align-items: flex-start; gap: 6px; }
.check-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); margin-top: 7px; flex-shrink: 0; }
.check-list li.bad::before { background: #F53F3F; }

/* 空态/提示 */
.notice-card { text-align: center; padding: 24px 16px; }
.notice-card p { font-size: 14px; font-weight: 600; }
.notice-card .sub { margin-top: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.notice-card .btn { margin-top: 16px; }

/* 底部 TabBar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.tabbar-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px;
  font-size: 10px;
  color: var(--text-muted);
}
.tabbar-item svg { width: 22px; height: 22px; }
.tabbar-item.active { color: var(--primary); font-weight: 500; }
