/*
 * Bear Growth 面板的样式。和 Submind、Next Stock 同一套设计语言(sites/subdots-web/src/app.css):
 * 顶部一层很淡的强调色渐变、圆角 20 的卡片配发丝阴影、系统字体、跟随系统的深色。
 * 颜色全是下面的变量,深色只重定义变量。
 */

:root {
  --bg: #F2F3F7;
  --surface: #FFFFFF;
  --fill: rgba(17, 24, 39, 0.05);
  --line: rgba(17, 24, 39, 0.08);
  --text: #111318;
  --text-2: #5C6270;
  --accent: #1F66E0;
  --accent-soft: rgba(31, 102, 224, 0.14);
  --accent-grad: linear-gradient(90deg, #1F66E0, #3172E2);
  --organic: rgba(31, 102, 224, 0.28);
  --active: #E2711D;
  --danger: #B42318;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
  --wash: linear-gradient(180deg, rgba(31, 102, 224, 0.12) 0, rgba(31, 102, 224, 0) 360px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --surface: #131B2B;
    --fill: rgba(255, 255, 255, 0.06);
    --line: rgba(255, 255, 255, 0.09);
    --text: #EEF1F6;
    --text-2: #9AA3B2;
    --accent: #5B92F0;
    --accent-soft: rgba(91, 146, 240, 0.22);
    --organic: rgba(91, 146, 240, 0.32);
    --active: #F0A050;
    --danger: #FF8A80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --wash: linear-gradient(180deg, rgba(91, 146, 240, 0.14) 0, rgba(91, 146, 240, 0) 360px);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--wash), var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  min-height: 100vh;
}
h1, h2 { margin: 0; }
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.error { color: var(--danger); margin: 0; }

.card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.button.primary { background: var(--accent-grad); color: #fff; }
.button.primary:disabled { opacity: 0.6; cursor: default; }
.button.quiet { background: var(--fill); color: var(--text); }

/* 登录 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; }
.login-card h1 { margin-top: 6px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.field input {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--fill); border: 0; border-radius: 12px; padding: 12px 14px;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 外框 */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; }
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px; max-width: 1200px; margin: 0 auto;
}
.picker { font: inherit; background: var(--fill); color: var(--text); border: 0; border-radius: 10px; padding: 8px 10px; }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.email { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.main { max-width: 1200px; margin: 0 auto; padding: 8px 24px 48px; display: grid; gap: 16px; }
.main > section { display: grid; gap: 16px; }
.page-title { margin-bottom: 2px; }
.loading { color: var(--text-2); }
.empty { display: grid; gap: 8px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.app-card { text-align: left; font: inherit; color: inherit; cursor: pointer; display: grid; gap: 4px; }
.app-card:hover { border-color: var(--accent); }

/* 总览 */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--fill); border-radius: 999px; padding: 3px; }
.segmented button {
  appearance: none; border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 4px; padding: 16px 18px; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 24px; letter-spacing: -0.01em; overflow-wrap: anywhere; }

.chart-card { display: grid; gap: 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.key.organic::before { background: var(--organic); }
.key.paid::before { background: var(--accent); }
.key.active::before { background: var(--active); height: 3px; vertical-align: 3px; }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); }
.chart-tick { fill: var(--text-2); font-size: 11px; }
.chart-organic { fill: var(--organic); }
.chart-paid { fill: var(--accent); }
.chart-active { fill: none; stroke: var(--active); stroke-width: 2; stroke-linejoin: round; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.table-card { display: grid; gap: 10px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.heat {
  display: inline-block; min-width: 46px; padding: 2px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) calc(var(--heat, 0) * 45%), transparent);
}
.footnote { margin: 0; }
.connect { display: grid; gap: 8px; }
.connect ul { margin: 0; padding-left: 18px; }
.mcp-url { background: var(--fill); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; font-size: 13px; }

@media (max-width: 640px) {
  .top, .main { padding-left: 16px; padding-right: 16px; }
  .stat-value { font-size: 20px; }
}
