/* src/v073.css — V1.0 full redesign styles
   Covers: 3-col dashboard, heatmap, ring progress, card status icons,
   topbar overflow menu, collapsible MS rail, canvas tools, exam mode,
   free-mode banner, badge system, onboarding wizard, tooltips, celebration,
   lazy loading, dark mode hook. */

/* ===== Dashboard 3-column layout ===== */
.v073-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.v073-dash-col { display: grid; gap: 12px; }
.v073-dash-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.v073-dash-card h4 { margin: 0 0 10px; font-size: 12px; color: #475569; text-transform: uppercase; letter-spacing: .5px; }
.v073-countdown { text-align: center; }
.v073-countdown .big { font-size: 32px; font-weight: 900; background: linear-gradient(135deg,#4F46E5,#7C3AED); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.v073-countdown .label { font-size: 11px; color: #64748b; }

/* ===== Heatmap (7-day streak) ===== */
.v073-heatmap { display: flex; gap: 5px; justify-content: center; margin: 8px 0; }
.v073-heat-cell {
  width: 28px; height: 28px; border-radius: 6px;
  background: #f1f5f9; display: grid; place-items: center;
  font-size: 9px; color: #94a3b8; font-weight: 700;
}
.v073-heat-cell.done { background: linear-gradient(135deg,#4F46E5,#7C3AED); color: #fff; }
.v073-heat-cell.today { border: 2px solid #4F46E5; }

/* ===== Ring progress ===== */
.v073-ring-row { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 8px; }
.v073-ring { text-align: center; }
.v073-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.v073-ring circle { fill: none; stroke-width: 5; }
.v073-ring .bg { stroke: #e2e8f0; }
.v073-ring .fg { stroke: url(#v073Grad); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.v073-ring span { display: block; font-size: 10px; color: #64748b; margin-top: 2px; }
.v073-ring b { display: block; font-size: 11px; margin-top: -18px; position: relative; z-index: 1; }

/* ===== Practice card status icons ===== */
.v073-q-icon { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; margin-right: 6px; }
.v073-q-icon.correct { background: #dcfce7; color: #16a34a; }
.v073-q-icon.wrong { background: #fee2e2; color: #dc2626; }
.v073-q-icon.partial { background: #fef3c7; color: #d97706; }
.v073-q-icon.unsure { background: #f1f5f9; color: #64748b; }
.v073-q-accuracy { font-size: 10px; color: #64748b; margin-left: 8px; }

/* ===== Topbar overflow menu ===== */
.v073-overflow-menu {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; z-index: 200;
  display: none; min-width: 160px;
}
.v073-overflow-menu.show { display: block; }
.v073-overflow-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; padding: 8px 10px; border-radius: 6px;
  font-size: 12px; cursor: pointer; text-align: left; color: #334155;
}
.v073-overflow-menu button:hover { background: #f1f5f9; }

/* ===== Collapsible MS rail ===== */
.v073-ms-rail {
  width: 48px; background: linear-gradient(180deg,#4F46E5,#7C3AED);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; text-orientation: mixed; font-size: 11px; font-weight: 700;
  letter-spacing: 2px; border-radius: 8px 0 0 8px; transition: width .25s;
  flex-shrink: 0;
}
.v073-ms-rail:hover { width: 56px; }
.v073-ms-expanded { width: auto !important; writing-mode: horizontal-tb; }

/* ===== Canvas tools =====
   2026-09-27 移除。这里原本是 `.v073-toolbar / .v073-tool-btn / .v073-color-dot`，
   配套 `src/canvas-enhance.mjs` 注入的那条手写工具栏。那条工具栏是练习区
   *第二条* 工具条：它的按钮只改自己的样式、从不调用 `setInkTool()`，点了不换笔。
   老师和学生都能看见两条工具条叠着。模块连同这份 CSS 一起删掉，避免下一个人
   看到类名又把工具栏拼回来。练习区保留的是 `#inkMethod > .inkToolbar`。 */

/* ===== Exam mode ===== */
.v073-exam-overlay {
  position: fixed; inset: 0; background: #0f172a; z-index: 500;
  display: none; flex-direction: column;
}
.v073-exam-overlay.active { display: flex; }
.v073-exam-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; background: #1e293b; color: #fff;
}
.v073-exam-timer { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.v073-exam-timer.warning { color: #fbbf24; }
.v073-exam-timer.danger { color: #ef4444; animation: v073pulse 1s infinite; }
@keyframes v073pulse { 50% { opacity: .5; } }
.v073-exam-body { flex: 1; overflow: auto; padding: 16px; background: #fff; }
.v073-exam-report { max-width: 700px; margin: 40px auto; background: #fff; border-radius: 16px; padding: 28px; }
.v073-exam-report h2 { text-align: center; }
.v073-score-circle {
  width: 120px; height: 120px; border-radius: 50%; margin: 20px auto;
  display: grid; place-items: center; font-size: 28px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg,#4F46E5,#7C3AED);
}

/* ===== Free mode banner ===== */
.v073-free-banner {
  background: linear-gradient(90deg,#fef3c7,#fde68a); color: #92400e;
  padding: 6px 16px; font-size: 11px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.v073-free-banner button { background: none; border: 0; color: #92400e; cursor: pointer; font-weight: 800; text-decoration: underline; }

/* ===== Badge system ===== */
.v073-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.v073-badge {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-size: 20px; background: #f1f5f9; border: 2px solid #e2e8f0; position: relative;
}
.v073-badge.unlocked { background: linear-gradient(135deg,#fef3c7,#fde68a); border-color: #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,.3); }
.v073-badge .v073-badge-tip {
  display: none; position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 10px; white-space: nowrap; z-index: 10;
}
.v073-badge:hover .v073-badge-tip { display: block; }
.v073-badge-unlock-toast {
  position: fixed; top: 20px; right: 20px; background: linear-gradient(135deg,#fef3c7,#fde68a);
  border: 2px solid #f59e0b; border-radius: 12px; padding: 14px 18px; z-index: 9999;
  box-shadow: 0 8px 30px rgba(0,0,0,.15); animation: v073slideIn .4s ease;
}
@keyframes v073slideIn { from { transform: translateX(120%); } to { transform: none; } }

/* ===== Onboarding wizard ===== */
.v073-wizard-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.85); z-index: 9000;
  display: none; place-items: center;
}
.v073-wizard-overlay.show { display: grid; }
.v073-wizard-card {
  background: #fff; border-radius: 20px; padding: 32px; width: min(480px, 90vw);
  text-align: center;
}
.v073-wizard-card h2 { margin: 0 0 8px; }
.v073-wizard-steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.v073-wizard-dot { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; }
.v073-wizard-dot.active { background: #4F46E5; width: 24px; border-radius: 4px; }
.v073-wizard-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(100px,1fr)); gap: 8px; margin: 16px 0; }
.v073-wizard-opt {
  border: 2px solid #e2e8f0; border-radius: 10px; padding: 12px 8px; cursor: pointer;
  font-size: 12px; transition: all .15s; background: #fff;
}
.v073-wizard-opt:hover { border-color: #4F46E5; }
.v073-wizard-opt.selected { border-color: #4F46E5; background: #eef2ff; }

/* ===== Tooltip guide bubbles ===== */
.v073-guide-bubble {
  position: fixed; z-index: 8000; background: #4F46E5; color: #fff;
  padding: 10px 14px; border-radius: 10px; font-size: 12px; max-width: 220px;
  box-shadow: 0 8px 24px rgba(79,70,229,.4); animation: v073bounce .6s ease;
}
@keyframes v073bounce { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
.v073-guide-bubble::after {
  content: ''; position: absolute; border: 8px solid transparent;
}
.v073-guide-bubble.bottom::after { border-top-color: #4F46E5; top: 100%; left: 20px; }
.v073-guide-bubble.top::after { border-bottom-color: #4F46E5; bottom: 100%; left: 20px; }

/* ===== Celebration animation ===== */
.v073-celebrate {
  position: fixed; inset: 0; pointer-events: none; z-index: 9500; overflow: hidden;
}
.v073-confetti {
  position: absolute; width: 10px; height: 10px; top: -20px;
  animation: v073fall linear forwards;
}
@keyframes v073fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
.v073-celebrate-msg {
  position: fixed; top: 40%; left: 50%; transform: translate(-50%,-50%);
  background: #fff; border-radius: 16px; padding: 24px 36px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2); z-index: 9501; animation: v073pop .5s ease;
}
@keyframes v073pop { 0% { transform: translate(-50%,-50%) scale(0); } 70% { transform: translate(-50%,-50%) scale(1.1); } 100% { transform: translate(-50%,-50%) scale(1); } }

/* ===== Lazy loading ===== */
.v073-lazy-img { opacity: 0; transition: opacity .3s; }
.v073-lazy-img.loaded { opacity: 1; }

/* ===== Papers card status ===== */
.v073-paper-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.v073-paper-status.done { background: #dcfce7; color: #16a34a; }
.v073-paper-status.partial { background: #fef3c7; color: #d97706; }
.v073-paper-status.new { background: #f1f5f9; color: #64748b; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .v073-dash-grid { grid-template-columns: 1fr; }
  .v073-ms-rail { width: 36px; font-size: 9px; }
}
