/* ============================================
   需求从0到1 · PC端教学网页样式重构
   Duolingo风格 + 企鹅博士 mascot + PC宽屏布局
   ============================================ */

/* --- CSS Variables --- */
:root {
  --green: #58cc02;
  --green-dark: #46a302;
  --blue: #1cb0f6;
  --blue-dark: #0a91cc;
  --yellow: #ffc800;
  --yellow-dark: #e6b300;
  --red: #ff4b4b;
  --red-dark: #cc3a3a;
  --purple: #ce82ff;
  --purple-dark: #a85cd4;
  --orange: #ff9800;
  --orange-dark: #e65100;
  --penguin-body: #2c2c2c;
  --penguin-belly: #fff;
  --penguin-beak: #ff9800;
  --gray-50: #f7f7f7;
  --gray-100: #e5e5e5;
  --gray-200: #cccccc;
  --gray-300: #aaaaaa;
  --gray-700: #4b4b4b;
  --gray-800: #3c3c3c;
  --gray-900: #1c1c1c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 5px 0 0 rgba(0,0,0,0.13);
  --shadow-sm: 0 2px 0 0 rgba(0,0,0,0.10);
  --font-main: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: #f0f7ff;
  color: var(--gray-900);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Top Bar (PC: taller, with mascot) --- */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: #fff;
  border-bottom: 3px solid var(--gray-100);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.top-bar .logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.top-bar .logo .logo-icon {
  width: 40px;
  height: 40px;
}
.top-bar .progress-wrapper {
  flex: 1;
  margin: 0 32px;
  max-width: 500px;
}
.top-bar .progress-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-300);
  margin-bottom: 4px;
}
.top-bar .progress-track {
  height: 12px;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--gray-200);
}
.top-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #7ee23e);
  border-radius: 6px;
  transition: width 0.5s ease;
  position: relative;
}
.top-bar .mascot-small {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

/* --- Sidebar (PC nav) --- */
.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  width: 220px;
  height: calc(100vh - 64px);
  background: #fff;
  border-right: 3px solid var(--gray-100);
  padding: 20px 14px;
  overflow-y: auto;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar .sidebar-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 8px;
  margin-bottom: 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-item:hover { background: var(--gray-50); }
.sidebar-item.active {
  background: #e6ffd6;
  color: var(--green-dark);
  font-weight: 900;
}
.sidebar-item.completed {
  background: #e8f8ff;
  color: var(--blue-dark);
}
.sidebar-item .si-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}
.sidebar-item.active .si-num {
  background: var(--green);
  color: #fff;
}
.sidebar-item.completed .si-num {
  background: var(--blue);
  color: #fff;
}

/* --- Main Content (PC: left offset for sidebar) --- */
.main-content {
  margin-left: 220px;
  margin-top: 64px;
  padding: 32px 40px 100px;
  max-width: 1100px;
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .top-bar .progress-wrapper { margin: 0 16px; }
}

/* --- Penguin Mascot (reusable SVG inline styles) --- */
.penguin-mascot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.penguin-mascot .p-body {
  width: 80px;
  height: 90px;
  background: var(--penguin-body);
  border-radius: 40px 40px 35px 35px;
  position: relative;
  border: 3px solid #1a1a1a;
}
.penguin-mascot .p-belly {
  position: absolute;
  bottom: 5px;
  left: 8px;
  right: 8px;
  height: 50px;
  background: var(--penguin-belly);
  border-radius: 25px 25px 30px 30px;
  border: 2px solid #e0e0e0;
}
.penguin-mascot .p-eye {
  position: absolute;
  width: 14px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 22px;
  border: 2px solid #1a1a1a;
}
.penguin-mascot .p-eye-l { left: 18px; }
.penguin-mascot .p-eye-r { right: 18px; }
.penguin-mascot .p-pupil {
  position: absolute;
  width: 7px;
  height: 8px;
  background: #1a1a1a;
  border-radius: 50%;
  bottom: 3px;
  left: 3px;
}
.penguin-mascot .p-beak {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 14px;
  background: var(--penguin-beak);
  border-radius: 0 0 11px 11px;
  border: 2px solid #e68900;
}
.penguin-mascot .p-wing {
  position: absolute;
  width: 18px;
  height: 40px;
  background: var(--penguin-body);
  border-radius: 9px;
  top: 30px;
  border: 2px solid #1a1a1a;
}
.penguin-mascot .p-wing-l { left: -10px; transform: rotate(15deg); }
.penguin-mascot .p-wing-r { right: -10px; transform: rotate(-15deg); }
.penguin-mascot .p-foot {
  position: absolute;
  bottom: -8px;
  width: 20px;
  height: 10px;
  background: var(--penguin-beak);
  border-radius: 0 0 10px 10px;
  border: 2px solid #e68900;
}
.penguin-mascot .p-foot-l { left: 18px; }
.penguin-mascot .p-foot-r { right: 18px; }
.penguin-mascot .p-name {
  font-size: 12px;
  font-weight: 900;
  color: var(--gray-700);
  margin-top: 4px;
}

