/* 西语有境 · 奶油纸色与西语文化插画。仅改变视觉，不改教学与模型逻辑。 */
:root {
  --ink: #3e372d;
  --muted: #706552;
  --navy: #4a4936;
  --blue: #98513e;
  --blue-soft: #f4e8d8;
  --line: #e5dbc5;
  --paper: #f4edd8;
  --white: #fffdf6;
  --green: #536540;
  --green-soft: #edf0df;
  --amber: #805c27;
  --amber-soft: #f4e9cd;
  --shadow: 0 6px 24px rgba(88, 66, 35, .035);
  --clay: #b37056;
  --honey: #c6a35c;
  --olive: #8a9470;
}
body { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
::selection { background: #e8d6af; color: #3e372d; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #9b7844; outline-offset: 4px;
}
.app { max-width: 1440px; padding-top: 28px; }
.masthead { padding: 0 2px; }
.logo { background: #98513e; color: #fffaf0; border-radius: 15px 15px 15px 4px; box-shadow: inset -7px -7px 0 #aa6a50; }
.brand { color: #493d30; letter-spacing: .09em; }
.brand-sub { font-size: 10px; letter-spacing: .19em; margin-top: 1px; }
.pill { color: #865037; background: #f4e8d8; border-radius: 6px; }
.pill.gray { background: #efeadb; color: #746953; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.btn { background: #fffdf6; border-color: #dcd0b7; border-radius: 9px; font-weight: 600; }
.btn:hover { background: #f2e8d2; border-color: #cdbd9b; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fffdf6; box-shadow: 0 3px 8px #98513e12; }
.btn.primary:hover { background: #824633; border-color: #824633; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.subtle { border-color: transparent; }
.btn.subtle:hover { background: #f1ead8; border-color: #e5dbc5; }
.intro {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(360px, 1fr);
  align-items: center; gap: 24px; margin: 28px 0 18px; padding: 31px 34px 30px;
  border: 1px solid #e7d9b9; border-radius: 20px; background: #f8f1df;
}
.intro-copy { min-width: 0; }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: #796747; font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.hero-kicker::before { content: ''; width: 24px; height: 1px; background: #b89150; flex: 0 0 auto; }
.intro h1 { max-width: 570px; font-family: 'Songti SC', 'STSong', 'Noto Serif CJK SC', serif; font-size: 33px; font-weight: 650; line-height: 1.45; letter-spacing: .015em; text-wrap: balance; }
.intro p { max-width: 600px; margin-top: 13px; font-size: 13px; line-height: 1.95; color: #74664f; }
.intro .version { display: none; }
.cultural-gallery { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 0 2px 14px; border-left: 1px solid #e8dabc; }
.culture-stamp { flex: 1 1 0; min-width: 0; margin: 0; text-align: center; }
.culture-stamp:nth-child(even) { padding-top: 22px; }
.culture-stamp svg { display: block; width: 100%; max-width: 86px; height: 101px; margin: 0 auto 5px; overflow: visible; }
.culture-stamp figcaption { color: #7e6949; font-family: Georgia, 'Times New Roman', serif; font-size: 11px; letter-spacing: .02em; }
.art-clay { fill: var(--clay); }
.art-honey { fill: var(--honey); }
.art-olive { fill: var(--olive); }
.art-paper { fill: #f8f1df; }
.art-line { fill: none; stroke: #82664b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art-faint { fill: #dfcc9f; }
.tabs { border-bottom-color: #dfd2b5; gap: 12px; margin-bottom: 20px; }
.tab { padding: 12px 20px 13px; border-radius: 9px 9px 0 0; color: #73664f; }
.tab:hover { background: #f1e7d0; color: #865037; }
.tab[aria-selected='true'] { background: #f9f2e3; color: #914e39; border-bottom-color: #98513e; }
.notice { color: #72664f; line-height: 1.8; font-size: 12px; margin-bottom: 19px; }
.notice > :first-child { color: #a0875b; }
.card { background: #fffdf6; border-color: #e5dbc5; border-radius: 16px; box-shadow: var(--shadow); }
.card-top { background: #fffdf6; border-bottom-color: #ebe1cc; }
.eyebrow { color: #7b694d; font-size: 11px; letter-spacing: .14em; }
.card-top h2 { color: #4d4030; font-size: 23px; letter-spacing: .015em; margin-top: 8px; }
.scenario-lead { color: #75664e; font-size: 13px; line-height: 1.85; }
.map { background: #f5efdd; border-color: #e4d6b8; border-radius: 12px; padding: 18px; }
.map { min-height: 320px; grid-template-columns: 1fr 42px 1fr; grid-template-rows: 1fr 32px 1fr; background: radial-gradient(ellipse at 77% 24%, #e4e8cf 0 17%, transparent 18%), radial-gradient(ellipse at 23% 27%, #f1e2c8 0 17%, transparent 18%), #f5efdd; }
.place { flex-direction: column; justify-content: center; gap: 1px; border: 0; background: transparent; border-radius: 0; text-align: center; cursor: default; box-shadow: none; }
.place.library { background: transparent; border: 0; }
.place svg { width: 60px; height: 60px; stroke: #a16d42; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.place.garden svg { stroke: #7e8b60; }
.place.cafe svg { stroke: #a56c50; }
.place span { color: #76654c; }
.map .road-h { color: #806b46; font-size: 9px; letter-spacing: .15em; background: #e9dfc6; border-top: 1px dashed #c5b48e; border-bottom: 1px dashed #c5b48e; z-index: 1; }
.road-v { border-left: 0; margin: 0 11px; background: #e9dfc6; }
.map-tag { border-color: #e1d3b5; background: #fffdf6; color: #7b684a; }
.prompt { background: #f7f0e1; border-left-color: #b58a52; }
.spanish { color: #665037; }
.blank { color: #99533c; border-bottom-color: #ba9d72; }
.question-label { color: #554631; }
.choice { border-color: #e4dac4; background: #fffdf8; transition: border-color .18s, background .18s; }
.choice:hover { border-color: #c9b28b; background: #fbf5e8; }
.choice:has(input:checked) { border-color: #aa7954; background: #f7eddd; }
.choice input { accent-color: #98513e; }
.choice small { color: #796649; font-size: 12px; }
.avatar { background: #f1e4cd; color: #a56b48; }
.step-num { background: #fffdf6; border-color: #dfd4bd; color: #7b694d; }
.step.done .step-num { background: #e9eddc; border-color: #c6cfaf; color: #65764d; }
.step.active .step-num { background: #9b6246; border-color: #9b6246; }
.coach-box { background: #e9ead9; border-color: #d9ddc3; color: #4a5139; }
.coach-box .card-body { position: relative; }
.coach-box .eyebrow { color: #626c4b; }
.coach-box h3 { color: #4a5139; line-height: 1.6; }
.coach-box p { color: #606a4c; font-size: 14px; }
.coach-box .source { color: #5d6948; border-top-color: #ced4b9; }
.coach-box .source b { color: #5f6e47; }
.coach-kicker { color: #806642; font-size: 11px; }
.feedback-body { color: #74664f; }
.feedback-body .example { background: #f4e8d8; color: #795239; }
.reason { background: #f8f3e7; color: #786748; border-color: #e6dbc2; }
.receipt { background: #edf0df; border-color: #d1d9ba; color: #5d6b47; }
.receipt h3 { color: #536540; }
.receipt .mini { color: #626f4d; }
.footline { color: #79684b; margin-top: 26px; }
.footline a { color: #796447; text-underline-offset: 3px; }
th { background: #f6f0e1; color: #796547; }
.bar { background: #eee6d4; }
.bar-row:nth-child(3) .bar i { background: #b58b56 !important; }
.bar-row:nth-child(4) .bar i { background: #9b9f78 !important; }
.suggestion, .overview-grid p, .plain-list { color: #74644a; }
.flow-item { background: #f7f0e1; border-color: #e5d8bc; }
.guard { border-top-color: #cab58e; }
.readiness .marker { background: #af8a54; }
.review-note { background: #f3e8d1; border-color: #dfccaa; color: #826944; }
#ai-topic, #ai-question, #ai-code { background: #fffdf8; color: var(--ink); max-width: 100%; }
#ai-question::placeholder { color: #9d907b; }
#ai-topic { width: 100%; max-width: 580px; }
#ai-code { width: min(100%, 320px); }
.ripple-host { position: relative; overflow: hidden; isolation: isolate; }
.ui-ripple { position: absolute; pointer-events: none; width: var(--ripple-size); height: var(--ripple-size); left: var(--ripple-x); top: var(--ripple-y); border: 1px solid currentColor; border-radius: 50%; color: rgba(130, 94, 47, .26); transform: translate(-50%, -50%) scale(.04); opacity: 0; animation: quiet-ripple 720ms cubic-bezier(.15, .6, .3, 1) forwards; }
.ui-ripple::after { content: ''; position: absolute; inset: 17%; border: 1px solid currentColor; border-radius: 50%; }
.btn.primary .ui-ripple { color: rgba(255, 247, 224, .38); }
@keyframes quiet-ripple { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.04); } 14% { opacity: .8; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
@media (max-width: 1150px) {
  .intro { grid-template-columns: minmax(0, 1.15fr) minmax(310px, 1fr); padding: 27px; gap: 18px; }
  .intro h1 { font-size: 29px; }
  .cultural-gallery { gap: 5px; padding-left: 10px; }
  .culture-stamp svg { height: 85px; }
}
@media (max-width: 900px) {
  .intro { grid-template-columns: minmax(0, 1fr) 285px; padding: 24px; }
  .intro h1 { font-size: 27px; }
  .culture-stamp svg { height: 72px; }
  .culture-stamp figcaption { font-size: 9px; }
  .meta-row { flex-wrap: wrap; }
  .action-group { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .app { padding: 18px 16px 26px; }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 23px 22px 20px; margin: 22px 0 16px; border-radius: 17px; }
  .intro h1 { font-size: 27px; line-height: 1.5; max-width: 430px; }
  .intro p { font-size: 12px; margin-top: 10px; }
  .hero-kicker { font-size: 8px; letter-spacing: .13em; margin-bottom: 11px; gap: 7px; }
  .hero-kicker::before { width: 17px; }
  .cultural-gallery { padding: 0; border: 0; max-width: 400px; justify-self: center; width: 100%; gap: 6px; }
  .culture-stamp svg { height: 65px; max-width: 62px; margin-bottom: 2px; }
  .culture-stamp:nth-child(even) { padding-top: 12px; }
  .culture-stamp figcaption { font-size: 9px; }
  .tabs { gap: 0; margin-bottom: 15px; }
  .tab { padding: 12px 7px; font-size: 13px; }
  .notice { font-size: 11px; margin-bottom: 15px; }
  .card-top h2 { font-size: 21px; }
  .map { padding: 12px; }
  .card-body, .card-top { padding: 19px; }
  .map { min-height: 300px; }
  .place { gap: 1px; min-width: 0; padding: 6px; }
  .place strong { font-size: 12px; }
  .place svg { width: 52px; height: 52px; }
  .scenario-lead { font-size: 12px; }
  .action-row { gap: 12px; }
  .action-group { width: 100%; justify-content: flex-end; }
  .choice { padding: 12px; }
  .choice b { font-size: 17px; }
  .metric-grid { grid-template-columns: 1fr; gap: 10px; }
  .metric { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 15px 18px; }
  .metric .value { grid-row: 1 / 3; grid-column: 2; align-self: center; margin: 0; font-size: 27px; }
  .metric .caption { margin-top: 1px; font-size: 12px; }
  .metric .eyebrow { font-size: 12px; }
  .section-intro { flex-wrap: wrap; }
  .table-wrap { overscroll-behavior-inline: contain; }
  .definition { font-size: 18px !important; }
  .flow { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ui-ripple { display: none !important; animation: none !important; }
  .btn:active:not(:disabled) { transform: none; }
}
.textbook-reference { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: #75664e; line-height: 1.8; }
.textbook-reference strong { color: #695635; }
.local-notice { margin-bottom: 20px; padding: 13px 16px; background: #f4e9cd; border-left: 3px solid #b18c4d; border-radius: 0 8px 8px 0; color: #71512d; font-size: 13px; line-height: 1.8; }
.local-notice a { color: #8b4030; font-weight: 650; text-underline-offset: 3px; }
.local-notice[hidden] { display: none; }
.workspace[hidden] { display: none; }
.scenario-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.scenario-picker .btn { text-align: left; flex: 1 1 230px; }
.scenario-picker .btn span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.scenario-picker .btn[aria-pressed='true'] { background: #f1e3ca; border-color: #ad8254; color: #79513a; }
.story-strip { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: center; gap: 10px; padding: 18px; background: #f4efdf; border-radius: 10px; margin-bottom: 18px; }
.story-strip span { display: block; font-size: 11px; color: var(--muted); }
.story-strip strong { display: block; font-size: 14px; margin-top: 5px; }
.story-strip .story-connector { text-align: center; font-size: 20px; color: #ac8b5d; }
@media(max-width:760px) { .scenario-picker { gap: 8px; } .scenario-picker .btn { flex-basis: 100%; } .story-strip { padding: 14px; gap: 7px; grid-template-columns: 1fr 20px 1fr; } .story-strip strong { font-size: 13px; } }
.answer-feedback {
  flex: 1 1 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.answer-feedback.error, .pill.error {
  color: #9b2f27;
  background: #fff1ed;
  border-color: #e5afa6;
}
.answer-feedback.success {
  color: #176044;
  background: #edf7ef;
  border-color: #b7d9c2;
}
@media print {
  body { background: #fff; }
  .cultural-gallery, .hero-kicker, .ui-ripple { display: none !important; }
}
