/* ===== IELTS Speaking Part 2 — Shared Styles ===== */
/* People · Places · Events · Objects */

:root {
  --p2-people: #6366F1;
  --p2-people-light: #E0E7FF;
  --p2-people-dark: #4F46E5;
  --p2-places: #0D9488;
  --p2-places-light: #CCFBF1;
  --p2-places-dark: #0F766E;
  --p2-events: #D97706;
  --p2-events-light: #FEF3C7;
  --p2-events-dark: #B45309;
  --p2-objects: #7C3AED;
  --p2-objects-light: #EDE9FE;
  --p2-objects-dark: #6D28D9;
  --p2-bg: #F8F9FB;
  --p2-card-bg: #FFFFFF;
  --p2-text: #1E293B;
  --p2-text-light: #64748B;
  --p2-border: #E2E8F0;
  --p2-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --p2-shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --p2-radius: 16px;
  --p2-radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Source Serif 4', 'Georgia', 'Times New Roman', serif;
  background: #F5F6FA;
  color: var(--p2-text);
  line-height: 1.7;
  transition: background 0.8s ease;
}
/* Full-page subtle gradients */
body.angle-appearance  { background: linear-gradient(170deg, #DBE4FF 0%, #EEF2FF 35%, #F5F6FA 80%); }
body.angle-personality { background: linear-gradient(170deg, #E9E0FF 0%, #F5F0FF 35%, #F5F6FA 80%); }
body.angle-relationship { background: linear-gradient(170deg, #FFE0EB 0%, #FFF0F5 35%, #F5F6FA 80%); }
body.angle-lifestyle    { background: linear-gradient(170deg, #D4F5E0 0%, #ECFDF5 35%, #F5F6FA 80%); }
body.angle-achievement  { background: linear-gradient(170deg, #FFF0D0 0%, #FFF8EB 35%, #F5F6FA 80%); }

/* Top Nav */
.p2-nav {
  background: var(--white, #fff);
  border-bottom: 2px solid #E2E8F0;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.p2-nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--p2-people-light);
  color: var(--p2-people-dark);
  border: 1px solid var(--p2-people);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.p2-nav-toggle:active { background: var(--p2-people); color: #fff; }
.p2-nav-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #4F46E5;
  text-decoration: none;
  letter-spacing: -0.3px;
  transition: opacity 0.2s;
  font-family: 'Inter', sans-serif;
}

/* Layout */
.p2-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  min-height: calc(100vh - 60px);
}

/* Sidebar */
.p2-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}
.p2-sidebar-section {
  margin-bottom: 20px;
}
.p2-sidebar-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--p2-text-light);
  margin-bottom: 10px;
  padding-left: 14px;
}
.p2-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--p2-text-light);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}
.p2-sidebar-item:hover { background: #F1F5F9; color: var(--p2-text); }
.p2-sidebar-item.active {
  background: var(--p2-people-light);
  color: var(--p2-people-dark);
  font-weight: 700;
}
.p2-sidebar-item .count {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--p2-text-light);
  background: #F1F5F9;
  padding: 3px 10px;
  border-radius: 20px;
}
.p2-sidebar-item.active .count {
  background: var(--p2-people);
  color: white;
}
.p2-sidebar-quick {
  display: block;
  padding: 5px 14px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--p2-text-light);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
  cursor: pointer;
}
.p2-sidebar-quick:hover { background: #F1F5F9; color: var(--p2-text); }

.p2-sidebar-sub {
  display: block;
  padding: 10px 18px 10px 38px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--p2-text-light);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.15s;
  cursor: pointer;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
}
.p2-sidebar-sub:hover {
  background: var(--p2-people-light);
  color: var(--p2-people-dark);
  border-left-color: var(--p2-people);
}

/* Eileen Gu sidebar badge */
.p2-modal .comp-col .focus-text {
  font-size: 0.72rem;
  color: var(--p2-text-light);
  line-height: 1.5;
}
.p2-eileen-btn {
  background: #F59E0B;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.p2-eileen-btn:hover { background: #D97706; transform: translateY(-1px); }

/* Main Content */
.p2-main { min-width: 0; }

/* Hero */
.p2-hero {
  background: linear-gradient(135deg, var(--p2-people-dark), var(--p2-people));
  color: white;
  border-radius: var(--p2-radius);
  padding: 48px 40px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.p2-hero::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}
.p2-hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  font-family: 'Playfair Display', 'Georgia', serif;
  font-style: italic;
}
.p2-hero .subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  max-width: 600px;
  font-family: 'Source Serif 4', 'Georgia', serif;
}
.p2-hero-stats {
  display: flex;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.p2-hero-stat {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 12px 20px;
}
.p2-hero-stat .num { font-size: 1.6rem; font-weight: 800; }
.p2-hero-stat .label { font-size: 0.75rem; opacity: 0.8; }

/* Tab Bar */
.p2-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: white;
  border-radius: var(--p2-radius);
  padding: 6px;
  box-shadow: var(--p2-shadow);
  overflow-x: auto;
}
.p2-tab {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--p2-text-light);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
}
.p2-tab:hover { background: #F1F5F9; color: var(--p2-text); }
.p2-tab.active {
  background: var(--p2-people-light);
  color: var(--p2-people-dark);
  box-shadow: var(--p2-shadow);
}
.p2-tab .en { display: block; font-weight: 700; }
.p2-tab .zh { display: block; font-size: 0.68rem; opacity: 0.7; margin-top: 2px; white-space: nowrap; }

/* Section info bar */
.p2-angle-bg {
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 28px;
  transition: opacity 0.5s ease;
  animation: bgFadeIn 0.5s ease;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  scroll-margin-top: 80px;
}
@keyframes bgFadeIn { from { opacity: 0.7; } to { opacity: 1; } }
.p2-angle-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.p2-angle-info h2 {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Playfair Display', 'Georgia', serif;
  font-style: italic;
}
.p2-angle-info .chunk-count {
  font-size: 0.8rem;
  color: var(--p2-text-light);
  background: #F1F5F9;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

/* Flashcard Grid */
.p2-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 220px;
  gap: 14px;
  margin-bottom: 24px;
}

/* Useful Structures */
.p2-structures {
  background: var(--p2-text);
  color: white;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.p2-structures h4 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  opacity: 0.7;
}
.p2-structures .struct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 6px;
}
.p2-structures .struct-item {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.9);
  transition: all 0.2s;
  cursor: pointer;
  margin: 0;
  min-height: 160px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  perspective: 800px;
  -webkit-perspective: 800px;
  overflow: hidden;
}
.p2-structures .struct-item:nth-child(3n+1) { border-radius: 16px 4px 16px 4px; }
.p2-structures .struct-item:nth-child(3n+2) { border-radius: 4px 16px 4px 16px; }
.p2-structures .struct-item:nth-child(3n)   { border-radius: 12px 12px 4px 12px; }
.p2-structures .struct-inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 18px 20px;
  box-sizing: border-box;
  transition: transform 0.5s ease;
  -webkit-transition: -webkit-transform 0.5s ease;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.p2-structures .struct-front, .p2-structures .struct-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
}
.p2-structures .struct-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 20px;
  box-sizing: border-box;
  background: rgba(255,255,255,0.12);
  border-radius: inherit;
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}
.p2-structures .struct-item.flipped .struct-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}
.p2-structures .struct-back .example-sentence {
  font-size: 0.9rem;
  color: #fff;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 10px;
  word-break: break-word;
}
.p2-structures .struct-back .example-translation {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  word-break: break-word;
}
.p2-structures .struct-item:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.25);
}
.p2-structures .struct-item:focus,
.p2-structures .struct-item:focus-visible,
.p2-card:focus,
.p2-card:focus-visible {
  outline: none;
}
.p2-structures .struct-item .blank {
  display: inline;
  padding: 0 4px;
  color: rgba(255,255,255,0.5);
}