/* --- Speech Bubble (mascot speech) --- */
.speech-bubble {
  background: #fff;
  border: 3px solid var(--gray-200);
  border-radius: 18px;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.7;
  position: relative;
  box-shadow: var(--shadow-sm);
  max-width: 520px;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 24px;
  width: 0; height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 12px solid var(--gray-200);
}
.speech-bubble::after {
  content: '';
  position: absolute;
  left: -9px;
  top: 26px;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #fff;
}

/* --- Mascot Row (mascot + speech) --- */
.mascot-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

/* --- Section Card (PC: two-column capable) --- */
.card {
  background: #fff;
  border: 3px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title .icon { font-size: 28px; }

/* --- Two-col layout inside card --- */
.card-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 768px) {
  .card-2col { grid-template-columns: 1fr; }
}

/* --- Quiz Block --- */
.quiz-block {
  background: #fffbe6;
  border: 3px solid var(--yellow);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.quiz-question {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--gray-900);
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  background: #fff;
  border: 2.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--font-main);
  text-align: left;
  width: 100%;
  line-height: 1.5;
}
.quiz-option:hover { border-color: var(--blue); background: #e8f8ff; transform: translateY(-1px); }
.quiz-option.selected { border-color: var(--blue); background: #d4f0ff; }
.quiz-option.correct { border-color: var(--green); background: #e6ffd6; pointer-events: none; }
.quiz-option.wrong { border-color: var(--red); background: #ffe6e6; pointer-events: none; }
.quiz-option .option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.quiz-feedback {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
  display: none;
}
.quiz-feedback.show { display: block; animation: fadeIn 0.3s ease; }
.quiz-feedback.correct-feedback { background: #e6ffd6; border: 2px solid var(--green); color: var(--green-dark); }
.quiz-feedback.wrong-feedback { background: #ffe6e6; border: 2px solid var(--red); color: var(--red-dark); }

/* --- Example Card (visual, image-like) --- */
.example-card {
  background: #fff;
  border: 2.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.example-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.example-card .ec-visual {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 10px;
}
.example-card .ec-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 4px;
}
.example-card .ec-desc {
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
}

/* --- Mind Map (interactive) --- */
.mindmap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 20px 0;
}
.mindmap-node {
  border-radius: 14px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  min-width: 140px;
}
.mindmap-node:hover { transform: scale(1.05); }
.mindmap-node.root {
  background: linear-gradient(135deg, var(--yellow), #ffe066);
  border: 3px solid var(--yellow-dark);
  font-size: 16px;
}
.mindmap-node.branch {
  background: #e8f8ff;
  border: 2.5px solid var(--blue);
  color: var(--blue-dark);
}
.mindmap-branch-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 4px 0;
}
.mindmap-connector {
  width: 3px;
  height: 18px;
  background: var(--gray-200);
}

/* --- Phone Mockup (kept from before, enhanced) --- */
.phone-mockup {
  width: 300px;
  height: 540px;
  background: #fff;
  border: 4px solid var(--gray-800);
  border-radius: 28px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 0 var(--gray-800);
  display: flex;
  flex-direction: column;
}

/* --- Tag / Badge --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}
.tag-green { background: #e6ffd6; color: var(--green-dark); border: 2px solid var(--green); }
.tag-red { background: #ffe6e6; color: var(--red-dark); border: 2px solid var(--red); }
.tag-yellow { background: #fff3cd; color: var(--yellow-dark); border: 2px solid var(--yellow); }
.tag-blue { background: #e8f8ff; color: var(--blue-dark); border: 2px solid var(--blue); }
.tag-purple { background: #f3e8ff; color: var(--purple-dark); border: 2px solid var(--purple); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 800;
  border: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}
.btn:active { transform: translateY(2px); box-shadow: none !important; }
.btn-green { background: var(--green); border-color: var(--green-dark); color: #fff; box-shadow: var(--shadow); }
.btn-green:hover { background: #63e010; }
.btn-blue { background: var(--blue); border-color: var(--blue-dark); color: #fff; box-shadow: var(--shadow); }
.btn-blue:hover { background: #35bbff; }
.btn-yellow { background: var(--yellow); border-color: var(--yellow-dark); color: var(--gray-900); box-shadow: var(--shadow); }
.btn-yellow:hover { background: #ffd422; }
.btn-red { background: var(--red); border-color: var(--red-dark); color: #fff; box-shadow: var(--shadow); }
.btn-red:hover { background: #ff6666; }
.btn-purple { background: var(--purple); border-color: var(--purple-dark); color: #fff; box-shadow: var(--shadow); }
.btn-purple:hover { background: #d99aff; }

/* --- Bot Demo Chat --- */
.chat-demo {
  background: #f7f7f7;
  border: 3px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
}
.chat-header {
  background: linear-gradient(135deg, var(--purple), #b366ff);
  color: #fff;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
}
.chat-bubble.bot {
  background: #fff;
  border: 2px solid var(--gray-200);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat-bubble.user {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-input-row {
  display: flex;
  border-top: 2px solid var(--gray-200);
  background: #fff;
}
.chat-input-row input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
}
.chat-input-row button {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 0 18px;
  font-size: 18px;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 800;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 36px;
  margin: 16px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 13px; top: 0; bottom: 0;
  width: 3px;
  background: var(--gray-200);
  border-radius: 2px;
}
.tl-item {
  position: relative;
  margin-bottom: 18px;
  cursor: pointer;
  transition: var(--transition);
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -30px; top: 5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 3px solid var(--gray-200);
  transition: var(--transition);
}
.tl-item.active::before { background: var(--green); border-color: var(--green-dark); box-shadow: 0 0 0 4px rgba(88,204,2,0.2); }
.tl-item.done::before { background: var(--blue); border-color: var(--blue-dark); }
.tl-content {
  background: #fff;
  border: 2.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.7;
  transition: var(--transition);
}
.tl-item.active .tl-content { border-color: var(--green); background: #f7fff0; }
.tl-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }

/* --- Certificate --- */
.certificate {
  background: linear-gradient(135deg, #fff9e6, #fff3cd);
  border: 5px double var(--yellow);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  margin-top: 24px;
  position: relative;
  overflow: hidden;
}
.certificate::before {
  content: '✨';
  position: absolute;
  font-size: 100px;
  opacity: 0.08;
  top: -10px; right: -10px;
}
.cert-badge {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--yellow), #ffd422);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 16px;
  box-shadow: 0 4px 0 var(--yellow-dark);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.fade-in { animation: fadeIn 0.4s ease; }
.bounce { animation: bounce 0.6s ease; }

/* --- Utility --- */
.text-green { color: var(--green-dark); }
.text-blue { color: var(--blue-dark); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow-dark); }
.text-purple { color: var(--purple-dark); }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 32px 0 18px;
}
.section-divider .divider-line { flex: 1; height: 3px; background: var(--gray-100); border-radius: 2px; }
.section-divider .divider-label { font-size: 13px; font-weight: 800; color: var(--gray-300); white-space: nowrap; }

/* --- PC: center card wrapper --- */
.card-wide {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Metric Card Selected --- */
.metric-card.selected {
  border-color: var(--green);
  background: #f7fff0;
  box-shadow: 0 0 0 3px rgba(88,204,2,0.2);
}

/* --- Usability Item Checked --- */
.usability-item.checked {
  border-color: var(--green);
  background: #f7fff0;
  box-shadow: 0 0 0 3px rgba(88,204,2,0.2);
}
.usability-item.checked::before {
  content: '✅';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
}

/* --- Launch Step Checked --- */
.launch-step.checked {
  border-color: var(--green);
  background: #f7fff0;
}
.launch-step.checked::before {
  content: '✅';
  margin-right: 8px;
}
