:root{--primary: #c45500;--primary-dark: #a34000;--primary-soft: #fff3e6;--bg: #faf8f5;--ink: #2a1f0e;--muted: #8c7a6b;--border: #e8dfd4;--warn: #f59e0b;--err: #dc2626;--user-bg: #e6f0fa;--ai-bg: #fff7ed;--user-bd: #4078b0;--ai-bd: #d4731a}.compliance-banner{position:sticky;top:0;z-index:100;background:#fff3cd;border-bottom:1px solid #e8df4d;color:#5a4a00;padding:10px 40px;text-align:center;font-size:14px;display:flex;align-items:center;justify-content:center;gap:12px;animation:banner-in .3s ease-out}.compliance-banner .close{background:none;border:none;font-size:18px;cursor:pointer;color:inherit;opacity:.7;margin:0;padding:0 4px}.compliance-banner .close:hover{opacity:1}@keyframes banner-in{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}*{box-sizing:border-box}html,body{margin:0;padding:0;font-family:Noto Sans Arabic,Amiri,Noto Naskh Arabic,WenQuanYi Zen Hei,Microsoft YaHei,system-ui,sans-serif;color:var(--ink);background:var(--bg);line-height:1.7}#app{max-width:880px;margin:0 auto;padding:18px 18px 64px}.appbar{margin-bottom:14px}.appbar h1{margin:0 0 4px;font-size:22px;color:var(--primary);display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;border-bottom:3px solid var(--primary-soft);padding-bottom:8px}.appbar h1 .ar{font-size:18px;color:var(--primary-dark);font-weight:500}.appbar .subtitle{margin:4px 0 0;color:var(--muted);font-size:13px}.appbar a{color:var(--primary);text-decoration:none}.appbar a:hover{text-decoration:underline}.tabs{display:flex;gap:4px;border-bottom:2px solid var(--border);margin-bottom:16px;overflow-x:auto}.tab{border:none;background:transparent;padding:10px 18px;font-size:14px;cursor:pointer;border-radius:8px 8px 0 0;color:var(--muted);font-family:inherit;white-space:nowrap;border-bottom:3px solid transparent;margin-bottom:-2px;transition:background .15s,color .15s,border-color .15s}.tab:hover{background:#0f766e0f;color:var(--primary)}.tab.active{background:transparent;color:var(--primary);border-bottom-color:var(--primary);font-weight:600}.panel{background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px 22px;margin-bottom:16px}.panel h2{font-size:18px;color:var(--primary);margin:0 0 8px;border-bottom:1px solid var(--primary-soft);padding-bottom:6px}.panel h3{font-size:15px;color:var(--primary-dark);margin:16px 0 8px}.panel h4{font-size:14px;color:var(--muted);margin:12px 0 6px}.hint{color:var(--muted);font-size:13px;margin:0 0 14px}.hint code{background:#f1f5f9;padding:1px 5px;border-radius:3px;font-size:12px}button.primary{background:var(--primary);color:#fff;border:none;padding:8px 16px;border-radius:6px;font-family:inherit;font-size:14px;cursor:pointer;transition:background .15s}button.primary:hover:not(:disabled){background:var(--primary-dark)}button.primary:disabled{background:#cbd5e1;cursor:not-allowed}button.ghost{background:transparent;color:var(--primary);border:1px solid var(--primary);padding:6px 12px;border-radius:6px;font-family:inherit;font-size:13px;cursor:pointer;margin-inline-start:8px}button.ghost:hover:not(:disabled){background:var(--primary-soft)}button.ghost:disabled{color:#94a3b8;border-color:#cbd5e1;cursor:not-allowed}.chat-window{min-height:240px;max-height:480px;overflow-y:auto;padding:8px 4px;margin-bottom:12px;display:flex;flex-direction:column;gap:10px}.empty{text-align:center;color:var(--muted);padding:32px 8px}.empty .seed-list{list-style:none;padding:0;display:flex;flex-direction:column;gap:6px;margin:16px auto 0;max-width:520px}.seed{background:#fff;border:1px dashed var(--border);padding:8px 12px;border-radius:8px;cursor:pointer;text-align:start;width:100%;font-family:inherit;font-size:13px;color:var(--ink);transition:background .15s,border-color .15s}.seed:hover{background:var(--primary-soft);border-color:var(--primary)}.msg{border-radius:10px;padding:10px 14px;max-width:80%;white-space:pre-wrap;word-break:break-word}.msg-role{font-size:11px;color:var(--muted);margin-bottom:3px;font-weight:600}.msg-content{font-size:15px;line-height:1.6}.msg-content h1,.msg-content h2,.msg-content h3{margin:8px 0 4px}.msg-content p{margin:4px 0}.msg-content ul,.msg-content ol{margin:4px 0;padding-inline-start:20px}.msg-content li{margin-bottom:2px}.msg-content code{background:#eee;padding:1px 4px;border-radius:3px;font-size:13px}.msg-content pre{background:#f4f4f4;padding:8px 12px;border-radius:6px;overflow-x:auto}.msg-content pre code{background:none;padding:0}.msg-content blockquote{border-inline-start:3px solid var(--primary);margin:6px 0;padding:4px 12px;color:var(--muted)}.msg-content table{border-collapse:collapse;margin:6px 0}.msg-content th,.msg-content td{border:1px solid var(--border);padding:4px 8px;text-align:start}.msg-content strong{color:var(--primary)}.msg-sources{margin-top:8px;font-size:12px}.msg-sources summary{cursor:pointer;color:var(--muted)}.msg-sources summary:hover{color:var(--primary)}.source-item{padding:3px 0;border-bottom:1px dotted var(--border)}.source-score{color:var(--primary);font-weight:600;margin-right:6px}.source-text{color:var(--muted)}.msg-user{background:var(--user-bg);border-inline-start:3px solid var(--user-bd);align-self:flex-end}.msg-assistant{background:var(--ai-bg);border-inline-start:3px solid var(--ai-bd);align-self:flex-start}.msg-assistant.loading{opacity:.6}.composer{display:flex;gap:8px;align-items:stretch;flex-wrap:wrap}.composer textarea{flex:1 1 240px;min-height:60px;border:1px solid var(--border);border-radius:8px;padding:8px 10px;font-family:inherit;font-size:14px;resize:vertical}.composer textarea:focus{outline:none;border-color:var(--primary)}.error{margin-top:10px;background:#fef2f2;border:1px solid #fecaca;color:var(--err);padding:8px 12px;border-radius:6px;font-size:13px}.search{width:100%;padding:10px 14px;border:1px solid var(--border);border-radius:8px;font-size:14px;font-family:inherit;margin-bottom:14px}.search:focus{outline:none;border-color:var(--primary)}.gloss-cat{margin-bottom:14px}.gloss-list{list-style:none;padding:0;display:grid;gap:8px}.gloss-row{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px 14px;display:grid;grid-template-columns:1fr 1fr;gap:4px 14px}.gloss-row .ar{font-size:18px;color:var(--primary-dark);font-weight:600;grid-column:1;grid-row:1;text-align:end;direction:rtl}.gloss-row .zh{font-size:15px;color:var(--ink);grid-column:2;grid-row:1}.gloss-row .root{grid-column:1;grid-row:2;font-size:12px;color:var(--muted);direction:rtl;text-align:end}.gloss-row .root code{background:#f1f5f9;padding:1px 5px;border-radius:3px}.gloss-row .note{grid-column:2;grid-row:2;font-size:12px;color:var(--muted);line-height:1.5}.empty-small{color:var(--muted);text-align:center;padding:20px}.translator{margin-bottom:16px}.row{display:flex;gap:16px;margin-bottom:10px;flex-wrap:wrap;align-items:center}.row label{font-size:13px;color:var(--ink)}.row label.check{display:inline-flex;gap:6px;align-items:center}.row select,.field-fill input{padding:4px 8px;border:1px solid var(--border);border-radius:4px;font-family:inherit;font-size:13px}.translator textarea{width:100%;border:1px solid var(--border);border-radius:8px;padding:8px 10px;font-family:inherit;font-size:14px;margin-bottom:8px;resize:vertical}.translator textarea:focus{outline:none;border-color:var(--primary)}.translate-result{margin-top:12px;padding:12px;background:var(--ai-bg);border-radius:8px;border-inline-start:3px solid var(--ai-bd)}.ar{direction:rtl}.ar.big{font-size:18px;line-height:1.9}hr{border:none;border-top:1px solid var(--border);margin:18px 0}.templates{margin-top:12px}.field-fill{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px;padding:8px 0}.field-fill label{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:2px}.field-fill input{margin-top:2px}.template-preview{background:#f1f5f9;border:1px solid var(--border);border-radius:8px;padding:12px 16px;margin:8px 0;font-family:inherit;font-size:15px;direction:rtl;text-align:right;white-space:pre-wrap;word-break:break-word;max-height:320px;overflow-y:auto}background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 14px 0; } font-size: 12px; color: var(--primary); font-weight: 700; margin-bottom: 6px; } font-size: 20px; unicode-bidi: plaintext; } .appfoot{text-align:center;color:var(--muted);font-size:12px;margin-top:24px;padding-top:12px;border-top:1px solid var(--border)}.appfoot a{color:var(--primary);text-decoration:none}.appfoot a:hover{text-decoration:underline}.report-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:16px}.report-card{background:#f0fdf7;border:1px solid var(--border);border-radius:8px;padding:12px 16px}.report-card h4{margin:0 0 6px;font-size:14px;color:var(--muted)}.report-card .big{margin:0}.report-section{margin-top:12px;padding:10px 14px;background:#fafafa;border-radius:6px}.report-section h4{margin:0 0 6px}.report-section ul{margin:0;padding-inline-start:20px}.report-section li{margin-bottom:4px}.birthday-banner{position:relative;overflow:hidden;text-align:center;padding:14px 16px 16px;font-weight:700;font-size:18px;color:#fff;background:linear-gradient(135deg,#1a1a3e,#3a1063 40%,#7a1a4d 75%,#1a1a3e);border-bottom:1px solid rgba(255,255,255,.15);box-shadow:0 2px 12px #7a1a4d40}.birthday-text{position:relative;z-index:2;display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;text-shadow:0 1px 3px rgba(0,0,0,.4),0 0 12px rgba(255,200,80,.35);animation:bday-glow 3.2s ease-in-out infinite}.birthday-text .sep{opacity:.45;font-weight:400}.birthday-text .ar{font-size:19px}@keyframes bday-glow{0%,to{text-shadow:0 1px 3px rgba(0,0,0,.4),0 0 12px rgba(255,200,80,.35)}50%{text-shadow:0 1px 3px rgba(0,0,0,.4),0 0 22px rgba(255,220,140,.75)}}.birthday-fireworks{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;overflow:hidden}.birthday-fireworks span{position:absolute;left:50%;top:50%;width:6px;height:6px;border-radius:50%;background:transparent;opacity:0}@keyframes burst{0%{opacity:0;transform:translate(-50%,-50%) scale(.1)}10%{opacity:1}70%{opacity:1;transform:translate(var(--bx),var(--by)) scale(1.2)}to{opacity:0;transform:translate(var(--bx),var(--by)) scale(.4)}}.birthday-fireworks span:nth-child(1){--bx: -160px;--by: -20px;background:#ffd166;animation:burst 2.4s 0s infinite}.birthday-fireworks span:nth-child(2){--bx: 120px;--by: -30px;background:#ff6b6b;animation:burst 2.6s .2s infinite}.birthday-fireworks span:nth-child(3){--bx: -90px;--by: -45px;background:#4ecdc4;animation:burst 2.2s .4s infinite}.birthday-fireworks span:nth-child(4){--bx: 200px;--by: 10px;background:#f7b801;animation:burst 2.8s .6s infinite}.birthday-fireworks span:nth-child(5){--bx: -220px;--by: 25px;background:#b8b5ff;animation:burst 2.5s .8s infinite}.birthday-fireworks span:nth-child(6){--bx: 180px;--by: 45px;background:#06d6a0;animation:burst 2.3s 1s infinite}.birthday-fireworks span:nth-child(7){--bx: -40px;--by: -55px;background:#ff8fa3;animation:burst 2.7s .3s infinite}.birthday-fireworks span:nth-child(8){--bx: 60px;--by: 60px;background:#ffd166;animation:burst 2.5s .7s infinite}.birthday-fireworks span:nth-child(9){--bx: -130px;--by: 55px;background:#ef476f;animation:burst 2.4s 1.1s infinite}.birthday-fireworks span:nth-child(10){--bx: 150px;--by: -50px;background:#a0e7e5;animation:burst 2.6s .5s infinite}.birthday-fireworks span:nth-child(11){--bx: -180px;--by: -10px;background:#ffb4a2;animation:burst 2.2s .9s infinite}.birthday-fireworks span:nth-child(12){--bx: 90px;--by: -25px;background:#fff3b0;animation:burst 2.8s 1.3s infinite}.birthday-fireworks span:after{content:"";position:absolute;left:-3px;top:-3px;width:12px;height:12px;border-radius:50%;box-shadow:0 0 0 0 currentColor,8px 8px 0 -2px currentColor,-8px -8px 0 -2px currentColor,8px -8px 0 -2px currentColor,-8px 8px 0 -2px currentColor,14px 0 0 -3px currentColor,-14px 0 0 -3px currentColor,0 14px 0 -3px currentColor,0 -14px 0 -3px currentColor;color:inherit;opacity:.55;animation:trail-pulse 2s ease-in-out infinite}@keyframes trail-pulse{0%,to{opacity:.25;transform:scale(.85)}50%{opacity:.7;transform:scale(1.1)}}@media (prefers-reduced-motion: reduce){.birthday-fireworks span,.birthday-fireworks span:after,.birthday-text{animation:none!important}.birthday-fireworks span{opacity:.25}}.admin-login-card{max-width:420px;margin-top:16px;padding:18px 20px;border:1px solid #f0d0a0;border-left:4px solid var(--primary);border-radius:8px;background:linear-gradient(to bottom,#fffaf2,#fff5e8)}.admin-login-card h3{margin:0 0 8px;color:var(--primary);font-size:17px}.admin-login-card .row{display:flex;align-items:center;gap:10px;margin:8px 0}.admin-login-card .row label{width:100px;font-size:14px;color:var(--muted)}.admin-login-card input[type=text],.admin-login-card input[type=password]{flex:1;padding:6px 10px;border:1px solid #d0b890;border-radius:4px;font-size:14px}.admin-login-card a{color:var(--primary)}.admin-login-card .error{font-size:13px}.textbook-layout{display:flex;gap:20px;margin-top:12px}.toc-sidebar{flex:0 0 260px;border:1px solid var(--border);border-radius:8px;overflow:hidden}.toc-item{padding:8px 12px;cursor:pointer;border-bottom:1px solid var(--border);transition:background .15s}.toc-item:hover{background:#f0fdf7}.toc-item.active{background:var(--primary);color:#fff}.toc-item:last-child{border-bottom:none}.toc-chapter{font-weight:600;font-size:13px;margin-right:8px}.toc-title{font-size:13px;color:inherit}.toc-item.active .toc-title{opacity:.9}.toc-content{flex:1;min-width:0;overflow-x:auto}