/* Flashcard — 3D rotateY flip */
.p2-card {
  width: 100%;
  height: 220px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  perspective: 800px;
  -webkit-perspective: 800px;
  transition: filter 0.3s ease;
}
.p2-card:hover {
  filter: drop-shadow(0 4px 12px rgba(99,102,241,0.15));
}
.p2-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  -webkit-transition: -webkit-transform 0.5s ease;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.p2-card-front, .p2-card-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--p2-radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.p2-card-front {
  background: white;
  border: 1px solid var(--p2-border);
  box-shadow: var(--p2-shadow);
  justify-content: center;
  align-items: center;
  text-align: center;
  border-left: 4px solid var(--p2-people);
  z-index: 2;
}
.p2-card-back {
  background: white;
  border: 1px solid var(--p2-border);
  box-shadow: var(--p2-shadow-lg);
  justify-content: space-between;
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}
.p2-card.flipped .p2-card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}
.p2-card-front .chunk {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--p2-text);
  line-height: 1.4;
}
.p2-card-front .hint {
  font-size: 0.72rem;
  color: var(--p2-text-light);
  margin-top: 8px;
}
.p2-card-back .translation {
  font-size: 0.8rem;
  color: var(--p2-text-light);
  margin-top: 2px;
  line-height: 1.5;
}
.p2-card-back .example {
  font-size: 0.85rem;
  color: var(--p2-text);
  line-height: 1.6;
}
.p2-card-back .used-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #F1F5F9;
  border: 1px solid var(--p2-border);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--p2-text-light);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  min-height: 44px;
}
.p2-card-back .used-btn:hover { background: #E2E8F0; }
.p2-card-back .used-btn.done {
  background: #DCFCE7;
  color: #16A34A;
  border-color: #BBF7D0;
}

/* Highlighted chunk in example sentences */
.p2-card-back .example mark.hl {
  background: #FEF3C7;
  color: #92400E;
  padding: 2px 4px;
  border-radius: 4px;
  font-style: normal;
  font-weight: 600;
}
.p2-card-back .translation mark.hl {
  background: #FEF3C7;
  color: #92400E;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}
.p2-eileen-section {
  background: white;
  border-radius: var(--p2-radius);
  padding: 32px;
  box-shadow: var(--p2-shadow);
  border: 2px solid #FDE68A;
  margin-bottom: 32px;
  scroll-margin-top: 80px;
}
.p2-eileen-section .header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* ── NYT Editorial Article ── */
.nyt-article {
  font-family: 'New York', 'Georgia', 'Times New Roman', serif;
}
.nyt-article-header {
  max-width: 680px;
  margin: 0 auto 24px;
  text-align: center;
}
.nyt-rubric {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9B1B20;
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
}
.nyt-headline {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: #111;
  margin-bottom: 16px;
  font-style: italic;
}
.nyt-lede {
  font-size: 1.15rem;
  color: #555;
  line-height: 1.6;
  font-weight: 400;
  max-width: 560px;
  margin: 0 auto;
}
.nyt-byline {
  font-size: 0.72rem;
  color: #888;
  margin-top: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* Audio controls in byline */
.audio-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}
.speed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font-size: 0.68rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
}
.speed-btn:hover { border-color: #999; color: #555; }
.speed-btn.active { background: var(--p2-people); color: #fff; border-color: var(--p2-people); }

.nyt-listen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--p2-people);
  border-radius: 4px;
  background: #fff;
  font-size: 0.68rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--p2-people);
  cursor: pointer;
  transition: all 0.15s;
}
.nyt-listen:hover { background: var(--p2-people); color: #fff; }

/* Inline play button on paragraphs */
.p-listen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  font-size: 0.6rem;
  color: #aaa;
  cursor: pointer;
  margin-right: 6px;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  transition: all 0.15s;
  flex-shrink: 0;
}
.p-listen:hover { border-color: var(--p2-people); color: var(--p2-people); background: #faf5ff; }
.nyt-figure {
  max-width: 720px;
  margin: 28px auto;
}
.nyt-hero-img {
  width: 100%;
  border-radius: 4px;
  display: block;
}
.nyt-figure figcaption {
  font-size: 0.72rem;
  color: #888;
  margin-top: 8px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
  max-width: 560px;
}
.nyt-body {
  max-width: 640px;
  margin: 0 auto;
}
.nyt-body p {
  font-size: 1.1rem;
  line-height: 1.85;
  color: #222;
  margin-bottom: 20px;
}
.nyt-dropcap::first-letter {
  float: left;
  font-size: 4.5rem;
  line-height: 0.8;
  font-weight: 700;
  margin: 6px 12px 0 0;
  color: #9B1B20;
  font-style: italic;
}
.nyt-pullquote {
  max-width: 480px;
  margin: 28px auto;
  padding: 20px 28px;
  border-left: 4px solid #9B1B20;
  font-size: 1.3rem;
  font-style: italic;
  color: #333;
  line-height: 1.5;
  text-align: center;
  background: #FFFBF5;
  border-radius: 0 8px 8px 0;
}
.nyt-quote-mark {
  display: block;
  font-size: 3rem;
  color: #9B1B20;
  line-height: 0.6;
  margin-bottom: 8px;
}
.nyt-pullquote cite {
  display: block;
  font-size: 0.75rem;
  color: #888;
  font-style: normal;
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.nyt-divider {
  max-width: 120px;
  margin: 32px auto;
  border: none;
  border-top: 1px solid #CCC;
}
.nyt-footer {
  max-width: 640px;
  margin: 24px auto 0;
  padding: 14px 18px;
  background: #FFFBF5;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #92400E;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 900px) {
  .nyt-headline { font-size: 1.6rem; }
  .nyt-body p { font-size: 1rem; }
  .nyt-pullquote { font-size: 1.1rem; padding: 16px 20px; }
  .nyt-lede { font-size: 1rem; }
}
.p2-eileen-section h3 {
  font-size: 1.3rem;
  font-weight: 800;
}
.p2-eileen-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.p2-eileen-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}
.p2-eileen-card:hover {
  border-color: #F59E0B;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245,158,11,0.15);
}
.p2-eileen-card .prompt-zh {
  font-size: 0.85rem;
  font-weight: 700;
  color: #92400E;
  margin-bottom: 4px;
}
.p2-eileen-card .prompt-en {
  font-size: 0.7rem;
  color: #B45309;
  margin-bottom: 8px;
}
.p2-eileen-card .focus {
  font-size: 0.7rem;
  background: white;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--p2-text-light);
  display: inline-block;
}

