* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #dfe7f3; color: #172033; font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
.app { width: 100%; max-width: 520px; min-height: 100vh; margin: 0 auto; background: #f7f9fd; box-shadow: 0 0 40px rgba(20,42,78,.12); }
.hero { padding: 34px 22px 24px; color: #fff; background: linear-gradient(145deg, #09275f 0%, #0f3778 64%, #194d9b 100%); }
.hero-kicker { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .5px; opacity: .9; }
.hero h1 { margin: 18px 0 10px; font-size: 42px; line-height: 1.03; letter-spacing: -1.8px; }
.hero p { margin: 0; max-width: 360px; color: rgba(255,255,255,.86); font-size: 15px; line-height: 1.6; }
.sub-header { display: flex; gap: 12px; align-items: flex-start; padding: 18px 16px 16px; color: #fff; background: #0f3778; }
.sub-header h1 { margin: 2px 0 4px; font-size: 24px; letter-spacing: -1px; }
.sub-header p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; }
.back-btn { width: 38px; height: 38px; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; font-weight: 900; }
.app-main { padding: 16px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.quick-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; padding: 15px; border: 1px solid #dce5f3; border-radius: 20px; background: #fff; }
.quick-card strong { display: block; margin-bottom: 3px; color: #123a7d; }
.quick-card span { display: block; color: #718096; font-size: 13px; }
.mini-btn { flex: 0 0 auto; padding: 9px 12px; border-radius: 12px; background: #ff6f31; color: #fff; font-size: 13px; font-weight: 900; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 20px 2px 10px; }
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -.5px; }
.section-head a { color: #ff6f31; font-weight: 900; }
.panel { margin-bottom: 14px; padding: 16px; border: 1px solid #dce5f3; border-radius: 20px; background: #fff; box-shadow: 0 10px 24px rgba(15,55,120,.04); }
.panel h2 { margin: 0 0 12px; color: #123a7d; font-size: 18px; letter-spacing: -.5px; }
.panel.warning { border-color: #ffd29a; background: #fff8ec; }
.field-label { display: block; margin: 10px 0 6px; color: #516079; font-size: 13px; font-weight: 800; }
.input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid #ccd8ea; border-radius: 14px; background: #fbfdff; color: #172033; font-size: 15px; outline: none; }
.input:focus { border-color: #0f77ff; box-shadow: 0 0 0 3px rgba(15,119,255,.1); }
.btn-primary, .btn-danger { width: 100%; min-height: 50px; border: 0; border-radius: 15px; color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }
.btn-primary { background: #ff6f31; }
.btn-primary:disabled { background: #b9c3d2; cursor: not-allowed; }
.btn-danger { background: #df3348; }
.link-btn { display: flex; align-items: center; justify-content: center; }
.empty { padding: 28px 18px; border: 1px dashed #c9d6e8; border-radius: 20px; background: #fff; text-align: center; color: #718096; }
.empty strong { display: block; color: #123a7d; font-size: 18px; }
.empty p { margin: 8px 0 16px; line-height: 1.5; }
.empty.small { padding: 18px; }
.subject-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subject-card { min-height: 132px; padding: 16px; border: 1px solid #dce5f3; border-radius: 22px; background: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.subject-card strong { font-size: 21px; letter-spacing: -.8px; }
.subject-card em { color: #718096; font-style: normal; font-size: 13px; }
.subject-dot { width: 32px; height: 6px; border-radius: 99px; background: #ff6f31; }
.list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid #dce5f3; border-radius: 18px; background: #fff; }
.list-main { flex: 1; min-width: 0; }
.list-main strong { display: block; font-size: 17px; }
.list-main span { display: block; margin-top: 4px; color: #718096; font-size: 13px; }
.icon-btn { min-width: 54px; height: 38px; border: 0; border-radius: 12px; font-weight: 900; cursor: pointer; }
.icon-btn.danger { background: #fff0f2; color: #df3348; }
.note-list { display: grid; gap: 10px; }
.note-row { display: block; padding: 15px; border: 1px solid #dce5f3; border-radius: 18px; background: #fff; }
.note-row strong { display: block; margin: 7px 0 5px; font-size: 17px; letter-spacing: -.4px; }
.note-row span { color: #718096; font-size: 13px; }
.note-status { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #eaf1fb; color: #123a7d; font-size: 12px; font-weight: 900; }
.note-status.done { background: #e9f8ef; color: #178843; }
.note-status.failed { background: #fff0f2; color: #df3348; }
.note-status.analyzing { background: #fff8ec; color: #b66600; }
.capture-frame { position: relative; margin-bottom: 14px; padding: 18px; border: 2px dashed #8ca8ce; border-radius: 28px; background: #fff; aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.capture-frame:before { content: ""; position: absolute; inset: 16px; border-radius: 20px; background: linear-gradient(rgba(15,55,120,.04), rgba(15,55,120,.04)); }
.corner { position: absolute; width: 32px; height: 32px; border-color: #ff6f31; z-index: 2; }
.corner.tl { top: 18px; left: 18px; border-top: 4px solid; border-left: 4px solid; }
.corner.tr { top: 18px; right: 18px; border-top: 4px solid; border-right: 4px solid; }
.corner.bl { bottom: 18px; left: 18px; border-bottom: 4px solid; border-left: 4px solid; }
.corner.br { bottom: 18px; right: 18px; border-bottom: 4px solid; border-right: 4px solid; }
.capture-guide { position: relative; z-index: 3; padding: 20px; }
.capture-guide strong { display: block; color: #123a7d; font-size: 21px; letter-spacing: -.8px; line-height: 1.35; }
.capture-guide span { display: block; margin-top: 9px; color: #718096; font-size: 14px; line-height: 1.5; }
.camera-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border-radius: 16px; background: #0f3778; color: #fff; font-weight: 900; cursor: pointer; }
.camera-btn input { display: none; }
.preview-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.preview-item { position: relative; }
.preview-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid #dce5f3; }
.preview-item span { position: absolute; left: 6px; top: 6px; padding: 3px 7px; border-radius: 99px; background: rgba(15,55,120,.86); color: #fff; font-size: 11px; font-weight: 900; }
.tip-box { margin: 12px 0; padding: 13px; border-radius: 15px; background: #f1f6fd; color: #516079; }
.tip-box strong { display: block; color: #123a7d; margin-bottom: 4px; }
.tip-box p { margin: 0; font-size: 13px; line-height: 1.5; }
.loading-box { display: none; margin-top: 14px; padding: 20px; border: 1px solid #ffd29a; border-radius: 22px; background: #fff8ec; text-align: center; }
.loading-box h2 { margin: 12px 0 8px; font-size: 20px; color: #123a7d; }
.loading-box p { margin: 0; color: #6a4c1c; }
.thinking { width: 42px; height: 42px; margin: 0 auto; border: 5px solid #ffe0b8; border-top-color: #ff6f31; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-hero { padding: 20px; border-radius: 24px; background: #0f3778; color: #fff; }
.result-hero span { display: inline-flex; padding: 5px 9px; border-radius: 99px; background: rgba(255,255,255,.14); font-size: 12px; font-weight: 900; }
.result-hero h2 { margin: 12px 0 14px; font-size: 25px; letter-spacing: -1px; line-height: 1.3; }
.answer-line { display: flex; gap: 8px; flex-wrap: wrap; }
.answer-line b, .answer-line em { padding: 8px 11px; border-radius: 12px; font-style: normal; font-size: 13px; font-weight: 900; }
.answer-line b { background: #ff6f31; }
.answer-line em { background: rgba(255,255,255,.14); }
.image-slider { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.image-slider figure { flex: 0 0 86%; margin: 0; scroll-snap-align: start; }
.image-slider img { width: 100%; border-radius: 16px; border: 1px solid #dce5f3; }
.image-slider figcaption { margin-top: 6px; color: #718096; text-align: center; font-size: 12px; }
.lead { margin: 0; color: #26334a; line-height: 1.7; }
.wrong-reason { margin-top: 13px; padding: 14px; border-radius: 16px; background: #fff4ef; }
.wrong-reason strong { color: #d95720; }
.wrong-reason p { margin: 5px 0 0; line-height: 1.6; }
.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.check-list li { padding-left: 28px; position: relative; line-height: 1.55; }
.check-list li:before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #e9f8ef; color: #178843; text-align: center; font-weight: 900; }
.choice-list { display: grid; gap: 10px; }
.choice-item { padding: 13px; border-radius: 16px; background: #f6f9fd; }
.choice-item b { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: #0f3778; color: #fff; }
.choice-item span { margin-left: 6px; color: #ff6f31; font-weight: 900; }
.choice-item p { margin: 8px 0 0; line-height: 1.55; }
.spark-card { margin: 14px 0; padding: 20px; border-radius: 24px; background: linear-gradient(135deg, #fff7d6, #fff); border: 1px solid #ffdc73; }
.spark-card h2 { margin: 0 0 10px; color: #9b6100; font-size: 19px; }
.spark-card p { margin: 0; line-height: 1.7; font-weight: 800; color: #4e3812; }
.panel.teacher { background: #f8fbff; }
.panel.similar { border-color: #b8cdf0; }
.similar-choices { margin: 12px 0; padding-left: 23px; line-height: 1.7; }
details summary { cursor: pointer; font-weight: 900; color: #0f3778; }
.answer-box { margin-top: 10px; padding: 13px; border-radius: 14px; background: #e9f8ef; }
.answer-box p { margin: 7px 0 0; line-height: 1.6; }
.review-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.review-btn { padding: 9px 11px; border: 1px solid #dce5f3; border-radius: 12px; background: #fff; color: #516079; font-weight: 900; }
.review-btn.on { border-color: #ff6f31; background: #fff4ef; color: #ff6f31; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); width: calc(100% - 32px); max-width: 480px; padding: 13px 15px; border-radius: 14px; background: rgba(23,32,51,.94); color: #fff; text-align: center; opacity: 0; pointer-events: none; transition: .25s; z-index: 9999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 380px) {
    .subject-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 36px; }
}
