:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #0d131e;
  --panel-2: #111a27;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #f4f7fb;
  --muted: #8e9aaa;
  --orange: #ff6b2c;
  --orange-soft: rgba(255,107,44,.14);
  --green: #56d39b;
  --yellow: #f5c464;
  --red: #ff667c;
  --cyan: #5ed5e8;
  --radius: 18px;
  --shadow: 0 22px 70px rgba(0,0,0,.32);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 70% -20%, rgba(44,76,112,.18), transparent 44%), var(--bg); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: #aeb8c6; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.card { background: linear-gradient(145deg, rgba(17,26,39,.96), rgba(11,17,27,.96)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-subtle { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 14px; }

.brand, .landing-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.brand-mark { width: 28px; height: 22px; display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 4px; border: 1px solid rgba(255,107,44,.38); border-radius: 7px; background: var(--orange-soft); }
.brand-mark i { display: block; width: 3px; border-radius: 3px; background: var(--orange); animation: meter 1.3s ease-in-out infinite alternate; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 13px; animation-delay: -.55s; }
.brand-mark i:nth-child(3) { height: 9px; animation-delay: -.2s; }
@keyframes meter { to { height: 4px; opacity: .55; } }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,107,44,.12), 0 0 18px rgba(255,107,44,.65); }

.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 58px); border-bottom: 1px solid var(--line); background: rgba(7,11,18,.82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.health-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.health-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 10px rgba(245,196,100,.5); }
.health-badge.is-online i { background: var(--green); box-shadow: 0 0 10px rgba(86,211,155,.6); }
.health-badge.is-offline i { background: var(--red); }
.ghost-link { color: #bdc7d4; font-size: 13px; transition: color .2s; }
.ghost-link:hover { color: #fff; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; font-size: 13px; transition: transform .16s, background .16s, border-color .16s, opacity .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .4; }
.button-primary { color: #fff; background: linear-gradient(135deg, #ff7436, #ee4e20); box-shadow: 0 9px 22px rgba(238,78,32,.22); }
.button-secondary { color: #e9eef5; background: rgba(255,255,255,.055); border-color: var(--line-strong); }
.button-secondary:hover:not(:disabled) { background: rgba(255,255,255,.09); }
.button-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.button-block { width: 100%; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.icon-button { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.035); cursor: pointer; font-size: 18px; color: #9ba8b8; }
.icon-button:hover { color: #fff; border-color: var(--line-strong); }

input { width: 100%; height: 45px; padding: 0 14px; color: var(--text); background: rgba(4,8,14,.62); border: 1px solid var(--line-strong); border-radius: 10px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: rgba(255,107,44,.72); box-shadow: 0 0 0 3px rgba(255,107,44,.1); }
input::placeholder { color: #596575; }
label { color: #aeb8c5; font-size: 12px; font-weight: 700; }

.app-shell { max-width: 1500px; margin: 0 auto; padding: 30px clamp(20px, 4vw, 58px) 56px; }
.login-panel { max-width: 840px; margin: 10vh auto 0; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; }
.login-copy { padding: 48px; background: radial-gradient(circle at 15% 10%, rgba(255,107,44,.15), transparent 46%); }
.login-copy h1 { margin: 0 0 14px; max-width: 480px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.login-copy p:last-child { max-width: 460px; margin: 0; color: var(--muted); line-height: 1.75; }
.login-form { padding: 48px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
.login-form label { margin-bottom: 9px; }
.input-row { display: flex; flex-direction: column; gap: 10px; }
.form-message { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-message.is-error { color: var(--red); }
.form-message.is-success { color: var(--green); }

.studio-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 26px; align-items: start; }
.studio-sidebar { position: sticky; top: 94px; max-height: calc(100vh - 118px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #263142 transparent; }
.section-heading, .card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2, .card-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.create-form { padding: 14px; display: grid; gap: 10px; margin-bottom: 14px; }
.session-list, .public-session-list { display: grid; gap: 8px; }
.session-card { overflow: hidden; background: rgba(255,255,255,.025); border: 1px solid transparent; border-radius: 12px; transition: background .18s, border-color .18s, transform .18s; }
.session-card:hover { background: rgba(255,255,255,.05); transform: translateX(2px); }
.session-card.is-selected { background: var(--orange-soft); border-color: rgba(255,107,44,.36); }
.session-item { width: 100%; padding: 14px; display: block; text-align: left; color: inherit; background: transparent; border: 0; cursor: pointer; }
.session-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.session-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.session-item small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.session-quick-actions { display: flex; gap: 4px; padding: 0 8px 8px; overflow-x: auto; scrollbar-width: none; }
.session-quick-actions button { flex: 0 0 auto; padding: 4px 7px; color: #9eabba; background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 9px; }
.session-quick-actions button:hover:not(:disabled) { color: #fff; border-color: var(--line-strong); }
.session-quick-actions button:disabled { display: none; }
.mini-state { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.mini-state.is-live { color: var(--orange); }
.list-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; }

.studio-main { min-width: 0; }
.empty-state { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state h2 { margin: 16px 0 6px; }
.empty-state p { color: var(--muted); margin: 0; }
.empty-orbit { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid rgba(255,107,44,.26); border-radius: 50%; color: var(--orange); font-size: 32px; box-shadow: inset 0 0 28px rgba(255,107,44,.08), 0 0 48px rgba(255,107,44,.08); }
.detail-stack { display: grid; gap: 18px; }
.detail-header { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.detail-header h1 { margin: 8px 0 4px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.detail-header p { margin: 0; font-size: 12px; }
.title-line { display: flex; gap: 8px; align-items: center; }
.state-pill, .signal-pill { padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.state-pill { color: var(--yellow); background: rgba(245,196,100,.11); }
.state-pill.is-live { color: var(--orange); background: var(--orange-soft); }
.state-pill.is-ended { color: #97a1ad; background: rgba(255,255,255,.06); }
.signal-pill { color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.signal-pill.has-signal { color: var(--green); border-color: rgba(86,211,155,.25); background: rgba(86,211,155,.08); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 18px; }
.video-card, .control-card, .publish-card { padding: 20px; }
.inline-actions { display: flex; gap: 8px; }
.video-frame { position: relative; margin-top: 16px; overflow: hidden; background: #020408; border: 1px solid var(--line); border-radius: 12px; aspect-ratio: 16/9; }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #020408; }
.video-watermark { position: absolute; top: 12px; left: 12px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 7px; color: #fff; background: rgba(0,0,0,.54); backdrop-filter: blur(8px); font-size: 10px; font-weight: 800; letter-spacing: .08em; pointer-events: none; }
.player-status { min-height: 20px; margin: 11px 2px 0; color: var(--muted); font-size: 12px; }
.player-status[data-tone="success"] { color: var(--green); }
.player-status[data-tone="warning"] { color: var(--yellow); }
.player-status[data-tone="error"] { color: var(--red); }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.action-button { min-height: 76px; padding: 13px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; color: #e7edf5; text-align: left; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: border-color .18s, background .18s; }
.action-button:hover:not(:disabled) { background: rgba(255,255,255,.07); border-color: var(--line-strong); }
.action-button:disabled { opacity: .35; cursor: not-allowed; }
.action-button b { font-size: 13px; }
.action-button small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.action-open { border-color: rgba(255,107,44,.22); background: rgba(255,107,44,.07); }
.action-danger:hover:not(:disabled) { border-color: rgba(255,102,124,.34); background: rgba(255,102,124,.07); }
.replay-row { margin-top: 13px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.replay-row b, .replay-row small { display: block; }
.replay-row b { font-size: 12px; }
.replay-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.secure-note { color: var(--green); font-size: 10px; font-weight: 800; }
.card-intro { max-width: 720px; margin: 8px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.credential { min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; padding: 13px 14px; background: rgba(3,7,12,.6); border: 1px solid var(--line); border-radius: 10px; }
.credential label { grid-column: 1/-1; color: #778393; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.credential code { align-self: center; overflow: hidden; color: #d8e0eb; text-overflow: ellipsis; white-space: nowrap; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.copy-button { padding: 3px 7px; color: var(--orange); background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 800; }
.metrics-row { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.metrics-row div { padding: 16px 12px 2px; border-right: 1px solid var(--line); }
.metrics-row div:last-child { border-right: 0; }
.metrics-row span, .metrics-row b { display: block; }
.metrics-row span { color: var(--muted); font-size: 10px; }
.metrics-row b { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; font-size: 17px; white-space: nowrap; }
.error-banner { margin: 15px 0 0; padding: 10px 12px; color: #ffafbb; background: rgba(255,102,124,.08); border: 1px solid rgba(255,102,124,.2); border-radius: 9px; font-size: 12px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(360px, calc(100vw - 48px)); padding: 11px 15px; color: #fff; background: #202a38; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; font-size: 12px; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.watch-page { background: radial-gradient(circle at 25% -10%, rgba(255,107,44,.11), transparent 37%), var(--bg); }
.watch-topbar { position: relative; }
.audience-label { padding: 5px 8px; color: #a6b0bd; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 6px; font-size: 10px; font-weight: 800; }
.watch-shell { max-width: 1480px; margin: 0 auto; padding: 34px clamp(20px, 4vw, 58px) 60px; display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; }
.watch-stage { min-width: 0; }
.watch-heading { min-height: 92px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.watch-heading h1 { margin: 0 0 7px; font-size: clamp(26px, 3vw, 40px); letter-spacing: -.04em; }
.watch-heading p { margin-top: 0; font-size: 12px; }
.viewer-count { min-width: 92px; text-align: right; }
.viewer-count span, .viewer-count b { display: block; }
.viewer-count span { color: var(--muted); font-size: 10px; }
.viewer-count b { margin-top: 4px; font-size: 24px; }
.watch-video-frame { margin-top: 0; border-radius: 16px; box-shadow: 0 28px 80px rgba(0,0,0,.42); }
.watch-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; pointer-events: none; background: radial-gradient(circle at 50% 40%, #101722, #030508 68%); }
.watch-placeholder span { color: #3c4654; font-size: 40px; }
.watch-placeholder b { margin-top: 14px; color: #bdc6d2; font-size: 14px; }
.watch-placeholder small { max-width: 380px; margin-top: 7px; line-height: 1.6; }
.watch-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.watch-transport-panel { margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.watch-transport-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-transport-buttons [aria-pressed="true"] { color: var(--orange); border-color: var(--orange); background: rgba(255,107,44,.1); }
.watch-transport-status { margin: 12px 0 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.watch-transport-detail { margin: 6px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.watch-transport-detail:empty { display: none; }
.watch-sidebar { padding: 19px; align-self: start; }
.watch-sessions-toggle { display: none; }
.public-session-list { max-height: 580px; overflow-y: auto; padding-right: 2px; }
.audience-note { margin: 20px 2px 0; padding-top: 16px; color: #647080; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.65; }

.landing-page { overflow: hidden; background: #060a10; }
.landing-shell { min-height: 100vh; max-width: 1360px; margin: 0 auto; padding: 38px clamp(24px, 6vw, 80px) 30px; display: flex; flex-direction: column; justify-content: space-between; position: relative; z-index: 2; }
.ambient { position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.ambient-one { width: 580px; height: 580px; left: -220px; top: 12%; background: radial-gradient(circle, rgba(255,89,31,.13), transparent 67%); }
.ambient-two { width: 650px; height: 650px; right: -180px; top: -260px; background: radial-gradient(circle, rgba(47,106,152,.13), transparent 66%); }
.hero { width: min(990px, 100%); margin: auto 0; padding: 7vh 0; }
.hero h1 { margin: 12px 0 24px; font-size: clamp(42px, 7vw, 88px); line-height: .99; letter-spacing: -.06em; font-weight: 780; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero-copy { max-width: 680px; margin: 0 0 36px; color: #8f9baa; font-size: clamp(15px, 2vw, 18px); line-height: 1.8; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; max-width: 820px; }
.entry-card { min-height: 116px; padding: 20px; display: flex; align-items: center; gap: 15px; background: rgba(255,255,255,.028); border: 1px solid var(--line); border-radius: 15px; transition: transform .2s, border-color .2s, background .2s; }
.entry-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.05); }
.entry-primary { background: linear-gradient(135deg, rgba(255,107,44,.18), rgba(255,107,44,.07)); border-color: rgba(255,107,44,.3); }
.entry-icon { flex: 0 0 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 13px; color: #fff; background: rgba(255,255,255,.05); font-weight: 900; }
.entry-primary .entry-icon { color: var(--orange); background: rgba(255,107,44,.12); border-color: rgba(255,107,44,.26); }
.entry-content { min-width: 0; flex: 1; }
.entry-content b, .entry-content small { display: block; }
.entry-content b { font-size: 15px; }
.entry-content small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.entry-arrow { color: #778392; font-size: 20px; }
.landing-footer { display: flex; gap: 28px; color: #4f5b69; font-size: 10px; letter-spacing: .08em; }

@media (max-width: 1050px) {
  .detail-grid { grid-template-columns: 1fr; }
  .watch-shell { grid-template-columns: 1fr; }
  .watch-sidebar { order: -1; }
  .watch-sessions-toggle { display: flex; width: 100%; }
  .watch-sidebar:not(.is-expanded) .public-session-list,
  .watch-sidebar:not(.is-expanded) .audience-note { display: none; }
  .watch-sidebar.is-expanded .watch-sessions-toggle { margin-bottom: 12px; }
  .public-session-list { max-height: 40vh; display: grid; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .topbar { padding: 0 18px; }
  .ghost-link, .audience-label { display: none; }
  .app-shell, .watch-shell { padding-left: 14px; padding-right: 14px; }
  .login-panel { grid-template-columns: 1fr; margin-top: 3vh; }
  .login-copy, .login-form { padding: 28px; }
  .login-form { border-left: 0; border-top: 1px solid var(--line); }
  .studio-layout { grid-template-columns: 1fr; }
  .studio-sidebar { position: static; max-height: none; }
  .session-list { grid-template-columns: 1fr 1fr; }
  .detail-header { align-items: flex-start; flex-direction: column; }
  .credential-grid, .metrics-row { grid-template-columns: 1fr 1fr; }
  .metrics-row div:nth-child(2) { border-right: 0; }
  .entry-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(40px, 13vw, 62px); }
  .landing-footer { flex-wrap: wrap; gap: 10px 20px; }
  .public-session-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .health-badge span { display: none; }
  .session-list, .public-session-list { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .credential-grid, .metrics-row { grid-template-columns: 1fr; }
  .metrics-row div { border-right: 0; border-bottom: 1px solid var(--line); }
  .metrics-row div:last-child { border-bottom: 0; }
  .card-heading { align-items: flex-start; flex-direction: column; }
  .inline-actions { width: 100%; }
  .inline-actions .button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
