:root {
  --bg: #0b0d12; --panel: #141821; --panel2: #1b2030; --line: #262c3d; --text: #e7eaf2; --muted: #8b93a7;
  --accent: #7c5cff; --accent2: #22d3ee; --ok: #22c55e; --bad: #ef4444; --warn: #f59e0b; --radius: 12px;
  --text2: #cfd4e2; --code-bg: #10131b; --header-bg: rgba(11,13,18,.85); --shadow: none;
  --cta: linear-gradient(90deg, var(--accent), #4f7cff); --cta-text: #fff; --cta-shadow: none;
}
/* Tông sáng cho các trang công khai (trang chủ, Studio). Admin giữ tông tối. */
body.light {
  --bg: #f6f7fb; --panel: #ffffff; --panel2: #f1f3f9; --line: #e2e6ef; --text: #151a2b; --muted: #5b647a;
  --accent: #6a45ff; --accent2: #0e8fb0; --ok: #15803d; --bad: #dc2626; --warn: #b45309;
  --text2: #2f3648; --code-bg: #f8f9fc; --header-bg: rgba(255,255,255,.88);
  --shadow: 0 1px 2px rgba(20,26,43,.04), 0 10px 30px -14px rgba(20,26,43,.14);
  /* Nút dẫn sang công cụ AI: cam–vàng, chữ tối (tương phản > 7:1), nổi nhất trên nền sáng */
  --cta: linear-gradient(135deg, #ffd23f 0%, #ffa41b 55%, #ff7a00 100%); --cta-text: #1f1400;
  --cta-shadow: 0 10px 24px -8px rgba(255,122,0,.6), inset 0 -2px 0 rgba(0,0,0,.08);
}
body.light { background: radial-gradient(1100px 520px at 12% -8%, rgba(106,69,255,.13), transparent 62%),
  radial-gradient(900px 460px at 92% -4%, rgba(255,164,27,.16), transparent 60%), var(--bg); background-repeat: no-repeat; }
body.light .card { box-shadow: var(--shadow); }
/* Khối kêu gọi sang công cụ AI: nền cam ấm, viền cam */
body.light .cta-zone { border-color: #ffc46b; background: radial-gradient(ellipse at top left, rgba(255,196,61,.28), transparent 70%), #fffaf0; }
body.light input, body.light select, body.light textarea { background: #fff; }
body.light .btn.ghost { background: #fff; }
body.light .toast { color: #fff; }
body.light .modal-bg { background: rgba(21,26,43,.45); }
/* Nút CTA affiliate: dùng chung cho mọi trang */
.btn.cta { background: var(--cta); color: var(--cta-text); box-shadow: var(--cta-shadow); text-decoration: none; display: inline-block; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, filter .15s; }
.btn.cta:hover { transform: translateY(-1px); filter: brightness(1.04) saturate(1.1); }
/* Vệt sáng chạy qua nút CTA chính để hút mắt */
.btn.cta.shine::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .btn.cta.shine::after { animation: none; display: none; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent2); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.btn { background: var(--accent); border: 0; color: #fff; padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
a.btn { text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: var(--bad); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
header.top { border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.logo span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.pill.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ok); color: #04130a; padding: 10px 18px; border-radius: 8px; font-weight: 600; z-index: 99; display: none; }
.toast.err { background: var(--bad); color: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { width: 100%; max-width: 640px; padding: 22px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
@media (max-width: 640px) { .row { flex-direction: column; gap: 0; } }