/* Drill Box */
.p2-drill {
  background: white;
  border-radius: var(--p2-radius);
  padding: 28px 32px;
  box-shadow: var(--p2-shadow);
  border-top: 4px solid var(--p2-people);
  scroll-margin-top: 80px;
}
.p2-drill h3 { font-size: 1.15rem; margin-bottom: 12px; }
.p2-drill .random-prompt {
  background: var(--p2-people-light);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--p2-people-dark);
  margin-bottom: 16px;
  font-size: 0.95rem;
}
/* Drill toolbar */
.drill-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: white;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid var(--p2-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.drill-toolbar-left,
.drill-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.p2-drill-btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--p2-border);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.2px;
  min-height: 40px;
  background: #F8F9FB;
  color: var(--p2-text);
  white-space: nowrap;
}
.p2-drill-btn:hover { 
  background: #EEF2FF;
  border-color: #C7D2FE;
}
.p2-drill-btn:active {
  background: #E0E7FF;
  transform: scale(0.97);
}
.p2-drill-btn-accent {
  background: var(--p2-people);
  color: white;
  border-color: var(--p2-people);
  font-weight: 700;
}
.p2-drill-btn-accent:hover {
  background: var(--p2-people-dark);
  border-color: var(--p2-people-dark);
}
.p2-drill-btn-fresh {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}
.p2-drill-btn-fresh:hover {
  background: #DCFCE7;
  border-color: #86EFAC;
}
.p2-timer {
  font-family: 'Space Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--p2-people);
  min-width: 56px;
  text-align: center;
}

