* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f5f6f8; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, sans-serif; -webkit-tap-highlight-color: transparent; }
#app { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }

/* 首页 */
.view { padding: 20px; max-width: 480px; margin: 0 auto; }
.header { margin-bottom: 20px; }
.header h1 { font-size: 1.5rem; color: #1a1a1a; margin: 0 0 6px; }
.header p { font-size: 0.9rem; color: #666; margin: 0; }
.mode-switch { display: flex; gap: 10px; margin-bottom: 20px; }
.mode-btn { flex: 1; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px; background: #fff; font-size: 0.95rem; color: #666; cursor: pointer; transition: all 0.2s; }
.mode-btn.active { background: #1a5fb4; color: #fff; border-color: #1a5fb4; }
.mode-btn:hover { border-color: #1a5fb4; }
.list { display: flex; flex-direction: column; gap: 14px; }
.wrong-divider { margin: 20px 0 14px; text-align: center; position: relative; }
.wrong-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #e0e0e0; }
.wrong-divider span { position: relative; background: #f5f6f8; padding: 0 12px; color: #999; font-size: 0.85rem; }
.wrong-card { border-left: 3px solid #dc2626; }
.card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 8px rgba(0,0,0,.06); display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; cursor: pointer; border: none; width: 100%; text-align: left; font: inherit; }
.card .name { font-size: 1rem; color: #1a1a1a; }
.card .count { font-size: 0.85rem; color: #1a5fb4; }

/* 答题页 */
#view-answer { padding-bottom: 100px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: #fff; font-size: 0.85rem; color: #666; gap: 10px; }
.top #ans-category { color: #1a5fb4; cursor: pointer; text-decoration: underline; flex-shrink: 0; }
.top #ans-progress { flex: 1; text-align: center; }
.top #ans-type { color: #1a5fb4; flex-shrink: 0; }
.q { background: #fff; margin: 14px 0; border-radius: 12px; padding: 20px; box-shadow: 0 1px 8px rgba(0,0,0,.06); }
.q .title { font-size: 1rem; line-height: 1.6; color: #1a1a1a; margin-bottom: 20px; }
.feedback { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
.feedback-header { margin-bottom: 12px; }
.feedback-status { display: inline-block; padding: 6px 12px; border-radius: 6px; font-size: 0.9rem; font-weight: 600; }
.feedback-status.correct { background: #dcfce7; color: #16a34a; }
.feedback-status.wrong { background: #fee2e2; color: #dc2626; }
.feedback-content { display: flex; flex-direction: column; gap: 10px; }
.feedback-line { font-size: 0.9rem; line-height: 1.6; word-break: break-word; }
.feedback-line .label { color: #666; font-weight: 500; }
.feedback-line .value { color: #333; }
.feedback-line .value br { margin-bottom: 4px; }
.feedback-line.analysis .label { color: #1a5fb4; }
.feedback-line.analysis .value { color: #1a5fb4; }
.op { display: flex; flex-direction: column; gap: 14px; }
.opt { display: flex; align-items: flex-start; gap: 12px; font-size: 0.95rem; color: #333; cursor: pointer; }
.opt input { margin-top: 4px; }
.blank { display: flex; flex-direction: column; gap: 14px; }
.blank .row { display: flex; align-items: center; gap: 12px; }
.blank .label { font-size: 0.9rem; color: #666; min-width: 56px; }
.blank .in { flex: 1; font-size: 0.95rem; padding: 14px; border: 1px solid #e0e0e0; border-radius: 8px; }
.bar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; background: #fff; padding: 14px 16px; display: flex; gap: 10px; box-shadow: 0 -1px 8px rgba(0,0,0,.08); }
.bar button { flex: 1; font-size: 0.9rem; padding: 14px; border-radius: 10px; border: none; background: #f0f0f0; cursor: pointer; }
.bar button.primary { background: #1a5fb4; color: #fff; }
.bar button:disabled { opacity: .6; cursor: not-allowed; }

/* 答题卡 */
.mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); z-index: 100; }
.sheet { position: fixed; left: 20px; right: 20px; bottom: 120px; max-width: 440px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 18px; z-index: 101; max-height: 55vh; overflow: hidden; display: flex; flex-direction: column; }
.sheet-t { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.grid { display: flex; flex-wrap: wrap; gap: 10px; overflow: auto; }
.dot { width: 44px; height: 44px; line-height: 44px; text-align: center; font-size: 0.85rem; background: #f0f0f0; border-radius: 8px; cursor: pointer; }
.dot.done { background: #1a5fb4; color: #fff; }
.dot.on { border: 2px solid #1a5fb4; }

/* 结果页 */
.head { background: linear-gradient(135deg,#1a5fb4,#2d7dd2); color: #fff; padding: 28px 20px; }
.head h2 { font-size: 1.15rem; margin: 0 0 18px; }
.head .scores { display: flex; gap: 28px; margin-bottom: 10px; }
.head .item .v { font-size: 1.4rem; font-weight: 600; }
.head .item .l { font-size: 0.85rem; opacity: .9; margin-left: 4px; }
.head .pct { font-size: 0.9rem; opacity: .95; margin: 0; }
#res-list { padding: 14px 0 80px; }
#view-result .list .card { margin: 0 0 14px; display: flex; flex-direction: column; align-items: stretch; }
#view-result .card .row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
#view-result .card .no { font-size: 0.85rem; color: #999; flex-shrink: 0; }
#view-result .card .ok { flex-shrink: 0; font-size: 0.9rem; font-weight: 600; }
#view-result .card .ok.y { color: #16a34a; }
#view-result .card .ok.n { color: #dc2626; }
#view-result .card .preview { flex: 1; min-width: 0; font-size: 0.9rem; color: #333; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; word-break: break-word; }
#view-result .card .arr { font-size: 0.75rem; color: #999; flex-shrink: 0; }
#view-result .card .detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid #eee; display: flex; flex-direction: column; gap: 10px; }
#view-result .card .line { font-size: 0.9rem; color: #444; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
#view-result .card .line.title-full { font-size: 0.95rem; color: #1a1a1a; font-weight: 500; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
#view-result .card .line.analysis { color: #1a5fb4; }
.btns { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; padding: 16px; display: flex; gap: 14px; background: #fff; box-shadow: 0 -1px 8px rgba(0,0,0,.08); }
.btns button { flex: 1; font-size: 0.95rem; padding: 16px; border-radius: 10px; border: none; cursor: pointer; }
.btns .btn.out, .btns button.out { background: #f5f6f8; color: #333; }
.btns button:first-child { background: #1a5fb4; color: #fff; }
