
    :root { --ink:#172235; --accent:#1f6feb; --accent-dark:#174ea6; --line:#d8dfeb; --right:#19a957; --wrong:#d93b32; font-family:"Segoe UI",Roboto,Arial,sans-serif; }
    * { box-sizing:border-box; }
    body { margin:0; min-height:100vh; background:#000; color:var(--ink); overflow-x:hidden; -webkit-font-smoothing:antialiased; }
    body::before { content:""; position:fixed; inset:0; z-index:0; pointer-events:none; background:radial-gradient(ellipse at center,transparent 0%,transparent 48%,rgba(0,0,0,.56) 100%),linear-gradient(180deg,rgba(4,9,24,.16),rgba(0,0,0,.42)); }
    body::after { content:""; position:fixed; inset:-20%; z-index:0; pointer-events:none; opacity:.28; background:radial-gradient(ellipse at center,rgba(255,96,48,.25),transparent 28%); filter:blur(24px); }
    .galaxy-canvas { position:fixed; inset:0; z-index:0; width:100vw; height:100vh; pointer-events:none; }
    .topbar { position:relative; z-index:2; margin-bottom:18px; padding:16px max(18px,calc((100vw - 1040px)/2 + 18px)); background:rgba(10,19,38,.78); border:1px solid rgba(152,181,255,.22); border-left:0; border-right:0; box-shadow:0 12px 30px rgba(0,0,0,.22); backdrop-filter:blur(14px); }
    h1 { margin:0; padding-left:12px; border-left:6px solid #7dd3fc; color:#f7fbff; font-size:1.35rem; line-height:1.05; letter-spacing:0; }
    .test-info { width:min(784px,calc(100% - 36px)); margin:-4px auto 0; padding:12px 14px 13px; position:relative; z-index:1; border:1px solid #d6dde6; border-bottom:0; border-radius:8px 8px 0 0; overflow:hidden; background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,252,.92)); box-shadow:none; }
    .test-info::before { content:""; position:absolute; inset:0 0 auto; height:5px; background:linear-gradient(90deg,#ef3f2f,#ff8a1f,#38bdf8); }
    .test-info-top { display:flex; justify-content:space-between; gap:12px; margin-bottom:4px; align-items:baseline; }
    .test-info-test { display:inline-flex; align-items:center; min-height:28px; padding:0 10px; border-radius:6px; background:#ef3f2f; color:#fff; font-weight:900; letter-spacing:.12em; }
    .test-info-skill,.test-info-count,.test-info-instruction { font-weight:800; color:#313b4a; }
    .test-info-part { margin:2px 0; text-align:center; font-size:1.48rem; font-weight:900; color:#263241; }
    .test-info-count,.test-info-instruction { margin:0 0 8px; text-align:center; }
    .app { width:min(820px,100%); margin:0 auto; padding:0 18px 112px; position:relative; z-index:1; }
    .worksheet { border:1px solid #d6dde6; border-radius:0 0 8px 8px; background:#fffdf8; box-shadow:0 18px 46px rgba(25,38,57,.18); padding:26px 30px 32px; }
    .hero { height:420px; border:2px solid #172235; background:#f8fafc; display:grid; place-items:center; margin-bottom:18px; overflow:hidden; }
    .hero img { width:100%; height:100%; object-fit:cover; display:block; background:#f8fafc; }
    .sheet-title { text-align:center; font-size:1.8rem; font-weight:900; margin:0 0 18px; }
    .example-row,.answer-row { display:grid; grid-template-columns:32px minmax(180px,1fr) minmax(260px,1fr); gap:14px; align-items:center; margin:18px 0; font-size:1.25rem; }
    .number { text-align:center; font-weight:700; color:#334155; }
    label { font-weight:650; }
    .answer-line { min-height:42px; display:flex; align-items:center; gap:8px; border-bottom:2px dotted #334155; }
    .fixed-answer { font-weight:500; white-space:nowrap; }
    input { width:100%; min-width:0; height:36px; border:1.5px solid #21bbb5; border-radius:8px; background:rgba(255,255,255,.94); color:#172235; font-size:1.1rem; font-weight:800; text-align:center; outline:none; box-shadow:0 6px 16px rgba(21,170,163,.18); }
    input.correct { border-color:var(--right); background:#f0fff6; }
    input.wrong { border-color:var(--wrong); background:#fff4f3; }
    .submitbar { position:fixed; left:0; right:0; bottom:0; z-index:20; padding:10px 18px; background:rgba(8,16,34,.84); border-top:1px solid rgba(152,181,255,.22); box-shadow:0 -14px 32px rgba(0,0,0,.28); backdrop-filter:blur(16px); }
    .submitbar-inner { width:min(1040px,100%); margin:0 auto; display:flex; justify-content:space-between; align-items:center; gap:14px; }
    .audio-wrap { width:min(520px,100%); min-width:0; flex:1; }
    .audio-player { display:grid; grid-template-columns:auto auto minmax(120px,1fr) auto auto; gap:10px; align-items:center; min-height:54px; }
    .audio-button { width:38px; aspect-ratio:1; display:grid; place-items:center; border:0; border-radius:999px; background:var(--accent); color:#fff; cursor:pointer; box-shadow:0 10px 22px rgba(31,111,235,.3); }
    .audio-button.secondary { width:34px; background:#e5f0ff; color:#174ea6; box-shadow:none; }
    .audio-button svg { width:18px; height:18px; fill:currentColor; }
    .audio-time { min-width:43px; color:#91a4bd; font-size:.86rem; font-weight:800; text-align:center; font-variant-numeric:tabular-nums; }
    .audio-progress { width:100%; height:8px; appearance:none; border-radius:999px; outline:none; cursor:pointer; background:linear-gradient(90deg,var(--accent) var(--progress,0%),#c9d8ec var(--progress,0%)); }
    .audio-progress::-webkit-slider-thumb { appearance:none; width:18px; aspect-ratio:1; border:3px solid #fff; border-radius:999px; background:var(--accent); box-shadow:0 3px 8px rgba(31,72,126,.3); }
    .submit { min-height:50px; display:inline-flex; align-items:center; justify-content:center; gap:10px; padding:0 30px; border:0; border-radius:8px; background:#ff8a1f; color:#fff; font-weight:900; cursor:pointer; white-space:nowrap; box-shadow:0 12px 26px rgba(255,138,31,.26); }
    .submit svg { width:20px; height:20px; fill:currentColor; }
    .modal[hidden] { display:none; }
    .modal { position:fixed; inset:0; z-index:40; display:grid; place-items:center; padding:20px; background:rgba(2,6,23,.72); backdrop-filter:blur(12px) saturate(1.2); }
    .modal-panel { width:min(920px,100%); max-height:min(92vh,820px); display:grid; grid-template-rows:auto auto 1fr auto; background:#f8fafc; border:1px solid rgba(255,255,255,.7); border-radius:24px; box-shadow:0 35px 100px rgba(0,0,0,.48),0 0 0 1px rgba(99,102,241,.12); overflow:hidden; animation:result-pop .34s cubic-bezier(.2,.9,.25,1.15); }
    @keyframes result-pop { from { opacity:0; transform:translateY(18px) scale(.96); } to { opacity:1; transform:none; } }
    .modal-head { position:relative; display:flex; align-items:center; justify-content:space-between; padding:20px 28px; overflow:hidden; background:linear-gradient(120deg,#4338ca 0%,#2563eb 48%,#06b6d4 100%); color:#fff; }
    .modal-head::after { content:""; position:absolute; width:220px; height:220px; right:70px; top:-165px; border-radius:50%; border:36px solid rgba(255,255,255,.1); }
    .modal-head h2 { position:relative; z-index:1; display:flex; align-items:center; gap:10px; margin:0; font-size:1.32rem; font-weight:900; letter-spacing:.01em; }
    .modal-head h2::before { content:"✓"; width:34px; aspect-ratio:1; display:grid; place-items:center; border-radius:50%; background:rgba(255,255,255,.2); box-shadow:inset 0 0 0 1px rgba(255,255,255,.28); }
    .modal-close { position:relative; z-index:1; width:40px; aspect-ratio:1; display:grid; place-items:center; border:1px solid rgba(255,255,255,.26); border-radius:12px; background:rgba(255,255,255,.14); color:#fff; font-size:1.5rem; cursor:pointer; transition:background .18s ease,transform .18s ease; }
    .modal-close:hover { background:rgba(255,255,255,.26); transform:rotate(5deg); }
    .result-summary { display:flex; flex-wrap:wrap; gap:26px; align-items:center; padding:28px 34px; background:linear-gradient(135deg,#eef2ff 0%,#eff6ff 48%,#ecfeff 100%); border-bottom:1px solid #dbeafe; }
    .big-score { width:132px; min-width:132px; aspect-ratio:1; display:grid; place-items:center; padding:12px; border:8px solid rgba(255,255,255,.72); border-radius:50%; background:linear-gradient(145deg,#fb7185,#f97316); color:#fff; font-size:2rem; line-height:1; font-weight:950; text-align:center; box-shadow:0 18px 35px rgba(249,115,22,.24),inset 0 0 0 1px rgba(255,255,255,.25); }
    .result-perfect .big-score { background:linear-gradient(145deg,#10b981,#06b6d4); box-shadow:0 18px 35px rgba(16,185,129,.25),inset 0 0 0 1px rgba(255,255,255,.25); }
    .result-good .big-score { background:linear-gradient(145deg,#3b82f6,#8b5cf6); box-shadow:0 18px 35px rgba(79,70,229,.24),inset 0 0 0 1px rgba(255,255,255,.25); }
    .result-copy { min-width:240px; flex:1; }
    .result-copy::before { content:"KẾT QUẢ CỦA BẠN"; display:block; margin-bottom:7px; color:#6366f1; font-size:.75rem; font-weight:950; letter-spacing:.16em; }
    .result-copy h3 { margin:0 0 8px; color:#172554; font-size:1.55rem; line-height:1.2; font-weight:950; }
    .result-message { max-width:560px; margin:0; color:#526078; font-size:1rem; line-height:1.55; font-weight:650; }
    .explanations { min-height:0; overflow:auto; padding:24px 30px; background:#f1f5f9; scrollbar-color:#a5b4fc transparent; }
    .explanation-list { display:grid; gap:14px; margin:0; padding:0; list-style:none; }
    .explanation-item { position:relative; border:1px solid #dce5f0; border-left:5px solid #94a3b8; border-radius:14px; padding:16px 18px; background:#fff; box-shadow:0 7px 20px rgba(30,41,59,.06); }
    .explanation-item.correct { border-left-color:#22c55e; background:linear-gradient(90deg,#f0fdf4 0,#fff 18%); }
    .explanation-item.wrong { border-left-color:#ef4444; background:linear-gradient(90deg,#fff1f2 0,#fff 18%); }
    .explanation-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:8px; }
    .explanation-title-row h3 { margin:0; color:#1e293b; font-size:1.02rem; line-height:1.45; font-weight:900; }
    .explanation-item>p:not(.karaoke-quote) { margin:7px 0 0; color:#64748b; line-height:1.5; font-weight:600; }
    .result-pill { flex:0 0 auto; padding:6px 12px; border-radius:999px; font-size:.78rem; font-weight:950; letter-spacing:.02em; }
    .result-pill.correct { background:#dcfce7; color:#15803d; box-shadow:inset 0 0 0 1px #bbf7d0; }
    .result-pill.wrong { background:#ffe4e6; color:#be123c; box-shadow:inset 0 0 0 1px #fecdd3; }
    .karaoke-quote { margin-top:12px; padding:13px 15px; border:1px solid #dbeafe; border-radius:11px; background:#f8fbff; color:#475569; line-height:1.58; font-weight:600; }
    .karaoke-label { margin-right:4px; font-weight:900; }
    .karaoke-line { display:block; margin-top:4px; border-radius:6px; padding:3px 5px; transition:background 140ms ease; }
    .karaoke-line.active { background:#fff0c2; box-shadow:0 0 0 2px rgba(255,180,42,.18); }
    .karaoke-speaker { margin-right:5px; font-weight:900; color:#334155; }
    .karaoke-word { display:inline-block; margin-right:4px; padding:0 2px; border-radius:4px; transition:color 100ms ease,background 100ms ease; }
    .karaoke-word.past { color:#64748b; }
    .karaoke-word.active { color:#0f172a; background:#ffd36a; box-shadow:0 0 0 2px rgba(255,179,0,.2); }
    .clip-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
    .result-clip-button { min-height:40px; display:inline-flex; align-items:center; gap:8px; padding:0 18px; border:0; border-radius:10px; background:linear-gradient(135deg,#f59e0b,#f97316); color:#fff; font-weight:900; cursor:pointer; box-shadow:0 9px 18px rgba(249,115,22,.2); transition:transform .16s ease,box-shadow .16s ease; }
    .result-clip-button:hover { transform:translateY(-1px); box-shadow:0 12px 22px rgba(249,115,22,.28); }
    .result-clip-button svg { width:15px; height:15px; fill:currentColor; }
    .modal-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:12px; padding:18px 30px; border-top:1px solid #dbe4ef; background:#fff; }
    .action { min-height:46px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:0 22px; border:1px solid #cbd5e1; border-radius:11px; background:#fff; color:#334155; font-weight:900; cursor:pointer; transition:transform .16s ease,box-shadow .16s ease,background .16s ease; }
    .action:hover { transform:translateY(-1px); background:#f8fafc; box-shadow:0 8px 18px rgba(30,41,59,.1); }
    #reviewBtn { border-color:transparent; background:linear-gradient(135deg,#4f46e5,#2563eb); color:#fff; box-shadow:0 9px 20px rgba(37,99,235,.22); }
    .action svg { width:17px; height:17px; fill:currentColor; }
    .toast { position:fixed; left:50%; bottom:76px; z-index:50; translate:-50% 0; max-width:min(92vw,520px); padding:10px 14px; border-radius:8px; background:#111827; color:#fff; font-weight:800; opacity:0; pointer-events:none; transition:opacity 180ms ease,transform 180ms ease; }
    .toast.show { opacity:1; }
    .confetti-layer { position:fixed; inset:0; z-index:70; overflow:hidden; pointer-events:none; }
    .confetti-piece { position:absolute; top:-24px; left:var(--x); width:var(--w); height:var(--h); border-radius:2px; background:var(--color); opacity:0; transform:translate3d(0,-20px,0) rotate(0deg); animation:confetti-fall var(--duration) var(--delay) cubic-bezier(.16,.7,.28,1) forwards; }
    @keyframes confetti-fall { 8% { opacity:1; } 100% { opacity:0; transform:translate3d(var(--drift),105vh,0) rotate(var(--spin)); } }
    @media (prefers-reduced-motion:reduce) { .confetti-piece { display:none; } }
    @media (max-width:760px) { .example-row,.answer-row { grid-template-columns:28px 1fr; } .answer-line { grid-column:2; } .submitbar-inner { flex-direction:column; align-items:stretch; gap:8px; } .submit { width:100%; } .audio-player { grid-template-columns:auto auto minmax(72px,1fr) auto auto; gap:6px; } .modal { padding:10px; } .modal-panel { max-height:96vh; border-radius:18px; } .modal-head { padding:16px 18px; } .result-summary { justify-content:center; padding:22px 18px; text-align:center; } .big-score { width:112px; min-width:112px; font-size:1.7rem; } .result-copy { min-width:100%; } .result-copy h3 { font-size:1.3rem; } .explanations { padding:16px 12px; } .explanation-item { padding:14px; } .explanation-title-row { align-items:flex-start; } .modal-actions { padding:14px; } .action { flex:1 1 150px; } }
  