/* Modal */
.p2-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.p2-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.p2-modal {
  background: white;
  border-radius: 20px;
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
}
.p2-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: #F1F5F9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.p2-modal-close:hover { background: #E2E8F0; }
.p2-modal h2 { font-size: 1.8rem; margin-bottom: 8px; }
.p2-modal .subtitle {
  color: var(--p2-text-light);
  margin-bottom: 28px;
  line-height: 1.6;
}
.p2-modal .comparison-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.p2-modal .comp-col {
  background: #F8FAFC;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--p2-border);
}
.p2-modal .comp-col h4 {
  font-size: 0.85rem;
  color: var(--p2-people-dark);
  margin-bottom: 6px;
}
.p2-modal .comp-col .prompt-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p2-text);
  margin-bottom: 10px;
}
.p2-modal .comp-col .angle-label {
  font-size: 0.68rem;
  color: var(--p2-text-light);
  margin-bottom: 4px;
  font-weight: 600;
}
.p2-modal .comp-col .focus-text {
  font-size: 0.72rem;
  color: var(--p2-text-light);
  line-height: 1.5;
}
.p2-modal .opening-box {
  background: #EEF2FF;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 28px;
}
.p2-modal .opening-box h4 {
  color: var(--p2-people-dark);
  margin-bottom: 12px;
}
.p2-modal .opening-box p {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--p2-text);
  line-height: 1.6;
  margin-bottom: 10px;
}
.p2-modal .opening-box .prompt-tag {
  display: inline-block;
  background: var(--p2-people-light);
  color: var(--p2-people-dark);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 6px;
}
.p2-modal .insight-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 28px;
}
.p2-modal .insight-box h4 { color: #92400E; margin-bottom: 6px; }
.p2-modal .insight-box p { color: #78350F; font-size: 0.9rem; line-height: 1.6; }
.p2-modal .template-box {
  background: #F1F5F9;
  border-radius: 12px;
  padding: 20px;
}
.p2-modal .template-box h4 { margin-bottom: 10px; }
.p2-modal .template-box textarea {
  width: 100%;
  border: 1px solid var(--p2-border);
  border-radius: 8px;
  padding: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 100px;
}

/* Cross Method (十字破题法) */
.cross-box {
  background: white;
  border-radius: var(--p2-radius);
  padding: 32px 20px;
  box-shadow: var(--p2-shadow);
  border-top: 4px solid var(--p2-people);
  margin-bottom: 32px;
}
.cross-box h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  text-align: center;
}
.cross-box .cross-subtitle {
  text-align: center;
  font-size: 0.78rem;
  color: var(--p2-text-light);
  margin-bottom: 20px;
}
.cross-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  border: 1.5px solid var(--p2-border);
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: var(--p2-shadow);
  min-height: 220px;
}
.cross-layout .cross-center {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  padding: 12px 8px;
  width: 120px;
}
.cross-layout .cross-center-inner {
  width: 100%;
  padding: 12px 8px;
  border: 2px solid var(--p2-people);
  border-radius: 12px;
  background: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  color: var(--p2-people-dark);
  box-shadow: 0 2px 12px rgba(99,102,241,0.15);
  cursor: text;
}
.cross-layout .cross-slot {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
  z-index: 1;
}
.cross-layout .cross-slot.ne { grid-column: 3; grid-row: 1; padding: 12px 14px 6px 6px; }
.cross-layout .cross-slot.se { grid-column: 3; grid-row: 2; padding: 6px 14px 12px 6px; }
.cross-layout .cross-slot.sw { grid-column: 1; grid-row: 2; padding: 6px 6px 12px 14px; }
.cross-layout .cross-slot.nw { grid-column: 1; grid-row: 1; padding: 12px 6px 6px 14px; }
.cross-layout::before {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  right: 4px; bottom: 4px;
  z-index: 0;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--p2-people-light) 50%, transparent calc(50% + 1px)),
    linear-gradient(to bottom left, transparent calc(50% - 1px), var(--p2-people-light) 50%, transparent calc(50% + 1px));
  opacity: 0.3;
  pointer-events: none;
}
.cross-layout .cross-input {
  width: 100%;
  padding: 14px 14px;
  border: 1.5px solid var(--p2-border);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--p2-text);
  background: #FAFBFC;
  resize: none;
  min-height: 85px;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
  box-sizing: border-box;
}
.cross-layout .cross-input:focus {
  outline: none;
  border-color: var(--p2-people);
  background: white;
  box-shadow: 0 0 0 3px var(--p2-people-light);
}
.cross-layout .cross-input::placeholder {
  color: #A0AEC0;
  font-size: 0.8rem;
}
/* Footer */
.p2-footer {
  text-align: center;
  padding: 24px;
  color: var(--p2-text-light);
  font-size: 0.8rem;
  border-top: 1px solid var(--p2-border);
  margin-top: 40px;
}

