/* components.css - 组件样式：按钮、色板、进度、教学面板、弹窗、提示 */

/* ---------- 教学面板 ---------- */
.tutor-head .tutor-current {
  font-size: 18px;
  font-weight: 700;
  color: #1c2333;
  line-height: 1.5;
  min-height: 54px;
  margin: 8px 0 4px;
}

.tutor-head .tutor-sub {
  font-size: 13px;
  color: #6b7694;
  font-family: Consolas, monospace;
}

.tutor-list-wrap {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.tutor-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tutor-list li {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #3a4568;
  cursor: pointer;
  margin-bottom: 2px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.tutor-list li::before {
  content: counter(list-item);
  counter-increment: list-item;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e3e9f6;
  color: #516090;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.tutor-list {
  counter-reset: list-item;
}

.tutor-list li.done {
  color: #98a3c0;
  text-decoration: line-through;
}

.tutor-list li.done::before {
  background: #d3daea;
}

.tutor-list li.active {
  background: #e8f1ff;
  color: #1c2333;
  font-weight: 600;
}

.tutor-list li.active::before {
  background: #2f7bf6;
  color: #fff;
}

/* ---------- 拖歪后出现的"还原视角"浮动按钮 ---------- */
.reset-view-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 6;
  background: rgba(21, 27, 41, 0.88);
  color: #dce4f7;
  border-color: #465580;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.reset-view-btn:hover:not(:disabled) {
  background: #2d3a5c;
}

/* ---------- 平面确认条（minimap） ---------- */
.minimap {
  display: flex;
  gap: 8px;
}

.minimap-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.minimap-grid:hover {
  background: rgba(255, 255, 255, 0.06);
}

.minimap-grid.current {
  border-color: #4f9cf9;
  background: rgba(79, 156, 249, 0.12);
}

.minimap-grid.past {
  opacity: 1;
}

.minimap-grid.future {
  opacity: 0.45;
}

.minimap-label {
  font-size: 10px;
  color: #aeb9d6;
  white-space: nowrap;
}

.minimap-cells {
  display: grid;
  grid-template-columns: repeat(3, 12px);
  grid-auto-rows: 12px;
  gap: 2px;
  padding: 3px;
  background: #14171c;
  border-radius: 4px;
}

.minimap-cell {
  border-radius: 2px;
  background: #3a4150;
}

.minimap-cell.filled {
  background: var(--c, #3a4150);
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #e8ecf5;
  background: #34405e;
  transition: background 0.15s, transform 0.05s;
}

.btn:hover:not(:disabled) {
  background: #41507a;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn.primary {
  background: #2f7bf6;
}

.btn.primary:hover:not(:disabled) {
  background: #1f6ae4;
}

.btn.ghost {
  background: transparent;
  border: 1px solid #3a4568;
}

.btn.ghost:hover:not(:disabled) {
  background: #262f4a;
}

.btn.danger {
  background: #a8352f;
}

.btn.sm {
  padding: 5px 12px;
  font-size: 12.5px;
}

/* ---------- 底部色板（录入阶段） ---------- */
.color-palette {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-chip {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 3px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s, border-color 0.1s;
}

.color-chip:hover {
  transform: translateY(-3px);
}

.color-chip.selected {
  border-color: #ffffff;
  transform: translateY(-5px) scale(1.08);
}

.palette-label {
  font-size: 12px;
  color: #9aa7c7;
  margin-right: 4px;
}

/* 颜色统计 */
.color-stats {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #9aa7c7;
}

.color-stats .stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.color-stats .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* ---------- 教学面板 ---------- */
.panel-section {
  padding: 14px 18px;
  border-bottom: 1px solid #e2e7f2;
}

.panel-section h3 {
  font-size: 13px;
  color: #7a86a5;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* ---------- 录入模式右侧面板 ---------- */
.face-guide {
  font-size: 14px;
  line-height: 1.8;
  color: #38425f;
}

/* 要点提示框（key-point 与 face-guide 是兄弟节点，不能写成后代选择器） */
.key-point {
  background: #fff5d9;
  border-left: 4px solid #f0b429;
  padding: 8px 10px;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 13px;
  color: #6b5410;
}

/* ---------- 翻转方式线稿图示 ---------- */
.rotation-diagram {
  margin-top: 10px;
  padding: 8px 6px 4px;
  background: #f0f4fb;
  border: 1px solid #dfe6f3;
  border-radius: 8px;
  text-align: center;
}

.rotation-diagram svg {
  max-width: 220px;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 24, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 460px;
  width: calc(100% - 48px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.modal h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #1d2740;
}

.modal p {
  font-size: 14.5px;
  color: #5a6480;
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-line;
}

.modal .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ---------- 求解中遮罩 ---------- */
.solving-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 21, 35, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 20;
}

.solving-overlay .spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38c9a9;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.solving-overlay .text {
  color: #e8ecf5;
  font-size: 15px;
  letter-spacing: 1px;
}

/* ---------- 错误提示条 ---------- */
.toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: #b23a32;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 120;
  max-width: min(560px, 90vw);
  text-align: center;
  line-height: 1.6;
}

.toast.info {
  background: #2f7bf6;
}

/* ---------- 专家模式开关 ---------- */
.expert-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #9aa7c7;
  cursor: pointer;
  user-select: none;
}

.expert-toggle input {
  cursor: pointer;
}

/* ---------- 页脚瓦叔署名（SEO/GEO 联动，独立于 bottom-bar） ---------- */
.site-credit {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: rgba(174, 185, 214, 0.75);
  background: #10151f;
  border-top: 1px solid #232c44;
}

.site-credit a {
  color: #8fb4ff;
  text-decoration: none;
}

.site-credit a:hover {
  text-decoration: underline;
}

.site-credit .dot {
  color: rgba(174, 185, 214, 0.4);
}

/* ---------- 页脚实时访问统计 ---------- */
.visit-stats {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 7px;
  font-size: 11.5px;
  color: rgba(174, 185, 214, 0.55);
  background: #10151f;
}

.visit-stats b {
  color: #8fb4ff;
  font-weight: 600;
}

.visit-stats .dot {
  color: rgba(174, 185, 214, 0.35);
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
  .color-chip {
    width: 38px;
    height: 38px;
  }
}
