/* ============================================================
   apps/bee-loop.html 样式（P0-4-T17 <style> 块外联）
   - 页面 style="..." 与 on* 仍在本页（P0-4-T18 整改）
   ============================================================ */

/* Design Token：项目级 Glassmorphism 规范（与 topbar.8d4aa38f.css 一致） */
:root {
  --glass-bg-light:           rgba(255, 255, 255, 0.55);
  --glass-border-light:        rgba(15, 23, 42, 0.06);
  --glass-highlight-light:     rgba(255, 255, 255, 0.6);
  --glass-shadow-light:        rgba(15, 23, 42, 0.06);
  --glass-bg-dark:             rgba(10, 14, 39, 0.72);
  --glass-border-dark:         rgba(255, 255, 255, 0.06);
  --glass-highlight-dark:      rgba(255, 255, 255, 0.08);
  --glass-shadow-dark:         rgba(0, 0, 0, 0.32);
  --glass-blur:                blur(20px) saturate(180%);
}

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    background:
      radial-gradient(ellipse 80% 60% at 50% 0%,  rgba(59,130,246,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 50% 40% at 100% 100%, rgba(96,165,250,0.06) 0%, transparent 60%),
      var(--bg-page);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  a { color: inherit; text-decoration: none; }
  :root {
    --bg-page: #fafbfc; --bg-card: #ffffff; --bg-soft: #eff6ff; --bg-header: #ffffff;
    --text-primary: #1f2937; --text-secondary: #4b5563; --text-muted: #6b7280; --text-hint: #9ca3af;
    --text-on-accent: #ffffff; --border: #e5e7eb; --border-soft: #f1f5f9;
    --accent: #3b82f6; --accent-hover: #2563eb; --accent-soft: #60a5fa; --accent-fade: rgba(59,130,246,0.10);
    --success: #10b981; --warning: #f59e0b; --danger: #ef4444;
  }
  /* 原顶栏「游戏 / 个人战绩」入口下移（顶栏已换共享组件，登录态由顶栏接管） */
  .entry-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .back-link { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); }
  .back-link:hover { color: var(--accent); }
  .stats-link-btn { font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); padding: 8px 18px; border: 1px solid var(--border); background: transparent; cursor: pointer; font-family: inherit; }
  .stats-link-btn:hover { background: var(--accent-fade); border-color: var(--accent); }

  main { flex: 1; padding: 32px 40px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }
  .head { text-align: center; margin-bottom: 20px; }
  .head .eyebrow { font-size: 10px; letter-spacing: 0.4em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
  .head h1 { font-size: 30px; font-weight: 200; letter-spacing: 0.04em; color: var(--text-primary); line-height: 1.1; }
  .head .h1-en { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; letter-spacing: 0.3em; color: var(--text-muted); text-transform: uppercase; }
  .head .sub { margin-top: 8px; font-size: 12px; color: var(--text-muted); line-height: 1.7; }

  .diff-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
  .diff-btn { padding: 9px 22px; font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); cursor: pointer; transition: all 0.18s ease; font-family: inherit; }
  .diff-btn:hover { border-color: var(--accent); color: var(--accent); }
  .diff-btn.active { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }

  .stats-bar { display: flex; justify-content: center; gap: 36px; margin-bottom: 16px; }
  .stat-cell { text-align: center; }
  .stat-cell .label { font-size: 10px; letter-spacing: 0.3em; color: var(--text-muted); text-transform: uppercase; }
  .stat-cell .value { font-size: 26px; font-weight: 300; color: var(--text-primary); font-variant-numeric: tabular-nums; margin-top: 2px; }

  .stage { display: flex; justify-content: center; align-items: center; padding: 20px; background: var(--bg-card); border: 1px solid var(--border-soft); }
  .stage svg { display: block; max-width: 100%; height: auto; }
  .stage svg .hex-cell { fill: var(--bg-soft); stroke: var(--border); stroke-width: 1; }
  .stage svg .clue { font-size: 16px; font-weight: 700; fill: var(--text-primary); text-anchor: middle; dominant-baseline: central; font-family: inherit; }
  .stage svg .clue.satisfied { fill: var(--success); }
  .stage svg .clue.broken   { fill: var(--danger); }
  .stage svg .edge { stroke: #cbd5e1; stroke-width: 4; stroke-linecap: round; cursor: pointer; transition: stroke 0.12s ease, stroke-width 0.12s ease; }
  .stage svg .edge:hover { stroke: var(--accent-soft); stroke-width: 6; }
  .stage svg .edge.on { stroke: var(--accent); stroke-width: 6; }
  .stage svg .edge.on:hover { stroke: var(--accent-hover); }
  .stage svg .vertex { fill: var(--text-muted); }

  .actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
  .act-btn { padding: 10px 22px; font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: all 0.18s ease; font-family: inherit; }
  .act-btn:hover { border-color: var(--accent); color: var(--accent); }
  .act-btn.primary { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
  .act-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--text-on-accent); }
  .act-btn:disabled { opacity: 0.4; cursor: not-allowed; }

  .rules { max-width: 720px; margin: 28px auto 0; background: var(--bg-card); border: 1px solid var(--border-soft); }
  .rules summary { padding: 12px 18px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-secondary); cursor: pointer; }
  .rules summary:hover { color: var(--accent); }
  .rules .body { padding: 0 18px 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
  .rules .body ol { padding-left: 22px; }

  /* 通关弹窗 */
  .modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: none; align-items: center; justify-content: center; z-index: 100; }
  .modal-mask.show { display: flex; }
  .modal { background: var(--bg-card); border: 1px solid var(--border-soft); padding: 32px 36px; max-width: 420px; width: calc(100% - 40px); box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18); }
  .modal h2 { font-size: 20px; font-weight: 500; color: var(--text-primary); letter-spacing: 0.04em; text-align: center; margin-bottom: 4px; }
  .modal .sub { text-align: center; font-size: 11px; color: var(--text-muted); letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 24px; }
  .modal .result-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin-bottom: 20px; }
  .modal .result-list .item .k { font-size: 10px; letter-spacing: 0.3em; color: var(--text-muted); text-transform: uppercase; }
  .modal .result-list .item .v { font-size: 22px; font-weight: 300; color: var(--text-primary); margin-top: 2px; font-variant-numeric: tabular-nums; }
  .modal .result-list .item .v.best { color: var(--success); }
  .modal .hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 18px; line-height: 1.7; }
  .modal .hint.warn { color: var(--warning); }
  .modal .actions { margin-top: 0; }
  .modal .actions .act-btn { flex: 1; }

  /* Toast 提示 */
  .toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px); padding: 10px 18px; background: var(--text-primary); color: #fff; font-size: 13px; letter-spacing: 0.04em; opacity: 0; transition: all 0.22s ease; pointer-events: none; z-index: 200; }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .toast.error { background: var(--danger); }
  .toast.success { background: var(--success); }
  .toast.warn { background: var(--warning); }

  /* —— 一笔画互导 banner —— */
  .cross-link-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    margin: 16px auto 0;
    max-width: 720px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(56, 189, 248, 0.05));
    border: 1px dashed var(--warning, #f59e0b);
    border-radius: 8px;
    color: var(--text-secondary, #4b5563);
    font-size: 12px;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
  }
  .cross-link-banner:hover { border-color: var(--warning, #f59e0b); color: var(--text-primary, #1f2937); }
  .cross-link-banner .cl-ico { font-size: 16px; color: var(--warning, #f59e0b); }
  .cross-link-banner .cl-strong { color: var(--warning, #f59e0b); font-weight: 700; border-bottom: 1px solid var(--warning, #f59e0b); padding-bottom: 1px; }
  .cross-link-banner .cl-text { flex: 1; line-height: 1.5; }
  .cross-link-banner .cl-arrow { font-size: 14px; color: var(--warning, #f59e0b); }

  @media (max-width: 720px) {
    main { padding: 20px 16px 40px; }
    .head h1 { font-size: 24px; }
    .stats-bar { gap: 24px; }
    .stat-cell .value { font-size: 22px; }
    .stage { padding: 12px; }
    .actions { gap: 6px; }
    .act-btn { padding: 9px 14px; font-size: 11px; }
  }