/* Timer display */
.p2-timer {
  font-family: 'Space Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--p2-people);
}

/* Responsive */
@media (max-width: 900px) {
  .p2-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
  .p2-nav { padding: 0 16px; height: 56px; justify-content: space-between; }
  .p2-nav-brand { font-size: 1rem; gap: 6px; }
  .p2-nav-brand .brand-emoji { font-size: 1.1rem; }
  .p2-nav-toggle { display: flex; }

  /* Sidebar becomes dropdown */
  .p2-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: auto;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border-bottom: 2px solid #E2E8F0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 99;
    transition: max-height 0.35s ease;
    padding: 0 16px;
  }
  .p2-sidebar.open {
    max-height: 500px;
    padding: 12px 16px;
    overflow-y: auto;
  }
  .p2-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
  }
  .p2-sidebar-label { display: none; }
  .p2-sidebar-item {
    padding: 12px 16px;
    font-size: 0.88rem;
    min-height: 48px;
    align-items: center;
    display: flex;
  }
  .p2-sidebar-sub {
    padding: 12px 16px 12px 28px;
    font-size: 0.8rem;
    min-height: 44px;
    align-items: center;
    display: flex;
    border-left: 3px solid var(--p2-people-light);
  }
  .p2-sidebar-sub:hover { border-left-color: var(--p2-people); }
  .p2-hero { padding: 32px 20px; }
  .p2-hero h1 { font-size: 1.8rem; }
  .p2-hero .subtitle { font-size: 0.95rem; }
  .p2-hero-stats { flex-wrap: wrap; gap: 8px; }
  .p2-hero-stat { padding: 10px 16px; }
  .p2-hero-stat .num { font-size: 1.3rem; }
  .p2-tabs { 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    gap: 2px;
  }
  .p2-tab { 
    flex: 0 0 auto; 
    min-width: 100px;
    padding: 12px 12px;
    min-height: 44px;
    font-size: 0.72rem;
  }
  .p2-cards { grid-template-columns: 1fr; grid-auto-rows: minmax(180px, auto); gap: 10px; }
  .p2-card { height: auto; min-height: 180px; }
  .p2-card-front, .p2-card-back { padding: 16px; }
  .p2-card-front .chunk { font-size: 1.05rem; }
  .p2-card-back .example { font-size: 0.8rem; }
  .p2-card-back .translation { font-size: 0.72rem; }
  .p2-card-back .used-btn { padding: 12px 14px; min-height: 44px; }
  .p2-angle-bg { padding: 20px 16px; }
  .p2-angle-info h2 { font-size: 1.1rem; }
  .p2-structures { padding: 20px 16px; }
  .p2-structures .struct-grid { grid-template-columns: 1fr; }
  .p2-structures .struct-item { min-height: 120px; font-size: 0.82rem; }
  .p2-eileen-grid, .p2-modal .comparison-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .p2-eileen-section { padding: 20px 16px; }
  .p2-drill { padding: 20px 16px; }
  .p2-modal { padding: 24px 16px; width: 95%; }
  .cross-box { padding: 20px 12px; }
  .p2-footer { padding: 16px; font-size: 0.72rem; }
}
@media (max-width: 480px) {
  .p2-layout { padding: 10px; gap: 12px; }
  .p2-hero { padding: 24px 16px; }
  .p2-hero h1 { font-size: 1.4rem; }
  .p2-hero .subtitle { font-size: 0.85rem; }
  .p2-hero-stat { padding: 8px 12px; }
  .p2-hero-stat .num { font-size: 1.1rem; }
  .p2-eileen-grid, .p2-modal .comparison-grid {
    grid-template-columns: 1fr;
  }
  .p2-tab { min-width: 90px; padding: 10px 8px; font-size: 0.68rem; }
  .p2-sidebar-item { font-size: 0.82rem; padding: 10px 14px; }
  .p2-sidebar-sub { font-size: 0.74rem; padding: 10px 14px 10px 24px; }
  .cross-layout { min-height: 200px; }
  .cross-layout .cross-center { width: 80px; }
  .cross-layout .cross-center-inner { font-size: 0.65rem; padding: 8px 4px; }
  .cross-layout .cross-input { min-height: 60px; font-size: 0.75rem; padding: 10px 8px; }
  .cross-layout .cross-slot.ne { padding: 6px 8px 3px 3px; }
  .cross-layout .cross-slot.se { padding: 3px 8px 6px 3px; }
  .cross-layout .cross-slot.sw { padding: 3px 3px 6px 8px; }
  .cross-layout .cross-slot.nw { padding: 6px 3px 3px 8px; }
}
