﻿:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #5266ff;
  --brand2: #7c3aed;
  --ok: #16a34a;
  --warn: #ea580c;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: radial-gradient(circle at 20% 0%, #e8ebff 0, transparent 30%), var(--bg); color: var(--ink); }
a { color: var(--brand); }
.shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.app { width: min(980px, 100%); height: min(760px, calc(100vh - 48px)); background: rgba(255,255,255,.82); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 24px 80px rgba(31,41,55,.12); border-radius: 28px; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.topbar { position:relative; display: flex; justify-content: space-between; align-items: center; gap:16px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.72); }
.topbar-brand { display:flex; align-items:center; min-width:0; flex:1 1 0; z-index:1; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.logo-badge { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: 0 10px 30px rgba(82,102,255,.3); }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; }
.progress { width: 160px; height: 8px; background: #edf0f7; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .25s; }
.chat { padding: 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.bubble-row { display: flex; gap: 10px; align-items: flex-end; }
.bubble-row.user { justify-content: flex-end; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: #eef2ff; color: var(--brand); font-weight: 800; }
.bubble { max-width: min(680px, 78%); padding: 13px 15px; border-radius: 18px; line-height: 1.55; white-space: pre-wrap; box-shadow: 0 6px 20px rgba(31,41,55,.05); }
.assistant .bubble { background: #fff; border-bottom-left-radius: 6px; border: 1px solid #eef0f5; }
.user .bubble { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: white; border-bottom-right-radius: 6px; }
.composer { padding: 16px 18px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.8); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.quick button, .pill { border: 1px solid #dfe3f0; background: white; color: #374151; padding: 8px 12px; border-radius: 999px; cursor: pointer; transition: .15s; }
.quick button:hover, .pill:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.quick-quote { color:#4b5563; font-size:14px; line-height:1.8; }
.input-row { display: flex; gap: 10px; }
input, textarea, select { border: 1px solid #dfe3f0; border-radius: 14px; padding: 12px 13px; font: inherit; outline: none; background: white; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(82,102,255,.12); }
.input-row input { flex: 1; }
button.primary { border: 0; border-radius: 14px; padding: 12px 18px; color: white; background: linear-gradient(135deg, var(--brand), var(--brand2)); font-weight: 700; cursor: pointer; }
button.primary:disabled { opacity: .55; cursor: not-allowed; }
button.ghost { border: 1px solid #dfe3f0; background: white; border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.voice-btn { border:1px solid #cdd5ff; background:#eef2ff; color:#4338ca; border-radius:14px; padding:12px 14px; font-weight:800; cursor:pointer; white-space:nowrap; }
.voice-btn.recording { background:#fee2e2; border-color:#fecaca; color:#b91c1c; }
.voice-btn:disabled { opacity:.55; cursor:not-allowed; }
.region-fetch-btn { border:1px solid #bfdbfe; background:#eff6ff; color:#2563eb; border-radius:10px; padding:6px 10px; font-weight:800; cursor:pointer; }
.region-fetch-btn:hover { background:#dbeafe; border-color:#93c5fd; }
.region-refreshing { display:inline-flex; align-items:center; gap:6px; color:#2563eb; font-weight:800; white-space:nowrap; }
.spinner { width:14px; height:14px; border:2px solid #bfdbfe; border-top-color:#2563eb; border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.start { max-width: 680px; text-align: center; padding: 40px; }
.start h1 { font-size: 42px; line-height: 1.1; margin: 12px 0; letter-spacing: -1px; }
.start p { color: var(--muted); font-size: 17px; line-height: 1.8; }
.note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.admin-body { padding: 22px; max-width: 1480px; margin: 0 auto; }
.admin-nav { position:relative; display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:18px; min-height:58px; }
.admin-nav > .school-system-title { position:absolute; left:50%; transform:translateX(-50%); }
.cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--card); border:1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 10px 40px rgba(31,41,55,.06); }
.action-card { min-height: 150px; display:flex; flex-direction:column; align-items:flex-start; }
.action-card button { margin-top:auto; align-self:flex-end; }
.kpi { font-size: 28px; font-weight: 800; }
.label { color: var(--muted); font-size: 13px; }
.cols { display:grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
table { width:100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align:left; padding: 10px 8px; border-bottom:1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; }
.goal { border:1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background:#fff; }
.goal-head { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.goal-title { font-weight: 750; }
.goal small { color: var(--muted); }
.field-tags { display:flex; gap:6px; flex-wrap: wrap; margin-top: 8px; }
.tag { background:#eef2ff; color:#4338ca; border-radius: 999px; padding:4px 8px; font-size:12px; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display:none; place-items:center; padding:20px; }
.modal.open { display:grid; }
.modal-card { background:white; width:min(780px, 100%); max-height:90vh; overflow:auto; border-radius:22px; padding:20px; }
.modal-card.wide { width:min(1120px, 100%); }
.embedded-panel { border:0 !important; box-shadow:none !important; padding:0 !important; border-radius:0 !important; background:transparent !important; }
.embedded-panel > h2:first-child,
.embedded-panel > div:first-child h2:first-child { display:none; }
.embedded-panel > p.label:first-of-type { margin-top:0; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-grid .full { grid-column:1/-1; }
.ai-config-row { border:1px solid var(--line); border-radius:12px; padding:12px; margin-top:12px; background:#fff; }
.ai-config-row summary { cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:12px; font-weight:800; color:#172033; list-style-position:inside; }
.details-hint { flex:0 0 auto; color:#2563eb; background:#eff6ff; border:1px solid #bfdbfe; border-radius:999px; padding:4px 9px; font-size:12px; font-weight:800; }
.details-body { max-height:0; overflow:hidden; opacity:.35; transition:max-height .24s ease, opacity .2s ease; }
.ai-config-row details[open] .details-body { opacity:1; }
.ai-config-row details.is-closing .details-body { opacity:.35; }
.details-inner { overflow:hidden; }
@media (max-width: 820px) { .cards, .cols, .form-grid { grid-template-columns:1fr; } .app { height: calc(100vh - 20px); border-radius: 20px; } .shell { padding:10px; } .start h1 { font-size:32px; } .meta { display:none; } }

.school-logo-wrap { min-width:0; flex:1 1 0; gap:22px; align-items:center; justify-content:flex-start; }
.school-title-logo { display:block; height:54px; max-width:min(560px, 38vw); object-fit:contain; }
.school-system-title { font-size:30px; font-weight:900; letter-spacing:-.4px; color:#172033; white-space:nowrap; text-align:center; min-width:0; }
.plain-user-link { color:#172033; text-decoration:none; font-weight:700; }
.plain-user-link:hover { color:var(--brand); text-decoration:none; }
.link-arrow { display:inline-block; margin-left:4px; font-size:.95em; transform:translateY(-1px); }
.client-school-logo { display:block; height:72px; max-width:min(720px, 88vw); object-fit:contain; margin:0 auto 8px; }
.client-topbar-logo { display:block; height:42px; max-width:min(430px, 32vw); object-fit:contain; }
.client-topbar-title { position:absolute; left:50%; top:50%; transform:translate(-50%, -50%); font-size:24px; font-weight:900; color:#172033; white-space:nowrap; letter-spacing:.04em; text-align:center; min-width:0; pointer-events:none; }
.end-interview-btn { position:relative; z-index:1; border:1px solid #dfe3f0; background:white; color:#374151; padding:9px 14px; border-radius:999px; cursor:pointer; font-weight:800; box-shadow:0 8px 24px rgba(31,41,55,.08); transition:.15s; }
.end-interview-btn:hover { color:var(--brand); border-color:#cdd5ff; transform:translateY(-1px); }
.end-interview-btn:disabled { opacity:.55; cursor:not-allowed; transform:none; }
@media (max-width: 1100px) { .school-system-title { font-size:22px; white-space:normal; max-width:46vw; } .school-title-logo { height:42px; max-width:32vw; } }
@media (max-width: 980px) { .school-system-title { font-size:20px; white-space:normal; } .school-title-logo { height:42px; max-width:42vw; } }
.topbar.stacked-topbar,
.admin-nav.stacked-topbar { flex-direction:column; justify-content:center; align-items:center; text-align:center; gap:10px; }
.topbar.stacked-topbar .client-topbar-title,
.admin-nav.stacked-topbar > .school-system-title { position:static; transform:none; white-space:normal; max-width:100%; pointer-events:auto; }
.topbar.stacked-topbar .topbar-brand,
.admin-nav.stacked-topbar .school-logo-wrap { flex:0 1 auto; justify-content:center; }
.topbar.stacked-topbar .client-topbar-logo,
.admin-nav.stacked-topbar .school-title-logo { max-width:86vw; }
.admin-nav.stacked-topbar > div:last-child { width:100%; display:flex; justify-content:center; }
@media (max-width: 820px) {
  .school-title-logo { height:38px; max-width:86vw; }
  .school-system-title { font-size:15px; white-space:normal; max-width:100%; }
  .client-school-logo { height:54px; }
  .client-topbar-logo { height:34px; max-width:84vw; }
  .client-topbar-title { position:static; transform:none; font-size:18px; white-space:normal; pointer-events:auto; }
  .end-interview-btn { padding:8px 10px; font-size:13px; }
  .topbar,
  .admin-nav { flex-direction:column; justify-content:center; align-items:center; text-align:center; gap:10px; }
  .topbar-brand,
  .school-logo-wrap,
  .admin-nav > .school-system-title { position:static; transform:none; flex:0 1 auto; justify-content:center; }
  .admin-nav > div:last-child { width:100%; display:flex; justify-content:center; }
}

