
:root { --cbt-blue: #0f4c81; --cbt-dark: #0a3055; --cbt-accent: #1a7fd4; --cbt-bg: #eef2f6; --cbt-card: #ffffff; --cbt-border: #d4dce4; --ok: #1e9e5a; --bad: #d64545; --warn: #e67e22; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--cbt-bg); color: #1c2b3a; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100vh; }
#cbt-topbar { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(90deg, var(--cbt-dark), var(--cbt-blue)); color: #fff; padding: 0 18px; height: 52px; flex: 0 0 52px; box-shadow: 0 2px 8px rgba(0,0,0,.25); z-index: 10; }
#cbt-topbar .brand { font-weight: 700; letter-spacing: .5px; font-size: 15px; }
#cbt-topbar .topbar-center { display: flex; align-items: center; gap: 10px; min-width: 0; }
#cbt-topbar .ex-title { font-size: 13px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.skill-badge { padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.skill-badge.listening { background: #7c3aed; } .skill-badge.reading { background: #0e7490; } .skill-badge.writing { background: #b45309; } .skill-badge.speaking { background: #be185d; }
#cbt-timer { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; background: rgba(255,255,255,.12); padding: 4px 14px; border-radius: 8px; }
#cbt-timer.warn { background: var(--warn); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .6; } }
#cbt-body { display: flex; flex: 1; min-height: 0; }
#cbt-navpanel { width: 210px; background: #f7f9fb; border-right: 1px solid var(--cbt-border); padding: 14px; overflow-y: auto; flex: 0 0 210px; }
.navpanel-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #64748b; margin-bottom: 10px; letter-spacing: 1px; }
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.qcell { height: 34px; border: 1px solid var(--cbt-border); background: #fff; border-radius: 6px; font-size: 13px; cursor: pointer; color: #334155; transition: all .12s; }
.qcell:hover { border-color: var(--cbt-accent); }
.qcell.answered { background: var(--cbt-accent); border-color: var(--cbt-accent); color: #fff; }
.qcell.current { outline: 2px solid var(--cbt-dark); outline-offset: 1px; }
.qcell.right { background: var(--ok); border-color: var(--ok); color: #fff; }
.qcell.wrong { background: var(--bad); border-color: var(--bad); color: #fff; }
#cbt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#cbt-scroll { flex: 1; overflow-y: auto; padding: 18px 26px 30px; }
.cbt-helpbar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #64748b; margin-bottom: 14px; }
.cbt-helpbar .spacer, .audio-tools .spacer { flex: 1; }
button.ghost { background: #fff; border: 1px solid var(--cbt-border); color: #334155; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
button.ghost:hover { border-color: var(--cbt-accent); color: var(--cbt-accent); }
button.ghost.small { padding: 2px 8px; font-size: 11px; }
button.primary { background: var(--cbt-accent); border: none; color: #fff; border-radius: 6px; padding: 9px 22px; font-size: 14px; font-weight: 600; cursor: pointer; }
button.primary:hover { background: var(--cbt-blue); }
.card { background: var(--cbt-card); border: 1px solid var(--cbt-border); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.cbt-intro { background: #e8f1fb; border-left: 4px solid var(--cbt-accent); padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.cbt-instructions { background: #fdf6e7; border-left: 4px solid var(--warn); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.passage-box { background: var(--cbt-card); border: 1px solid var(--cbt-border); border-radius: 10px; padding: 18px 22px; line-height: 1.7; font-size: 14.5px; }
.passage-box p { margin-bottom: 10px; }
.passage-box h3 { margin: 10px 0; color: var(--cbt-dark); }
.passage-box img { max-width: 100%; height: auto; }
.passage-col .passage-box { max-height: 72vh; overflow-y: auto; }
.cloze-q { margin-bottom: 18px; line-height: 2.1; font-size: 15px; }
.blank-input { border: none; border-bottom: 2px solid var(--cbt-accent); background: #f0f7ff; padding: 2px 8px; font-size: 14px; width: 130px; text-align: center; border-radius: 4px 4px 0 0; }
.blank-input.ok { border-bottom-color: var(--ok); background: #e8f7ee; }
.blank-input.bad { border-bottom-color: var(--bad); background: #fdeeee; }
.option { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border: 1px solid var(--cbt-border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-size: 14px; transition: all .12s; }
.option:hover { border-color: var(--cbt-accent); background: #f4f9ff; }
.option input { margin-top: 3px; }
.option.correct-opt { background: #e8f7ee; border-color: var(--ok); }
.option.wrong-opt { background: #fdeeee; border-color: var(--bad); }
.q-text { font-weight: 600; margin-bottom: 10px; font-size: 14.5px; }
.split { display: flex; gap: 18px; align-items: flex-start; }
.passage-col { flex: 1.15; min-width: 0; }
.question-col { flex: 1; min-width: 0; }
.question-col-full { max-width: 900px; }
.cbt-audio { background: var(--cbt-card); border: 1px solid var(--cbt-border); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
.cbt-audio audio { width: 100%; margin-bottom: 8px; }
.audio-tools { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #475569; flex-wrap: wrap; }
.audio-tools select { padding: 3px 6px; border: 1px solid var(--cbt-border); border-radius: 4px; }
.ab-status { font-weight: 600; color: var(--cbt-accent); font-size: 12px; }
.feedback-block { background: #fbfdff; border: 1px dashed #b8c9db; border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: 13.5px; line-height: 1.6; }
.fb-row { margin-bottom: 6px; }
.fb-row.ok { color: var(--ok); } .fb-row.bad { color: var(--bad); }
.fb-detail { color: #334155; background: #f4f8fc; padding: 8px 10px; border-radius: 6px; margin-top: 4px; }
.feedback { background: #e8f1fb; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-top: 6px; }
.option-fb { margin-top: 6px; padding: 6px 10px; border-radius: 6px; font-size: 12.5px; background: #f1f5f9; }
.option-fb.ok { background: #e8f7ee; color: #166534; }
.option-fb.bad { background: #fdeeee; color: #991b1b; }
.writing-split { align-items: stretch; }
.answer-col { display: flex; flex-direction: column; }
.writing-tools { display: flex; font-size: 13px; color: #475569; margin-bottom: 8px; }
#writing-box { flex: 1; min-height: 300px; border: 1px solid var(--cbt-border); border-radius: 8px; padding: 14px; font-size: 14.5px; line-height: 1.7; resize: vertical; font-family: inherit; }
.speaking-wrap { max-width: 820px; margin: 0 auto; }
.speaking-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.speak-q-num { font-weight: 800; color: var(--cbt-accent); font-size: 13px; }
.speak-q-text { font-size: 15px; line-height: 1.6; margin: 6px 0 10px; }
.speak-q-audio { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.speak-q-audio audio { flex: 1; height: 34px; }
.speak-notes { width: 100%; min-height: 56px; border: 1px solid var(--cbt-border); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; resize: vertical; font-family: inherit; }
#cbt-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border-top: 1px solid var(--cbt-border); padding: 10px 20px; flex: 0 0 56px; }
.nav-btn { background: #fff; border: 1px solid var(--cbt-border); border-radius: 6px; padding: 8px 18px; font-size: 13px; cursor: pointer; color: #334155; }
.nav-btn:hover { border-color: var(--cbt-accent); color: var(--cbt-accent); }
.modal { position: fixed; inset: 0; background: rgba(10, 30, 50, .55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal.hidden { display: none; }
.modal-card { background: #fff; border-radius: 14px; padding: 24px 28px; max-width: 640px; width: 100%; max-height: 82vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-card h3 { color: var(--cbt-dark); margin-bottom: 14px; }
.review-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.review-table td { border-bottom: 1px solid var(--cbt-border); padding: 6px 8px; }
.score-ring { width: 120px; height: 120px; border-radius: 50%; margin: 10px auto; background: conic-gradient(var(--cbt-accent) calc(var(--p) * 1%), #e2e8f0 0); display: flex; align-items: center; justify-content: center; }
.score-ring span { width: 92px; height: 92px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: var(--cbt-dark); }
.score-pct, .band { text-align: center; margin: 6px 0; font-size: 14px; color: #475569; }
.band { font-weight: 700; color: var(--cbt-accent); }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.empty { padding: 40px; text-align: center; color: #64748b; }
.index-wrap { max-width: 1080px; margin: 0 auto; padding: 30px 20px; overflow-y: auto; height: 100vh; }
.index-hero { background: linear-gradient(120deg, var(--cbt-dark), var(--cbt-accent)); color: #fff; border-radius: 16px; padding: 30px 34px; margin-bottom: 26px; }
.index-hero h1 { font-size: 26px; margin-bottom: 8px; }
.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.skill-card { background: #fff; border: 1px solid var(--cbt-border); border-radius: 14px; padding: 18px; cursor: pointer; transition: all .15s; text-decoration: none; color: inherit; display: block; }
.skill-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,76,129,.12); border-color: var(--cbt-accent); }
.skill-card h3 { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.skill-card .count { font-size: 13px; color: #64748b; }
.ex-list { margin-top: 26px; }
.ex-list h2 { font-size: 18px; color: var(--cbt-dark); margin-bottom: 12px; }
.ex-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.ex-table th, .ex-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #eef2f6; font-size: 13px; }
.ex-table th { background: #f8fafc; color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.ex-table a { color: var(--cbt-accent); text-decoration: none; }
.done-mark { color: var(--ok); font-weight: 700; }
@media (max-width: 900px) { #cbt-navpanel { display: none; } .split { flex-direction: column; } }
