﻿@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;600&family=ZCOOL+KuaiLe&display=swap');

:root {
  color-scheme: light;
  --bg: #f8f4ee;
  --bg-accent: #f3e8dc;
  --card: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --primary: #1f4b3f;
  --primary-strong: #16372e;
  --line: #e6dccf;
  --shadow: 0 18px 50px rgba(30, 30, 30, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff6eb 0%, var(--bg) 55%, var(--bg-accent) 100%);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff1e3;
  color: #9a5b2e;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-family: "ZCOOL KuaiLe", "Noto Sans SC", sans-serif;
  font-size: clamp(36px, 6vw, 64px);
  margin: 0 0 8px;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 28px;
}

.board,
.info {
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.board-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.board-tip {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f7f3ee;
  color: #8a6d4f;
  font-size: 13px;
  white-space: nowrap;
}

.canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: #fffaf5;
  border: 1px dashed #e8d7c4;
}

#doodleCanvas {
  width: min(280px, 80vw);
  height: min(280px, 80vw);
  border-radius: 16px;
  border: 2px solid #1a1a1a;
  background: #ffffff;
  touch-action: none;
}

.actions {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 22px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(31, 75, 63, 0.2);
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.btn.ghost {
  background: #f7f0e8;
  color: #4b3925;
  border-color: #e5d5c6;
}

.btn.ghost:hover {
  transform: translateY(-1px);
}

.info h3 {
  margin-top: 0;
  font-size: 20px;
}

.info ul {
  margin: 12px 0 20px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.info-card {
  background: #f7f2ec;
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  color: #5c4b3a;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(4px);
  padding: 24px;
  animation: fadeIn 0.2s ease;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 28px;
  width: min(520px, 90vw);
  box-shadow: var(--shadow);
  position: relative;
  animation: slideUp 0.2s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: #f2f2f2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.result-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 8px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #efe3d6;
  background: #fffaf4;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.result-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(30, 30, 30, 0.08);
}

.result-name {
  font-size: 18px;
  font-weight: 600;
}

.result-confidence {
  font-size: 13px;
  color: #7a6b5b;
}

.result-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 36px 16px 52px;
  }

  .board,
  .info {
    padding: 22px;
  }

  .board-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
