/* 葡语视觉词汇 V1 · modern warm design */
:root {
  --bg: #faf6ee;
  --card: #ffffff;
  --ink: #2b2620;
  --muted: #8a7f70;
  --line: #e9e0d0;
  --green: #2f6b4f;
  --green-d: #245741;
  --terra: #c96f4a;
  --gold: #d9a441;
  --red: #c0392b;
  --blue: #2e6fa3;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(60, 45, 25, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.2rem; background: rgba(250, 246, 238, .96);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--green); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4rem; }
.topnav { display: flex; gap: .2rem; align-items: center; }
.topnav a {
  text-decoration: none; color: var(--ink); font-size: .95rem;
  padding: .55rem .8rem; border-radius: 10px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.topnav a.active, .topnav a:hover { background: #efe7d6; }
.badge {
  background: var(--terra); color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 999px; padding: .05rem .45rem; margin-left: .25rem;
}
.container { max-width: 980px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.5rem; border-top: 1px solid var(--line); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem; margin-bottom: 1rem;
}
.card h2, .card h3 { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* stats grid */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow);
}
.stat .n { font-size: 1.7rem; font-weight: 800; color: var(--green); line-height: 1.2; }
.stat .l { font-size: .82rem; color: var(--muted); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; border-radius: 12px; padding: .8rem 1.3rem; font-size: 1rem; font-weight: 700;
  cursor: pointer; min-height: 48px; text-decoration: none; transition: transform .06s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); }
.btn-warm { background: var(--terra); color: #fff; }
.btn-ghost { background: #f1e9d8; color: var(--ink); }
.btn-danger { background: #f7e3de; color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; }

/* mode cards */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.mode-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow); cursor: pointer; text-align: left;
  display: block; width: 100%; font-size: 1rem; color: var(--ink); font-family: inherit;
}
.mode-card:hover { border-color: var(--green); }
.mode-card .t { font-weight: 800; font-size: 1.05rem; margin-bottom: .3rem; }
.mode-card .d { font-size: .86rem; color: var(--muted); }
.mode-card .c { font-size: .78rem; color: var(--green); margin-top: .4rem; font-weight: 700; }
.mode-card.disabled { opacity: .55; cursor: not-allowed; }

/* practice */
.q-img {
  width: 100%; max-height: 340px; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line); background: #f4eee1; display: block; margin: 0 auto;
}
.q-img-wrap { max-width: 520px; margin: 0 auto 1rem; }
.opts { display: grid; gap: .6rem; margin-top: 1rem; }
.opt {
  border: 2px solid var(--line); background: #fff; border-radius: 12px;
  padding: .9rem 1rem; font-size: 1.15rem; cursor: pointer; min-height: 56px;
  text-align: center; font-family: inherit; color: var(--ink); width: 100%;
}
.opt:hover:not(:disabled) { border-color: var(--green); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--green); background: #e6f2ea; }
.opt.wrong { border-color: var(--red); background: #fbe9e6; }
.feedback { margin-top: 1rem; padding: 1rem; border-radius: 12px; background: #f6f1e5; }
.feedback .ans { font-size: 1.4rem; font-weight: 800; color: var(--green); }
.progress-line { height: 8px; background: #eee4cf; border-radius: 99px; overflow: hidden; margin: .6rem 0; }
.progress-line > div { height: 100%; background: var(--green); border-radius: 99px; transition: width .3s; }

.spell-input {
  width: 100%; font-size: 1.4rem; padding: .9rem 1rem; border-radius: 12px;
  border: 2px solid var(--line); margin-top: 1rem; font-family: inherit;
}
.spell-input:focus { outline: none; border-color: var(--green); }

/* match game */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.match-col { display: grid; gap: .6rem; }
.mitem {
  border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
  padding: .4rem; min-height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-family: inherit; color: var(--ink); width: 100%;
}
.mitem img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }
.mitem.sel { border-color: var(--gold); background: #fdf6e3; }
.mitem.done { border-color: var(--green); background: #e6f2ea; opacity: .75; pointer-events: none; }
.mitem.err { border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* browse */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.filters input[type="search"], .filters select {
  font-size: .95rem; padding: .6rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font-family: inherit; min-height: 44px;
}
.filters input[type="search"] { flex: 1 1 200px; }
.sense-row {
  display: flex; gap: .8rem; align-items: center; padding: .8rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: .5rem;
  cursor: pointer;
}
.sense-row:hover { border-color: var(--green); }
.sense-row .lemma { font-weight: 800; font-size: 1.1rem; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 99px;
  padding: .12rem .55rem; margin: .1rem .15rem .1rem 0; white-space: nowrap;
}
.tag-A { background: #e6f2ea; color: var(--green); }
.tag-B { background: #fdf0dc; color: #a86a1c; }
.tag-C { background: #e8eef5; color: var(--blue); }
.tag-D { background: #f1ece2; color: var(--muted); }
.tag-img-ok { background: #e6f2ea; color: var(--green); }
.tag-img-no { background: #f7e3de; color: var(--red); }
.tag-fav { background: #fdeef3; color: #b03060; }
.tag-err { background: #fbe9e6; color: var(--red); }

.pager { display: flex; gap: .6rem; align-items: center; justify-content: center; margin: 1rem 0; }

/* detail */
.detail-img { max-width: 420px; margin: 0 auto 1rem; }
.img-ph { 
  border: 2px dashed var(--line); border-radius: 12px; padding: 2.2rem 1rem;
  text-align: center; color: var(--muted); background: #f8f4ea; font-size: .92rem;
}
.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: .3rem .8rem; font-size: .95rem; margin: .6rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.ex { background: #f6f1e5; border-radius: 10px; padding: .7rem .9rem; margin: .5rem 0; }
.ex .pt { font-weight: 600; }
.ex .en, .ex .zh { font-size: .88rem; color: var(--muted); }

/* review / lists */
.review-item { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: .5rem; }

/* forms */
textarea.code {
  width: 100%; min-height: 120px; font-family: ui-monospace, monospace; font-size: .82rem;
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem; background: #fff;
}
input[type="number"].goal { width: 5rem; font-size: 1rem; padding: .5rem; border-radius: 8px; border: 1px solid var(--line); }

.notice { background: #fdf6e3; border: 1px solid #ecd9a8; border-radius: 12px; padding: .9rem 1.1rem; margin: .8rem 0; font-size: .92rem; }
.notice.warn { background: #fbe9e6; border-color: #eec2ba; }
h1 { font-size: 1.6rem; margin: 0 0 .4rem; }
h2 { font-size: 1.25rem; }
.hero { text-align: center; padding: 1.6rem 1rem; }
.hero p { color: var(--muted); max-width: 34rem; margin: .4rem auto; }

@media (max-width: 640px) {
  .topnav a { padding: .55rem .55rem; font-size: .88rem; }
  .brand { font-size: 1rem; }
  .match-grid { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 6rem 1fr; }
}

/* ---- 游戏化学习 (2026-10-29) ---- */
.scene-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; margin:14px 0; }
.scene-cell { padding:4px; border:2px solid #ddd; border-radius:12px; background:#fff; cursor:pointer; min-height:44px; }
.scene-cell img { width:100%; height:96px; object-fit:cover; border-radius:8px; display:block; }
.scene-cell.right { border-color:#2e9e5b; background:#e8f7ee; }
.scene-cell.wrong { border-color:#d64545; background:#fdecec; }
.scene-cell:disabled { opacity:.75; cursor:default; }
.opts.col { flex-direction:column; align-items:stretch; }
.chat .bubble { max-width:85%; padding:10px 14px; border-radius:16px; margin:8px 0; line-height:1.5; }
.chat .bubble.npc { background:#eef3ff; margin-right:auto; border-bottom-left-radius:4px; }
.chat .bubble.me { background:#e8f7ee; margin-left:auto; border-bottom-right-radius:4px; }
.sentence { font-size:1.35rem; font-weight:600; margin:16px 0; }
.sess-bar { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; padding:10px 14px; margin-bottom:12px; }
