/* 麦朵尔 MindDuo GEO 进展看板 · 微信端极简专属样式表 */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --light-muted: #94a3b8;
  --border: #e2e8f0;
  
  /* Brand Tokens */
  --green: #16a36a;
  --green-light: #ecfdf5;
  --green-border: #a7f3d0;
  
  --orange: #e58a2a;
  --orange-light: #fffbeb;
  --orange-border: #fde68a;
  
  --purple: #8b65d7;
  --purple-light: #f5f3ff;
  --purple-border: #ddd6fe;
  
  --blue: #3d6ee8;
  --blue-light: #eff6ff;
  --blue-border: #bfdbfe;
  
  --radius: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 14px 20px 14px;
}

/* Top App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 14px 2px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge .logo-dot {
  width: 10px;
  height: 10px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(22, 163, 106, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 106, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 106, 0); }
}

.brand-titles h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.brand-titles p {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

.share-btn-top {
  background: white;
  border: 1px solid var(--border);
  color: var(--green);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}

.share-btn-top:active {
  transform: scale(0.95);
  background: #f8fafc;
}

/* Period Capsule Selector */
.period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(226, 232, 240, 0.6);
  padding: 3px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.period-info {
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

.period-pills {
  display: flex;
  gap: 2px;
}

.pill-btn {
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill-btn.active {
  background: #ffffff;
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Common Card Style */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.card-title-group h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.card-title-group p {
  font-size: 10px;
  color: var(--muted);
}

.card-tag {
  font-size: 10px;
  background: #f1f5f9;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}

/* 2x2 Core Brand KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-item {
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.kpi-item.mdl {
  background: var(--green-light);
  border: 1px solid var(--green-border);
}
.kpi-item.md {
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
}
.kpi-item.cross {
  background: var(--purple-light);
  border: 1px solid var(--purple-border);
}
.kpi-item.benq {
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
}

.kpi-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.kpi-name {
  font-size: 11px;
  font-weight: 600;
}
.kpi-item.mdl .kpi-name { color: #065f46; }
.kpi-item.md .kpi-name { color: #92400e; }
.kpi-item.cross .kpi-name { color: #5b21b6; }
.kpi-item.benq .kpi-name { color: #1e40af; }

.kpi-diff {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.kpi-item.mdl .kpi-diff { background: #d1fae5; color: var(--green); }
.kpi-item.md .kpi-diff { background: #fef3c7; color: var(--orange); }
.kpi-item.cross .kpi-diff { background: #ede9fe; color: var(--purple); }
.kpi-item.benq .kpi-diff { background: #dbeafe; color: var(--blue); }

.kpi-val {
  font-size: 22px;
  font-weight: 800;
  margin: 4px 0 2px 0;
  letter-spacing: -0.5px;
}
.kpi-item.mdl .kpi-val { color: #047857; }
.kpi-item.md .kpi-val { color: #b45309; }
.kpi-item.cross .kpi-val { color: #6d28d9; }
.kpi-item.benq .kpi-val { color: #1d4ed8; }

.kpi-sub {
  font-size: 9.5px;
  color: var(--muted);
}

/* Sparkline Trend Chart */
.chart-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px 8px 6px 8px;
  position: relative;
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  padding: 0 4px;
}

.legend-items {
  display: flex;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.sparkline-svg {
  width: 100%;
  height: 80px;
  display: block;
}

.chart-dates {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--light-muted);
  margin-top: 4px;
  padding: 0 4px;
}

/* Competitor Bars */
.comp-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.comp-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comp-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.comp-brand-name {
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.comp-brand-name.is-self {
  font-weight: 700;
  color: var(--green);
}

.self-tag {
  font-size: 9px;
  background: var(--green-light);
  color: var(--green);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--green-border);
}

.comp-brand-val {
  font-weight: 700;
  color: var(--ink);
}

.comp-brand-val.is-self {
  color: var(--green);
  font-size: 13px;
}

.bar-track {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill.self {
  background: linear-gradient(90deg, #10b981, #059669);
}

.bar-fill.comp-1 { background: #f59e0b; }
.bar-fill.comp-2 { background: #ef4444; }
.bar-fill.comp-3 { background: #06b6d4; }
.bar-fill.comp-other { background: #94a3b8; }

.comp-foot-note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 10.5px;
  color: var(--green);
  font-weight: 600;
  text-align: center;
}

/* Action Area */
.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.btn-primary {
  width: 100%;
  background: var(--green);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 163, 106, 0.25);
  transition: all 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
  background: #15803d;
}

.pc-link {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px;
}

.pc-link:active {
  color: var(--ink);
}

/* Poster Modal */
.poster-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.poster-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.poster-dialog {
  background: white;
  width: 100%;
  max-width: 320px;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.poster-modal.active .poster-dialog {
  transform: scale(1);
}

.poster-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.poster-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}

.poster-img-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background: #0f172a;
}

.poster-img-container img {
  width: 100%;
  display: block;
}

.poster-tip {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
