/* DeutschAI Pro 样式 —— 手机优先，与主站品牌色统一 */
:root {
  --brand: #1a3a5c;
  --brand-light: #2c5d8f;
  --accent: #c9a227;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2a36;
  --text-soft: #5a6a7a;
  --muted: #9aa7b5;
  --line: #e5e9ef;
  --green: #2e7d32;
  --red: #c0392b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

/* 顶部栏 */
.app-topbar {
  background: var(--brand);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.tb-title { font-weight: 700; font-size: 1.05rem; letter-spacing: .5px; }
.tb-level {
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 2px 12px;
  font-weight: 800;
  font-size: .85rem;
}

.app-main { max-width: 560px; margin: 0 auto; padding: 16px; }

/* 视图切换 */
.view { animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 等级测评 */
.onboard-hero { text-align: center; padding: 28px 0 8px; }
.onboard-hero h1 {
  font-size: 1.7rem;
  line-height: 1.35;
  margin: 0 0 12px;
  color: var(--brand);
}
.onboard-hero .sub { color: var(--text-soft); font-size: .95rem; margin: 0; }

.quiz-card {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 3px 12px rgba(0,0,0,.06);
}
.quiz-card h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--brand); }
.quiz-card .q-desc { color: var(--text-soft); font-size: .88rem; margin: 0 0 16px; }
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  background: #f7f9fb;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: .95rem;
  cursor: pointer;
  transition: .15s;
  color: var(--text);
}
.quiz-option:active { background: #eef3f8; }
.quiz-option.selected { border-color: var(--brand); background: #eef4fb; font-weight: 600; }

.quiz-nav { display: flex; gap: 10px; }
.quiz-nav button { flex: 1; padding: 14px; border-radius: 12px; border: none; font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn-prev { background: #eef1f5; color: var(--brand); }
.btn-next { background: var(--brand); color: #fff; }

/* 目标卡 */
.goal-card {
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 6px 18px rgba(26,58,92,.25);
}
.goal-top { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; opacity: .9; }
.goal-level { background: var(--accent); padding: 3px 14px; border-radius: 16px; font-weight: 800; font-size: 1rem; }
.goal-mid { margin: 18px 0 10px; font-size: .9rem; opacity: .9; }
.goal-target { font-size: 1.6rem; font-weight: 800; margin-top: 2px; }
.goal-days { font-size: 2.4rem; font-weight: 800; }
.goal-days span { color: var(--accent); }
.goal-progress { height: 10px; background: rgba(255,255,255,.25); border-radius: 10px; margin-top: 14px; overflow: hidden; }
.goal-bar { height: 100%; background: var(--accent); width: 0%; transition: width .4s; border-radius: 10px; }
.goal-pct { text-align: right; font-size: .85rem; margin-top: 6px; opacity: .9; }

/* 区块标题 */
.sec-title { font-size: 1.05rem; color: var(--brand); margin: 8px 0 12px; font-weight: 700; }

/* 任务列表 */
.task-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.task-item {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  cursor: pointer;
}
.task-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: transparent;
}
.task-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.task-info { flex: 1; }
.task-info .t-title { font-weight: 600; font-size: .95rem; }
.task-info .t-desc { color: var(--text-soft); font-size: .82rem; }

/* 模块网格 */
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.module-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  cursor: pointer;
}
.module-card .m-icon { font-size: 2rem; }
.module-card .m-name { font-weight: 700; margin-top: 6px; font-size: .95rem; }
.module-card .m-desc { color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* 子页头 */
.sub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 16px;
  font-weight: 700;
  color: var(--brand);
}
.back-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}
.count-badge { margin-left: auto; background: #eef1f5; border-radius: 12px; padding: 2px 10px; font-size: .8rem; color: var(--text-soft); }

/* 词汇卡片 */
.vocab-card { background: var(--card); border-radius: 18px; padding: 28px 22px; text-align: center; box-shadow: 0 3px 12px rgba(0,0,0,.06); margin-bottom: 16px; }
.vocab-card .ger { font-size: 2rem; font-weight: 800; color: var(--brand); }
.vocab-card .phon { color: var(--muted); font-size: .9rem; margin: 6px 0; }
.vocab-card .zh { font-size: 1.1rem; margin: 10px 0 4px; }
.vocab-card .pos { color: var(--muted); font-size: .8rem; }
.vocab-example { background: #f7f9fb; border-radius: 12px; padding: 12px 16px; font-size: .88rem; color: var(--text-soft); margin-top: 16px; text-align: left; }

.vocab-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vocab-actions button { padding: 14px; border-radius: 12px; border: none; font-size: .95rem; font-weight: 700; cursor: pointer; }
.btn-again { background: #fdecea; color: var(--red); }
.btn-good { background: #e8f5e9; color: var(--green); }

/* 听力 */
.listen-card { background: var(--card); border-radius: 18px; padding: 22px; box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.listen-card h3 { margin: 0 0 8px; color: var(--brand); }
.listen-text { background: #f7f9fb; border-radius: 12px; padding: 16px; font-size: .95rem; margin: 14px 0; white-space: pre-wrap; }

/* 口语 / 写作 通用 */
.prompt-card { background: var(--card); border-radius: 18px; padding: 22px; box-shadow: 0 3px 12px rgba(0,0,0,.06); margin-bottom: 16px; }
.prompt-card h3 { margin: 0 0 8px; color: var(--brand); }
.prompt-text { font-size: 1.05rem; margin: 10px 0; color: var(--text); }
.template { background: #f7f9fb; border-radius: 12px; padding: 14px 16px; font-size: .9rem; margin: 10px 0; white-space: pre-wrap; }

textarea {
  width: 100%;
  min-height: 120px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: .95rem;
  resize: vertical;
  font-family: inherit;
}

/* 通用按钮 */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* toast */
.app-toast {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff; padding: 12px 22px;
  border-radius: 10px; font-size: .92rem; z-index: 999;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.app-toast.show { opacity: 1; }

/* 移动端适配 */
@media (max-width: 400px) {
  .app-main { padding: 12px; }
  .onboard-hero h1 { font-size: 1.5rem; }
}