:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(18, 24, 37, .88);
  --panel-2: #111827;
  --line: rgba(148, 163, 184, .17);
  --line-strong: rgba(96, 165, 250, .3);
  --text: #f3f6ff;
  --muted: #8793aa;
  --blue: #4c7dff;
  --cyan: #49d6ff;
  --green: #43d38b;
  --amber: #f4b860;
  --red: #ff6b7a;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

.ambient { position: fixed; width: 460px; height: 460px; border-radius: 50%; filter: blur(130px); opacity: .12; pointer-events: none; }
.ambient-one { top: -180px; left: 28%; background: #4361ee; }
.ambient-two { right: -180px; bottom: -180px; background: #1fb6d8; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.login-card { width: min(980px, 100%); min-height: 570px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; padding: 48px; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(135deg, rgba(18,25,42,.97), rgba(10,14,24,.97)); box-shadow: 0 35px 110px rgba(0,0,0,.55); position: relative; overflow: hidden; }
.login-card::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(76,125,255,.18), transparent 70%); left: -130px; bottom: -200px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: rgba(255,255,255,.05); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; }
.brand span { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.brand-large { position: absolute; top: 42px; left: 48px; z-index: 2; }
.brand-large img { width: 52px; height: 52px; border-radius: 16px; }
.brand-large strong { font-size: 22px; }
.login-copy { align-self: end; padding-bottom: 46px; position: relative; z-index: 1; }
.cloud-pill { display: inline-flex; padding: 7px 11px; border: 1px solid rgba(73,214,255,.25); border-radius: 99px; background: rgba(73,214,255,.07); color: #8fe8ff; font-size: 12px; }
.login-copy h1 { margin: 20px 0 14px; max-width: 520px; font-size: clamp(36px, 5vw, 62px); line-height: 1.06; letter-spacing: -.045em; }
.login-copy p { max-width: 520px; margin: 0; color: #a4aec1; font-size: 15px; line-height: 1.85; }
.login-form { align-self: center; display: flex; flex-direction: column; gap: 18px; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: rgba(7,11,19,.62); position: relative; z-index: 2; }
label { display: grid; gap: 9px; color: #bdc5d5; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #0b1020; color: var(--text); padding: 12px 13px; transition: .18s; }
input:focus, select:focus, textarea:focus { border-color: rgba(73,214,255,.55); box-shadow: 0 0 0 3px rgba(73,214,255,.08); }
.remember { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.remember input { width: auto; }
.form-error { min-height: 18px; color: #ff8994; font-size: 12px; }
.login-foot { position: absolute; right: 48px; bottom: 24px; color: #59657b; font-size: 11px; }

button { border: 0; cursor: pointer; }
.primary { border-radius: 10px; padding: 11px 16px; background: linear-gradient(135deg, #5685ff, #416bea); color: white; font-weight: 750; box-shadow: 0 8px 28px rgba(65,107,234,.22); }
.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary:disabled { opacity: .45; cursor: wait; transform: none; }
.wide { width: 100%; padding-block: 13px; }
.ghost { border: 1px solid var(--line); border-radius: 9px; padding: 9px 13px; background: rgba(255,255,255,.025); color: #b6c0d3; }
.ghost:hover { border-color: var(--line-strong); color: white; background: rgba(76,125,255,.08); }
.small { padding: 7px 10px; font-size: 12px; }

.app-shell { min-height: 100vh; }
.topbar { height: 70px; position: sticky; z-index: 50; top: 0; display: flex; align-items: center; gap: 30px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(9,13,22,.9); backdrop-filter: blur(24px); }
.top-status { display: flex; align-items: center; gap: 7px; margin-left: 20px; color: #aab5c9; font-size: 12px; }
.top-status small { color: #5f6b82; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px var(--green); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account strong, .account span { display: block; }
.account > div:last-of-type span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #6756e8, #3f8dff); font-weight: 800; }
.credits { display: flex; align-items: center; gap: 6px; margin-right: 12px; padding: 8px 12px; border: 1px solid rgba(244,184,96,.16); border-radius: 10px; background: rgba(244,184,96,.06); color: #d5d9e4; font-size: 12px; }
.credits span { color: var(--amber); }

main { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.panel { border: 1px solid var(--line); background: var(--panel); }
.sidebar { min-height: calc(100vh - 70px); border-width: 0 1px 0 0; padding: 22px 14px; }
.section-title, .members-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.section-title button, .members-head button { border-radius: 7px; padding: 5px 8px; background: rgba(76,125,255,.12); color: #8fb0ff; }
.team-list { display: grid; gap: 8px; margin-top: 12px; }
.team { width: 100%; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; }
.team:hover { background: rgba(255,255,255,.03); }
.team.active { border-color: rgba(76,125,255,.36); background: rgba(76,125,255,.13); }
.team-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #334160; font-weight: 800; }
.team b, .team small { display: block; }
.team b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.team small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.team i { color: #8290a8; font-size: 10px; font-style: normal; }
.join-team { width: 100%; margin-top: 10px; padding: 9px; border: 1px dashed rgba(148,163,184,.2); border-radius: 10px; background: transparent; color: #79869d; font-size: 11px; }
.join-team:hover { color: #a8c0ff; border-color: rgba(76,125,255,.4); }
.members-head { margin-top: 28px; }
.member-list { display: grid; gap: 5px; margin-top: 10px; }
.member { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; }
.member:hover { background: rgba(255,255,255,.025); }
.member-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #27344d; color: #b9c8e7; font-size: 11px; font-weight: 800; }
.member b, .member small { display: block; }
.member b { font-size: 12px; }
.member small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.member-actions { display: flex; align-items: center; gap: 4px; }
.member-actions select { width: 78px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; background: #111a2a; color: var(--text); font-size: 9px; }
.member-actions button { width: 24px; height: 24px; border-radius: 7px; background: rgba(255,95,115,.11); color: #ff8999; }
.online { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.content, .editor { min-width: 0; padding: 34px clamp(22px, 4vw, 58px) 60px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { color: #6d7b96; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3, p { margin-top: 0; }
.hero h1, .editor-head h1 { margin: 8px 0 8px; font-size: 30px; letter-spacing: -.025em; }
.hero p { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.7; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.stat { padding: 17px 18px; border-radius: 13px; }
.stat span, .stat b, .stat small { display: block; }
.stat span { color: var(--muted); font-size: 11px; }
.stat b { margin-top: 9px; font-size: 24px; }
.stat small { margin-top: 5px; color: #68758d; font-size: 10px; }
.green-text { color: var(--green) !important; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 15px; }
.toolbar h2 { margin: 0; font-size: 16px; }
.toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 15px; }
.project-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(150deg, rgba(22,30,46,.95), rgba(12,17,28,.95)); transition: .2s; }
.project-card:hover { transform: translateY(-2px); border-color: rgba(76,125,255,.4); box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.cover { height: 92px; display: flex; align-items: flex-end; justify-content: space-between; padding: 13px; background: radial-gradient(circle at 25% 10%, rgba(73,214,255,.28), transparent 38%), linear-gradient(125deg, #182542, #24213a); }
.cover span, .cover i { padding: 5px 8px; border-radius: 7px; background: rgba(6,10,18,.65); font-size: 10px; font-style: normal; }
.cover i { color: #75e2ff; }
.project-body { padding: 16px; }
.project-title { display: flex; justify-content: space-between; gap: 12px; }
.project-title h3 { margin: 0; font-size: 15px; }
.project-title span { color: var(--muted); font-size: 10px; }
.project-body p { min-height: 38px; margin: 12px 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.project-meta { display: flex; justify-content: space-between; color: #68758d; font-size: 10px; }
.enter { width: 100%; margin-top: 14px; padding: 9px; border: 1px solid rgba(76,125,255,.24); border-radius: 9px; background: rgba(76,125,255,.09); color: #a8bfff; font-weight: 700; }
.enter:hover { background: rgba(76,125,255,.18); }
.empty-state { display: grid; place-items: center; min-height: 300px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; color: var(--muted); }
.empty-state > * { margin: 0; }
.empty-state h3 { margin-top: -80px; color: #cbd4e5; }
.empty-state p { margin-top: -125px; font-size: 12px; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: rgba(76,125,255,.12); color: #88a7ff; font-weight: 900; }

.editor { padding-top: 24px; }
.editor-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; }
.editor-head h1 { margin-bottom: 0; }
.editor-meta { display: flex; align-items: center; gap: 8px; }
.editor-meta > span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: #9aa6bc; font-size: 10px; }
.live-badge { color: #83dfb2 !important; }
.live-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.editor-summary { display: grid; grid-template-columns: repeat(4, minmax(90px, 140px)) minmax(220px, 1fr); gap: 10px; margin-top: 22px; }
.editor-summary > div { min-height: 72px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.editor-summary span, .editor-summary b { display: block; }
.editor-summary span { color: var(--muted); font-size: 10px; }
.editor-summary b { margin-top: 8px; font-size: 18px; }
.active-editors div { margin-top: 9px; color: #b7c2d6; font-size: 11px; }
.editor-tabs { display: flex; gap: 6px; margin-top: 22px; border-bottom: 1px solid var(--line); }
.editor-tabs button { padding: 11px 14px; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
.editor-tabs button.active { border-color: var(--cyan); color: white; }
.editor-content { min-height: 430px; padding-top: 16px; }
.episode-card, .asset-card, .activity-row { border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.episode-card { margin-bottom: 12px; overflow: hidden; }
.episode-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.episode-head h3 { margin: 0; font-size: 14px; }
.episode-head span { color: var(--muted); font-size: 10px; }
.episode-actions { margin-left: auto; display: flex; gap: 7px; }
.segments { display: grid; gap: 1px; background: var(--line); }
.segment-row { display: grid; grid-template-columns: 70px 110px 96px minmax(260px, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; background: #101622; }
.segment-index { color: #738099; font-size: 11px; }
.segment-time { color: #9eabc0; font-size: 11px; }
.segment-prompt { min-height: 58px; resize: vertical; padding: 9px; font-size: 11px; line-height: 1.5; }
.segment-save { padding: 8px 10px; border-radius: 8px; background: rgba(76,125,255,.14); color: #9fb8ff; font-size: 10px; }
.segment-preview { width: 96px; height: 58px; overflow: hidden; display: grid; place-items: center; border-radius: 8px; background: #222b3c; color: var(--muted); font-size: 9px; }
.segment-preview img { width: 100%; height: 100%; object-fit: cover; }
.segment-actions { display: grid; gap: 7px; min-width: 96px; }
.segment-grid { padding: 8px 10px; border-radius: 8px; background: rgba(73,214,255,.1); color: #7edbf2; font-size: 10px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.asset-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.asset-toolbar b, .asset-toolbar span { display: block; }
.asset-toolbar b { font-size: 12px; }
.asset-toolbar span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.asset-toolbar > div:last-child { display: flex; gap: 8px; }
.asset-toolbar button { padding: 8px 10px; border-radius: 8px; background: rgba(76,125,255,.12); color: #a9bdff; font-size: 10px; }
.asset-toolbar button:disabled { opacity: .35; }
.asset-card { position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 12px; }
.asset-card.selected { border-color: rgba(73,214,255,.5); box-shadow: inset 0 0 0 1px rgba(73,214,255,.12); }
.asset-select { position: absolute; top: 7px; left: 7px; z-index: 2; }
.asset-select input { position: absolute; opacity: 0; pointer-events: none; }
.asset-select span { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 6px; background: #111827; }
.asset-select input:checked + span { border-color: var(--cyan); background: var(--cyan); }
.asset-select input:checked + span::after { content: '✓'; color: #07121a; font-size: 12px; font-weight: 900; }
.asset-thumb { width: 62px; height: 72px; overflow: hidden; border-radius: 9px; background: #243049; display: grid; place-items: center; color: #7d8ba4; font-size: 10px; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-card h3 { margin: 0; font-size: 13px; }
.asset-card p { margin: 6px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.asset-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.asset-tags span { padding: 4px 6px; border-radius: 5px; background: rgba(73,214,255,.08); color: #7edbf2; font-size: 9px; }
.asset-edit { margin-top: 9px; padding: 6px 9px; border: 1px solid rgba(76,125,255,.28); border-radius: 7px; background: rgba(76,125,255,.1); color: #a9beff; font-size: 9px; }
.activity-list { display: grid; gap: 8px; }
.activity-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 13px; }
.activity-row i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(76,125,255,.12); color: #9cb5ff; font-style: normal; }
.activity-row b, .activity-row span { display: block; }
.activity-row b { font-size: 11px; }
.activity-row span, .activity-row time { color: var(--muted); font-size: 9px; }

dialog { width: min(470px, calc(100vw - 32px)); border: 1px solid var(--line-strong); border-radius: 16px; background: #111827; color: var(--text); padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(3,6,12,.72); backdrop-filter: blur(7px); }
dialog form { display: grid; gap: 17px; padding: 24px; }
dialog h2 { margin: 0; font-size: 19px; }
dialog p { margin: -8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.dialog-actions button:not(.primary) { padding: 10px 14px; border-radius: 9px; background: rgba(255,255,255,.06); color: #aeb8ca; }
.dialog-actions.spread { align-items: center; justify-content: space-between; }
.dialog-actions.spread > div { display: flex; gap: 9px; }
.dialog-actions .danger { background: rgba(255,95,115,.12) !important; color: #ff8797 !important; }
.asset-dialog { width: min(760px, calc(100vw - 32px)); }
.asset-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.asset-dialog-head button { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.06); color: var(--muted); }
.asset-editor-layout { display: grid; grid-template-columns: 180px 1fr; gap: 18px; }
.asset-preview { min-height: 230px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #0b1020; color: var(--muted); font-size: 11px; }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.asset-fields .wide-field { grid-column: 1 / -1; }
.asset-fields label { color: var(--muted); font-size: 10px; }
.asset-fields input, .asset-fields select, .asset-fields textarea { margin-top: 6px; }
.toast { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translate(-50%, 24px); padding: 10px 15px; border: 1px solid var(--line); border-radius: 10px; background: #182033; color: #e7edfa; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; box-shadow: 0 15px 40px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,107,122,.45); color: #ff9ca6; }
.upload-overlay { position: fixed; z-index: 250; inset: 0; display: grid; place-items: center; background: rgba(3,6,12,.78); backdrop-filter: blur(9px); }
.upload-card { width: min(430px, calc(100vw - 32px)); padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #111827; text-align: center; }
.spinner { width: 38px; height: 38px; margin: 0 auto 18px; border: 3px solid rgba(255,255,255,.09); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
.upload-card h3 { margin: 0; }
.upload-card p { margin: 9px 0 16px; color: var(--muted); font-size: 11px; }
.upload-progress { height: 6px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.upload-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .2s; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .login-card { grid-template-columns: 1fr; padding-top: 120px; }
  .login-copy { padding-bottom: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .editor-head { grid-template-columns: auto 1fr auto; }
  .editor-meta { display: none; }
  .editor-summary { grid-template-columns: repeat(4, 1fr); }
  .active-editors { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .top-status, .credits, .account > div:not(.avatar) { display: none; }
  .topbar { padding-inline: 14px; }
  main { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; border-width: 0 0 1px; }
  .member-list { grid-template-columns: repeat(2, 1fr); }
  .content, .editor { padding: 22px 14px 42px; }
  .hero, .toolbar { align-items: stretch; flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .editor-head { grid-template-columns: 1fr auto; }
  .editor-head > button:first-child { grid-column: 1 / -1; justify-self: start; }
  .editor-summary { grid-template-columns: 1fr 1fr; }
  .segment-row { grid-template-columns: 50px 1fr; }
  .segment-preview { grid-column: 1 / -1; width: 100%; height: 120px; }
  .segment-prompt, .segment-actions { grid-column: 1 / -1; }
  .asset-editor-layout { grid-template-columns: 1fr; }
  .asset-preview { min-height: 180px; }
  .login-shell { padding: 12px; }
  .login-card { padding: 112px 22px 58px; gap: 28px; }
  .brand-large { left: 22px; }
  .login-form { padding: 22px; }
  .login-foot { left: 22px; right: 22px; text-align: center; }
}
