/* 途播工作台 — framework-free design tokens and components. */
:root {
  --bg: #0d1020;
  --panel: #171b2d;
  --panel-strong: #21263a;
  --line: #30364c;
  --text: #f5f6fb;
  --sub: #a7b0c8;
  --muted: #a7b0c8;
  --muted2: #99a4be;
  --pink: #ff31aa;
  --purple: #a447ff;
  --blue: #4e82ff;
  --cyan: #19d9e8;
  --green: #69d7a3;
  --teal: #69d7a3;
  --gold: #f2c66d;
  --red: #ff8799;
  --brand: linear-gradient(
    120deg,
    var(--pink),
    var(--purple) 34%,
    var(--blue) 67%,
    var(--cyan)
  );
  --radius: 12px;
  --shadow: 0 18px 56px #0005;
  --sidebar: 224px;
  font-family:
    "Noto Sans TC", "Microsoft JhengHei", Inter, "Segoe UI", sans-serif;
  color-scheme: dark;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  scroll-padding-top: 90px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-width: 320px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
a {
  color: var(--cyan);
}
img,
video {
  max-width: 100%;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
button,
a,
input,
select {
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
[tabindex="-1"]:focus {
  outline: none;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -70px;
  left: 20px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--cyan);
  color: var(--bg);
  border-radius: 6px;
}
.skip-link:focus {
  top: 12px;
}
.nav-wrap {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: #111527;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 30px 18px 22px;
  z-index: 30;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px 38px;
  text-decoration: none;
  color: var(--text);
}
.sidebar-brand img {
  width: 45px;
  height: 45px;
  border-radius: 12px;
}
.sidebar-brand strong {
  display: block;
  font-size: 25px;
  letter-spacing: 0.13em;
  line-height: 1.3;
}
.sidebar-brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--sub);
  margin-top: 4px;
}
.nav-caption {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--sub);
  padding: 0 14px;
  margin-bottom: 12px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 46px;
  padding: 11px 14px;
  color: var(--sub);
  font-weight: 500;
}
.nav-btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.nav-btn:hover {
  background: var(--panel-strong);
  color: var(--text);
}
.nav-btn.active {
  background: #21263a;
  color: var(--text);
  border-color: #39405b;
}
.nav-btn.active:before {
  content: "";
  position: absolute;
  left: -1px;
  top: 13px;
  bottom: 13px;
  width: 3px;
  background: var(--brand);
  border-radius: 2px;
}
.nav-btn.active svg {
  color: var(--cyan);
}
.sidebar-foot {
  margin-top: auto;
  padding: 22px 12px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
}
.sidebar-foot .dot {
  margin-right: 8px;
  background: var(--sub);
}
.sidebar-foot-sub {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  margin-top: 6px;
}
#mainView {
  margin-left: var(--sidebar);
  min-height: 100vh;
}
.header {
  height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  gap: 16px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 14px;
}
.breadcrumb > span:last-child {
  color: var(--text);
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}
.health {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--sub);
}
.health.warn {
  color: var(--gold);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
.health.warn .dot {
  background: var(--gold);
}
#workspace {
  max-width: 1536px;
  margin: auto;
  padding: 32px 36px 64px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.eyebrow {
  text-transform: uppercase;
  color: var(--sub);
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 600;
  margin-bottom: 8px;
}
h1 {
  font-size: 29px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-weight: 650;
}
.page-heading p:last-child {
  color: var(--sub);
  margin-top: 8px;
  font-size: 13px;
}
.section {
  margin-bottom: 26px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 17px;
  font-weight: 650;
}
.section-meta {
  color: var(--sub);
  font-size: 12px;
  font-weight: 400;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.form,
.guidance {
  padding: 24px;
}
.muted,
.setting-desc,
.engine-sub {
  color: var(--sub);
  font-size: 13px;
}
.btn,
.quick-btn,
.more,
.sheet-btn,
.add {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.5;
}
.btn:hover,
.quick-btn:hover,
.more:hover,
.sheet-btn:hover,
.add:hover {
  background: #2d344d;
  border-color: #626c89;
}
.btn-brand,
.add {
  background: #8a32d8;
  border-color: #a65aed;
  color: #fff;
}
.btn-brand:hover,
.add:hover {
  background: #9b40e9;
  border-color: #c186f2;
}
.btn-soft {
  background: transparent;
}
.btn-cyan {
  background: #193743;
  border-color: #38626e;
  color: #94edf3;
}
.btn-red,
.danger {
  background: #38232f;
  border-color: #865364;
  color: #ffadbb;
}
.btn-full {
  width: 100%;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--sub);
  min-height: 36px;
  padding: 5px;
  font-size: 12px;
}
.text-btn:hover {
  color: var(--cyan);
}
.status-badge {
  border: 1px solid #35564e;
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--green);
  white-space: nowrap;
}
.overview-intro {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 25px 0 28px;
  margin-bottom: 24px;
  overflow: hidden;
}
.overview-intro h2 {
  font-size: 25px;
  font-weight: 500;
  margin-bottom: 8px;
}
.overview-intro p {
  color: var(--sub);
  font-size: 13px;
}
.intro-mark {
  width: 140px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--pink);
  font-size: 30px;
}
.intro-mark i {
  width: 8px;
  height: 44px;
  border-radius: 4px;
  background: var(--purple);
}
.intro-mark i:nth-child(2) {
  height: 66px;
  background: var(--blue);
}
.intro-mark i:last-child {
  height: 29px;
  background: var(--cyan);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px 0;
}
.metric {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border: 0;
}
.metric-icon {
  grid-column: 2;
  grid-row: 1;
  color: var(--cyan);
  font-size: 14px;
}
.metric:last-child .metric-icon {
  color: var(--gold);
}
.metric-value {
  grid-row: 2;
  grid-column: 1;
  font-size: 31px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.metric-label {
  grid-row: 1;
  grid-column: 1;
  font-size: 12px;
  color: var(--sub);
}
.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 26px;
}
.attention,
.workflow {
  padding: 22px;
}
.attention-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.attention-row {
  padding: 15px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.attention-row strong {
  font-size: 13px;
  font-weight: 550;
}
.attention-row small {
  display: block;
  color: var(--sub);
  font-size: 12px;
  margin-top: 3px;
}
.attention-row .text-btn {
  margin-left: auto;
  flex: none;
}
.attention-row .dot {
  background: var(--gold);
}
.attention-empty {
  padding: 18px 0 24px;
}
.attention-empty strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}
.attention-empty p {
  color: var(--sub);
  font-size: 13px;
}
.workflow > button {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 15px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  color: var(--text);
  text-align: left;
}
.workflow > button > span:first-child {
  color: var(--sub);
  font-size: 22px;
  width: 27px;
}
.workflow > button > span:last-child {
  margin-left: auto;
  color: var(--sub);
}
.workflow strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.workflow small {
  display: block;
  color: var(--sub);
  font-size: 12px;
  margin-top: 3px;
}
.workflow button:hover strong {
  color: var(--cyan);
}
.system {
  padding: 22px 24px;
}
.system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.system-title {
  font-size: 15px;
  font-weight: 600;
}
.system-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.system-name {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 5px;
}
.system-value {
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.progress,
.storage-main-bar,
.video-progress-track {
  height: 4px;
  background: #343b54;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.progress span,
.storage-main-bar span {
  height: 100%;
  display: block;
  background: var(--blue);
  border-radius: inherit;
}
.progress span {
  width: 0;
}
.library-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.search-control {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 500px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 0 13px;
  color: var(--sub);
}
.search-control:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.search-control > span {
  font-size: 24px;
  line-height: 1;
}
.search-control input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  height: 44px;
  font-size: 13px;
}
.library-toolbar .select {
  width: 150px;
}
.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none;
  color: var(--sub);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 2px 12px;
  font-size: 13px;
  min-height: 44px;
  white-space: nowrap;
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--pink);
}
.tab:hover {
  color: var(--cyan);
}
.content-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.content-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 44px;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  position: relative;
}
.content-card:last-child {
  border-bottom: 0;
}
.thumb-wrap {
  width: 128px;
  aspect-ratio: 16/9;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  background: #242a40 url("/assets/relay-console-icon.png?v=1") center/34px
    no-repeat;
}
.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb[src=""],
.thumb:not([src]) {
  visibility: hidden;
}
.type-tag {
  position: absolute;
  left: 5px;
  bottom: 5px;
  background: #0d1020e8;
  padding: 1px 6px;
  color: var(--text);
  font-size: 9px;
  border-radius: 3px;
  letter-spacing: 0.07em;
}
.type-tag.live {
  color: #ffabdb;
}
.content-main {
  min-width: 0;
}
.content-name {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.content-meta {
  font-size: 11px;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.content-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 8px;
  color: var(--sub);
}
.content-status .dot {
  background: currentColor;
}
.online,
.ready-video {
  color: var(--green);
}
.loading {
  color: var(--gold);
}
.error {
  color: var(--red);
}
.disabled {
  color: var(--sub);
}
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.quick-btn {
  font-size: 11px;
  min-height: 36px;
  padding: 5px 11px;
  background: transparent;
}
.more {
  align-self: start;
  width: 44px;
  padding: 0;
  letter-spacing: 1px;
  background: transparent;
}
.error-text {
  color: var(--red);
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-top: 8px;
}
.video-progress {
  max-width: 420px;
  margin-top: 8px;
}
.video-progress-bar {
  height: 100%;
  background: var(--blue);
}
.video-progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--sub);
  font-size: 11px;
  margin-top: 4px;
}
.empty {
  padding: 44px 24px;
  text-align: center;
}
.empty-icon {
  font-size: 24px;
  color: var(--sub);
  margin-bottom: 12px;
  filter: grayscale(1);
}
.empty-title {
  font-size: 16px;
  font-weight: 550;
}
.empty-desc {
  font-size: 13px;
  color: var(--sub);
  max-width: 380px;
  margin: 8px auto 0;
}
.empty .btn {
  margin-top: 18px;
}
.input,
.select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #555f7c;
  border-radius: 7px;
  background: #101427;
  color: var(--text);
  padding: 11px 13px;
  font-size: 13px;
  min-width: 0;
}
.input::placeholder {
  color: #99a4be;
  opacity: 1;
}
.input:hover,
.select:hover {
  border-color: #7b85a1;
}
.field {
  margin-top: 20px;
}
.label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
}
.label span {
  font-size: 11px;
  color: var(--sub);
  font-weight: 400;
}
.search-row,
.url-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.search-row .input {
  flex: 1;
}
.search-row .btn {
  min-width: 90px;
}
.engine {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #1e2438;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.engine-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.engine-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  flex: none;
}
.engine-title {
  font-size: 13px;
  font-weight: 550;
}
.engine-sub {
  font-size: 11px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.engine-state {
  font-size: 11px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--sub);
  font-size: 12px;
  margin: 28px 0 5px;
}
.divider:before,
.divider:after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.notice {
  color: var(--red);
  font-size: 13px;
  padding: 12px 14px;
  border: 1px solid #704758;
  border-radius: 7px;
  margin-top: 14px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  background: #30212e;
}
.notice:empty {
  display: none;
}
.notice.info {
  color: #c0d3ff;
  border-color: #405782;
  background: #1c2b44;
}
.notice.ok {
  color: var(--green);
  border-color: #35564e;
  background: #192f30;
}
.connection-notice {
  background: #332a24;
  border: 1px solid #786647;
  color: #f2d79d;
  padding: 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 13px;
}
.setting + .setting {
  padding-top: 22px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
.setting-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.setting-desc {
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.setting .field {
  margin-top: 12px;
}
.results:not(:empty) {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.result {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.result:last-child {
  border: 0;
}
.result > img {
  width: 104px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 5px;
  background: var(--panel-strong);
}
.result-main {
  min-width: 0;
}
.result-title {
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.result-channel,
.result-state {
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
}
.result-state.live {
  color: #ffabdb;
}
.result-state.video {
  color: var(--cyan);
}
.add {
  font-size: 12px;
  min-width: 60px;
}
.add.exists {
  background: #1d3932;
  color: var(--green);
  border-color: #35564e;
}
#addPage > .section > .card,
#settingsPage > .section > .card {
  max-width: 880px;
}
#settingsPage > .section > .section-head {
  max-width: 880px;
}
.playlist {
  padding: 28px;
  margin-bottom: 26px;
}
.playlist-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.playlist-icon {
  width: 44px;
  height: 44px;
  border: 1px solid #605082;
  border-radius: 9px;
  background: #2c2440;
  color: #d3acff;
  display: grid;
  place-items: center;
  font-size: 27px;
  flex: none;
}
.playlist-title {
  font-size: 17px;
  font-weight: 600;
}
.playlist-desc {
  color: var(--sub);
  font-size: 13px;
  margin-top: 5px;
}
.url {
  min-width: 0;
  flex: 1;
  border: 1px solid #555f7c;
  background: #101427;
  padding: 13px;
  border-radius: 7px;
  font:
    12px/1.8 Consolas,
    monospace;
  overflow-wrap: anywhere;
  user-select: all;
}
.playlist-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}
.ready {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  font-size: 12px;
}
.guidance {
  margin-bottom: 26px;
}
.guidance p {
  color: var(--sub);
  font-size: 13px;
  margin-top: 12px;
}
.guidance ol {
  padding-left: 22px;
  color: var(--sub);
  font-size: 13px;
  line-height: 2.2;
}
.guidance li {
  padding-left: 4px;
  margin-bottom: 5px;
}
.backup-policy {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  font-size: 13px;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
  color: var(--sub);
}
.backup-policy code {
  color: var(--text);
  font:
    12px/1.8 Consolas,
    monospace;
  overflow-wrap: anywhere;
}
.guidance details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 22px;
}
.guidance summary {
  cursor: pointer;
  min-height: 40px;
  font-size: 13px;
}
.service-health-list {
  margin-top: 20px;
}
.service-health-row {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  gap: 14px;
}
.service-health-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.service-health-dot,
.event-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--sub);
  flex: none;
}
.service-health-row.ok .service-health-dot,
.event-row.ok .event-dot {
  background: var(--green);
}
.service-health-row.warning .service-health-dot,
.event-row.warning .event-dot {
  background: var(--gold);
}
.service-health-row.error .service-health-dot,
.event-row.error .event-dot {
  background: var(--red);
}
.service-health-name {
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
}
.service-health-detail {
  font-size: 12px;
  color: var(--sub);
  overflow-wrap: anywhere;
  margin-top: 3px;
}
.service-health-state {
  font-size: 11px;
  white-space: nowrap;
  color: var(--sub);
  min-width: 36px;
}
.service-health-row.ok .service-health-state {
  color: var(--green);
}
.service-health-row.warning .service-health-state {
  color: var(--gold);
}
.service-health-row.error .service-health-state {
  color: var(--red);
}
.service-health-card > .actions {
  margin-top: 16px;
}
.storage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 22px;
}
.storage-stat-name {
  font-size: 12px;
  color: var(--sub);
}
.storage-stat-value {
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.storage-main-bar {
  margin-top: 24px;
  height: 6px;
}
.storage-path {
  font:
    11px/1.8 Consolas,
    monospace;
  color: var(--sub);
  overflow-wrap: anywhere;
  margin-top: 12px;
}
.storage-warning {
  padding: 12px 14px;
  background: #1c3030;
  color: var(--green);
  border: 1px solid #35564e;
  border-radius: 7px;
  font-size: 12px;
  margin-top: 16px;
}
.storage-warning.warning {
  background: #332e22;
  border-color: #6e6040;
  color: var(--gold);
}
.storage-warning.danger {
  background: #362530;
  border-color: #704758;
  color: var(--red);
}
.storage-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.storage-row-name {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.storage-row-sub {
  font-size: 11px;
  color: var(--sub);
  margin-top: 2px;
}
.storage-row-size {
  white-space: nowrap;
  font-size: 13px;
  color: var(--sub);
}
.event-list {
  margin-top: 20px;
}
.event-row {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.event-dot {
  margin-top: 8px;
}
.event-main {
  flex: 1;
  min-width: 0;
}
.event-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.event-detail {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.event-time {
  font-size: 11px;
  color: var(--sub);
  white-space: nowrap;
}
.event-toolbar {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.event-filter {
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 6px;
  color: var(--sub);
  font-size: 12px;
}
.event-filter.active {
  background: #263047;
  color: var(--text);
  border-color: #626c89;
}
.sheet-bg {
  position: fixed;
  inset: 0;
  background: #070a16b8;
  z-index: 70;
  display: flex;
  justify-content: flex-end;
}
.sheet {
  background: var(--panel);
  width: 400px;
  max-width: 100%;
  height: 100%;
  overflow: auto;
  border-left: 1px solid var(--line);
  padding: 28px;
  box-shadow: var(--shadow);
}
.sheet-head {
  margin-bottom: 20px;
}
.sheet-title {
  font-size: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sheet-sub {
  font-size: 12px;
  color: var(--sub);
  margin-top: 8px;
}
.source-details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 20px;
  font-size: 12px;
}
.source-details > span {
  color: var(--sub);
}
#sheetSource {
  font:
    12px/1.8 Consolas,
    monospace;
  overflow-wrap: anywhere;
  margin-top: 8px;
}
.sheet-btn {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 8px;
  min-height: 46px;
}
.sheet-btn:last-child {
  margin-top: 14px;
  justify-content: center;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: calc(50% + 112px);
  transform: translateX(-50%) translateY(10px);
  background: #2d354f;
  color: var(--text);
  border: 1px solid #67728f;
  border-radius: 8px;
  padding: 13px 20px;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 150;
  max-width: calc(100% - 32px);
  overflow-wrap: anywhere;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #555f7c;
  border-radius: 12px;
  padding: 28px;
  width: 480px;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #070a16cc;
}
dialog h2 {
  font-size: 19px;
  margin-bottom: 12px;
}
#actionDescription {
  color: var(--sub);
  font-size: 13px;
  white-space: pre-line;
  line-height: 1.9;
  margin-bottom: 20px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
#previewDialog {
  width: 720px;
}
#previewVideo {
  width: 100%;
  aspect-ratio: 16/9;
  background: #090c16;
  border-radius: 6px;
  margin-bottom: 16px;
}
#previewState {
  font-size: 13px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
#previewDialog > .actions {
  margin-top: 20px;
}
.login {
  min-height: 100dvh;
  max-width: 400px;
  margin: 0 auto;
  padding: 70px 20px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-logo img {
  width: 76px;
  height: 76px;
  border-radius: 20px;
}
.login-title {
  font-size: 36px;
  font-weight: 650;
  letter-spacing: 0.15em;
  margin: 18px 0 5px;
}
.login-manager {
  font-size: 15px;
  letter-spacing: 0.13em;
}
.login-sub {
  color: var(--sub);
  font-size: 13px;
  margin: 12px 0 30px;
}
.login-card {
  text-align: left;
  padding: 26px;
}
.login-card .btn {
  margin-top: 20px !important;
}
@media (min-width: 1600px) {
  #workspace {
    padding-left: 52px;
    padding-right: 52px;
  }
  .header {
    padding: 0 52px;
  }
}
@media (max-width: 1100px) and (min-width: 701px) {
  :root {
    --sidebar: 80px;
  }
  .nav-wrap {
    padding: 24px 9px;
  }
  .sidebar-brand {
    margin: 0 auto 34px;
  }
  .sidebar-brand img {
    width: 42px;
    height: 42px;
  }
  .sidebar-brand > span,
  .nav-caption,
  .sidebar-foot,
  .nav-btn > span {
    display: none;
  }
  .nav-btn {
    justify-content: center;
    padding: 12px;
    min-height: 50px;
  }
  .nav-btn svg {
    width: 22px;
    height: 22px;
  }
  .nav-btn.active:before {
    top: 15px;
    bottom: 15px;
  }
  .header {
    padding: 0 24px;
  }
  #workspace {
    padding: 26px 24px 50px;
  }
  .overview-columns {
    grid-template-columns: 1fr;
  }
  .metric {
    padding: 0 17px;
  }
  .system-grid {
    gap: 18px;
  }
  .storage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toast {
    left: calc(50% + 40px);
  }
}
@media (max-width: 700px) {
  :root {
    --sidebar: 0px;
  }
  .nav-wrap {
    width: 100%;
    height: 72px;
    inset: auto 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 4px 5px calc(4px + env(safe-area-inset-bottom));
    height: calc(70px + env(safe-area-inset-bottom));
    background: #111527;
    overflow: visible;
  }
  .sidebar-brand,
  .nav-caption,
  .sidebar-foot {
    display: none;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    height: 100%;
  }
  .nav-btn {
    padding: 7px 0 5px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    border: 0;
    border-radius: 5px;
    font-size: 9px;
    text-align: center;
    white-space: nowrap;
  }
  .nav-btn svg {
    width: 20px;
    height: 20px;
  }
  .nav-btn.active {
    background: #252c43;
    border: 0;
  }
  .nav-btn.active:before {
    top: 0;
    bottom: auto;
    width: 18px;
    height: 2px;
    left: calc(50% - 9px);
  }
  #mainView {
    margin: 0;
  }
  .header {
    height: 64px;
    padding: 0 18px;
    gap: 8px;
  }
  .breadcrumb {
    font-size: 11px;
    gap: 8px;
  }
  .header-tools {
    gap: 10px;
  }
  .header-tools .btn {
    font-size: 11px;
    min-height: 38px;
    padding: 8px 10px;
  }
  .health {
    font-size: 10px;
    gap: 5px;
  }
  #workspace {
    padding: 25px 18px 110px;
  }
  .page-heading {
    margin-bottom: 22px;
    gap: 12px;
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .page-heading p:last-child {
    font-size: 12px;
    line-height: 1.8;
    max-width: 235px;
  }
  .heading-add {
    font-size: 11px;
    padding: 9px 11px;
    min-height: 40px;
    white-space: nowrap;
    margin-top: 21px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.1em;
  }
  .overview-intro {
    padding: 21px 0;
    margin-bottom: 20px;
  }
  .overview-intro h2 {
    font-size: 20px;
  }
  .overview-intro p {
    font-size: 12px;
    max-width: 260px;
  }
  .intro-mark {
    display: none;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    padding: 0;
  }
  .metric {
    padding: 17px 19px;
    gap: 0;
    border-bottom: 1px solid var(--line);
  }
  .metric:nth-child(2) {
    border-right: 0;
  }
  .metric:nth-child(3) {
    border-bottom: 0;
  }
  .metric:last-child {
    border-bottom: 0;
  }
  .metric-value {
    font-size: 27px;
  }
  .metric-label {
    font-size: 11px;
  }
  .overview-columns {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }
  .attention,
  .workflow,
  .form,
  .guidance,
  .system {
    padding: 20px;
  }
  .section {
    margin-bottom: 22px;
  }
  .section-head {
    gap: 10px;
    flex-wrap: wrap;
  }
  .section-title {
    font-size: 16px;
  }
  .section-meta {
    font-size: 11px;
  }
  .system-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .system-head {
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .system-value {
    font-size: 20px;
  }
  .content-card {
    grid-template-columns: 80px minmax(0, 1fr) 36px;
    padding: 16px 12px;
    gap: 12px;
    align-items: start;
  }
  .thumb-wrap {
    width: 80px;
    margin-top: 4px;
  }
  .content-name {
    font-size: 13px;
  }
  .content-meta {
    font-size: 10px;
  }
  .quick-actions {
    margin-top: 12px;
    gap: 6px;
    margin-left: -92px;
  }
  .quick-btn {
    min-height: 40px;
    font-size: 10px;
    padding: 7px 10px;
  }
  .more {
    width: 36px;
    min-height: 40px;
  }
  .content-status {
    font-size: 10px;
  }
  .content-card .error-text {
    margin-left: -92px;
  }
  .video-progress {
    margin-left: -92px;
    margin-top: 12px;
  }
  .library-toolbar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .search-control {
    min-width: 180px;
  }
  .library-toolbar .select {
    width: 112px;
    font-size: 11px;
    min-height: 44px;
    padding: 10px;
  }
  .search-control input {
    font-size: 12px;
  }
  .tabs {
    gap: 21px;
  }
  .tab {
    font-size: 12px;
  }
  .label {
    font-size: 12px;
  }
  .input,
  .select {
    font-size: 16px;
    padding: 12px 11px;
  }
  .input::placeholder {
    font-size: 12px;
  }
  .engine {
    padding: 12px;
    gap: 8px;
  }
  .engine-main {
    gap: 9px;
  }
  .engine-icon {
    width: 30px;
    height: 30px;
  }
  .engine-title {
    font-size: 12px;
  }
  .engine-sub {
    font-size: 10px;
  }
  .engine-state {
    font-size: 10px;
  }
  .setting-desc {
    font-size: 12px;
  }
  .result {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .result > img {
    width: 66px;
  }
  .result > .add {
    grid-column: 2;
    justify-self: start;
    min-height: 40px;
    font-size: 11px;
  }
  .result-title {
    font-size: 12px;
  }
  .playlist {
    padding: 20px;
  }
  .playlist-top {
    align-items: flex-start;
    gap: 12px;
  }
  .playlist-icon {
    width: 36px;
    height: 36px;
    font-size: 23px;
  }
  .playlist-title {
    font-size: 15px;
  }
  .playlist-desc {
    font-size: 12px;
  }
  .url-row {
    flex-wrap: wrap;
  }
  .url {
    flex-basis: 100%;
    font-size: 11px;
  }
  .url-row > .btn {
    width: 100%;
  }
  .playlist-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .playlist-bottom .actions {
    width: 100%;
  }
  .playlist-bottom .btn {
    flex: 1;
  }
  .ready {
    font-size: 11px;
  }
  .guidance p,
  .guidance ol {
    font-size: 12px;
  }
  .backup-policy {
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 12px;
  }
  .backup-policy > span:nth-child(odd) {
    margin-top: 9px;
    color: var(--text);
  }
  .storage-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .storage-stat-name {
    font-size: 11px;
  }
  .storage-stat-value {
    font-size: 20px;
  }
  .service-health-detail {
    font-size: 11px;
  }
  .event-row {
    flex-wrap: wrap;
    gap: 9px;
  }
  .event-main {
    flex-basis: calc(100% - 18px);
  }
  .event-time {
    margin-left: 16px;
  }
  .sheet {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line);
    height: auto;
    max-height: calc(100dvh - 24px);
    border-radius: 16px 16px 0 0;
    padding: 24px 22px calc(22px + env(safe-area-inset-bottom));
    margin-top: auto;
  }
  .sheet-btn {
    min-height: 46px;
  }
  .sheet-bg {
    align-items: flex-end;
  }
  .toast {
    left: 50%;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: max-content;
  }
  .connection-notice {
    align-items: flex-start;
    flex-direction: column;
    font-size: 12px;
  }
  dialog {
    padding: 22px;
  }
  .dialog-actions > .btn {
    flex: 1;
  }
  .login {
    padding-top: 35px;
  }
  .login-title {
    font-size: 32px;
  }
  .service-health-main {
    gap: 9px;
  }
  .service-health-card .setting-title {
    font-size: 13px;
  }
  .install-card .engine {
    flex-wrap: wrap;
  }
  .install-card .engine > .btn {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.mobile-only {
  display: none;
}
.mobile-navigation .sheet-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 70px;
  margin: 10px 0;
  justify-content: center;
  padding: 14px 18px;
}
.mobile-navigation .sheet-btn span {
  font-size: 12px;
  color: var(--sub);
  font-weight: 400;
}
@media (max-width: 700px) {
  .mobile-only {
    display: flex;
  }
  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .nav-btn[data-page="health"],
  .nav-btn[data-page="events"],
  .nav-btn[data-page="settings"] {
    display: none;
  }
  .nav-btn {
    font-size: 11px;
  }
  .nav-btn svg {
    width: 21px;
    height: 21px;
  }
}
.metric-icon svg {
  width: 17px;
  height: 17px;
  vertical-align: middle;
}
.workflow > button > span:first-child svg {
  width: 23px;
  height: 23px;
  display: block;
}
.playlist-icon svg {
  width: 26px;
  height: 26px;
}
.search-control > span svg {
  display: block;
  width: 19px;
  height: 19px;
}
.type-tag {
  background: #0d1020;
}
:root {
  --control-border: #65708d;
}
.input,
.select,
.url,
.search-control {
  border-color: var(--control-border);
}
.ready svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.loading-placeholder {
  color: var(--sub);
}
@media (max-width: 700px) {
  .content-card {
    grid-template-columns: 80px minmax(0, 1fr) 40px;
  }
  .more {
    width: 40px;
    min-height: 44px;
  }
  .quick-btn {
    min-height: 44px;
  }
}
@media (max-width: 700px) {
  .content-card {
    grid-template-columns: 80px minmax(0, 1fr) 44px;
  }
  .more {
    width: 44px;
  }
  .content-meta {
    font-size: 11px;
  }
  .content-status {
    font-size: 11px;
  }
  .quick-btn {
    font-size: 11px;
  }
}
