/* ──────────────────────────────────────────
   AM7P 清爽现代风格设计系统
   统一覆盖：产品首页 + 微信H5数据/绑定/管理页
   ────────────────────────────────────────── */

:root {
  /* 色彩系统 */
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --bg-elevated: #ffffff;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --primary: #059669;
  --primary-soft: #ecfdf5;
  --primary-light: #d1fae5;
  --primary-dark: #047857;

  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --blue: #3b82f6;
  --blue-soft: #eff6ff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);

  /* 尺寸 */
  --max-w: 1140px;
  --gap: 20px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.container-sm {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ── 通用卡片 ── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-flat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all .2s ease;
  line-height: 1.4;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--border); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-muted); }

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
}
.btn-danger:hover { background: #fee2e2; }

.btn-small { padding: 6px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-large { padding: 14px 28px; font-size: 15px; border-radius: var(--r-xl); }

/* ── 表单 ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.form-group input::placeholder { color: var(--text-muted); }

/* ── 提示消息 ── */
.msg {
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-top: 10px;
}
.msg-success { background: var(--primary-soft); color: var(--primary-dark); }
.msg-error   { background: var(--red-soft);   color: #b91c1c; }
.msg-warn    { background: var(--amber-soft); color: #b45309; }
.msg-info    { background: var(--blue-soft);  color: #1d4ed8; }

/* ── 指标大数字 ── */
.metric {
  text-align: center;
  padding: 20px 8px;
}
.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.metric-value.sub { color: var(--text-secondary); font-size: 28px; }
.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ── 设备列表 ── */
.device-list { list-style: none; }
.device-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.device-list li:last-child { border-bottom: none; }
.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.device-item:last-child { border-bottom: none; }
.device-item .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.device-item .actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── 标签 ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}
.tag-green { background: var(--primary-soft); color: var(--primary-dark); }
.tag-amber { background: var(--amber-soft); color: #b45309; }
.tag-red   { background: var(--red-soft);   color: #b91c1c; }
.tag-blue  { background: var(--blue-soft);  color: #1d4ed8; }
.tag-gray  { background: var(--bg-muted);   color: var(--text-secondary); }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border-light); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg);
}
.table th {
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-soft); }

/* ── 步骤 ── */
.steps { display: flex; gap: 12px; }
.step {
  flex: 1;
  text-align: center;
  padding: 20px 12px;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 32px;
  width: 12px;
  height: 2px;
  background: var(--border);
}
.step-num {
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  margin: 0 auto 10px;
}
.step h5 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.step p  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── 页头页脚 ── */
.page-header {
  text-align: center;
  padding: 28px 0 12px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.page-header .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-footer {
  text-align: center;
  padding: 20px 0 32px;
  font-size: 12px;
  color: var(--text-muted);
}
.page-footer a { color: var(--text-muted); }
.page-footer a:hover { color: var(--primary); }

/* ── 状态 ── */
.loading { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.error-box {
  padding: 12px 16px;
  background: var(--red-soft);
  color: #b91c1c;
  border-radius: var(--r-md);
  font-size: 13px;
}
.hidden { display: none !important; }

/* ── 导航条（产品页） ── */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.nav-brand .dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color .2s;
}
.nav-links a:hover { color: var(--primary); }

/* ── 区块标题 ── */
.sec-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.sec-headline {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.sec-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  :root { --gap: 16px; }
  .steps { flex-direction: column; }
  .step:not(:last-child)::after {
    content: '';
    right: 50%; top: 100%; width: 2px; height: 12px;
    transform: translateX(50%);
  }
  .nav-links { display: none; }
  .sec-headline { font-size: 22px; }
}

/* ── 滚动条美化 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
