:root {
  --c-primary: #2b579a;
  --c-primary-strong: #1e3f77;
  --c-accent: #2f6bb0;
  --c-green: #2f9e63;
  --c-green-strong: #238251;
  --c-orange: #d97a1e;
  --c-red: #d64545;
  --c-bg: #eef3fa;
  --c-panel: #ffffff;
  --c-border: #d9e2ef;
  --c-border-strong: #b8c8de;
  --c-text: #233044;
  --c-text-soft: #5c6b80;
  --c-text-faint: #8a97ab;
  --shadow-sm: 0 1px 2px rgba(30, 60, 110, 0.08);
  --shadow-md: 0 4px 14px rgba(30, 60, 110, 0.12);
  --radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  font-size: 13px;
  color: var(--c-text);
  background: var(--c-bg);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

input,
textarea,
select {
  font-family: inherit;
  user-select: text;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #c3cfdf;
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #a9b9d0;
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-content {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 10px;
  gap: 10px;
}

/* ============ 标题栏 ============ */
.titlebar {
  height: 38px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #2f63a8, #285391);
  color: #fff;
  -webkit-app-region: drag;
  flex-shrink: 0;
  padding-left: 12px;
}
.titlebar .tb-logo {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}
.titlebar .tb-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.titlebar .tb-ver {
  margin-left: 8px;
  font-size: 10.5px;
  opacity: 0.72;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.titlebar .tb-file {
  margin-left: 12px;
  font-size: 11px;
  opacity: 0.82;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.titlebar .tb-controls {
  margin-left: auto;
  display: flex;
  -webkit-app-region: no-drag;
  height: 100%;
}
.titlebar .tb-btn {
  width: 46px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #e8f0fb;
  cursor: pointer;
  transition: background 0.15s;
}
.titlebar .tb-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.titlebar .tb-btn.close:hover {
  background: #c42b1c;
  color: #fff;
}
.titlebar .tb-btn svg {
  width: 13px;
  height: 13px;
}

/* ============ Ribbon ============ */
.ribbon {
  flex-shrink: 0;
  background: linear-gradient(180deg, #fbfcff, #f0f4fb);
  border-bottom: 1px solid var(--c-border-strong);
  box-shadow: var(--shadow-sm);
}
.ribbon-tabs {
  display: flex;
  height: 32px;
  padding: 0 8px;
  align-items: flex-end;
}
.ribbon-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px 5px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--c-text-soft);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  position: relative;
}
.ribbon-tab:hover {
  color: var(--c-primary);
}
.ribbon-tab.active {
  color: var(--c-primary-strong);
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--c-border-strong);
  border-bottom-color: #fff;
  margin-bottom: -1px;
}
.ribbon-tab .rt-icon {
  font-size: 15px;
}
.ribbon-body {
  display: flex;
  align-items: center;
  height: 68px;
  padding: 5px 10px;
  gap: 4px;
  border-top: 1px solid var(--c-border);
}
.ribbon-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  border-right: 1px solid var(--c-border);
  height: 100%;
}
.ribbon-group:last-child {
  border-right: none;
}
.ribbon-group .rg-label {
  writing-mode: vertical-lr;
  text-orientation: mixed;
  font-size: 10px;
  color: var(--c-text-faint);
  letter-spacing: 2px;
  margin-right: 2px;
  user-select: none;
}
.ribbon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  height: 50px;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--c-text);
  font-size: 10.5px;
  transition: all 0.12s;
}
.ribbon-btn:hover {
  background: #e3ecf9;
  border-color: #c4d5ec;
}
.ribbon-btn:active {
  background: #d3e2f5;
}
.ribbon-btn .rb-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--c-primary);
  background: #eef4fc;
}
.ribbon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ribbon-btn.danger .rb-icon {
  color: var(--c-red);
  background: #fdf0ef;
}
.ribbon-btn.primary .rb-icon {
  color: #fff;
  background: linear-gradient(180deg, var(--c-green), var(--c-green-strong));
}
.ribbon-btn.accent .rb-icon {
  color: #fff;
  background: linear-gradient(180deg, var(--c-accent), var(--c-primary-strong));
}
.ribbon-btn.accent {
  border-color: var(--c-accent);
  background: rgba(67, 104, 224, 0.08);
  font-weight: 600;
}

/* ============ 通用面板 ============ */
.panel {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.panel-head {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-soft);
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, #fafcff, #f2f6fc);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.panel-head .ph-icon {
  font-size: 13px;
}
.panel-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 10px;
}

/* ============ 编辑视图 ============ */
.edit-view {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.edit-side {
  width: 218px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.edit-side .panel-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-card {
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 8px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.page-card:hover {
  border-color: #b8cde8;
}
.page-card.active {
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px rgba(217, 122, 30, 0.15);
}
.page-card .pc-thumb {
  position: relative;
  height: 74px;
  border-radius: 5px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef3fa, #f8fafc);
  border: 1px solid #e3eaf3;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-card .pc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.page-card .pc-thumb-empty {
  font-size: 10px;
  color: var(--c-text-faint);
  letter-spacing: 1px;
}
.page-card .pc-actions {
  display: none;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e3eaf3;
  gap: 4px;
  justify-content: center;
}
.page-card.active .pc-actions {
  display: flex;
}
.page-card .pc-actions button {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: rgba(20, 32, 52, 0.68);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.page-card .pc-actions button:hover:not(:disabled) {
  background: var(--c-orange);
}
.page-card .pc-actions button:disabled {
  background: rgba(20, 32, 52, 0.22);
  cursor: not-allowed;
}
.add-page-btn {
  margin-top: 2px;
  padding: 7px 0;
  border: 1px dashed #b9c7da;
  border-radius: 8px;
  background: #f7fafd;
  color: var(--c-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.add-page-btn:hover {
  background: #eaf2fd;
  border-color: var(--c-accent);
}
.page-card .pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.page-card .pc-title {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-card .pc-id {
  font-size: 10px;
  color: var(--c-text-faint);
  font-family: Consolas, monospace;
  background: #f0f4fa;
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.page-card .pc-desc {
  font-size: 11px;
  color: var(--c-text-soft);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-card .pc-meta {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #eef4fc;
  color: var(--c-accent);
  border: 1px solid #d3e2f5;
}
.tag.green {
  background: #eaf7f0;
  color: var(--c-green);
  border-color: #c8ecd7;
}
.tag.gray {
  background: #f2f4f7;
  color: var(--c-text-faint);
  border-color: #e2e6ec;
}
.tag.orange {
  background: #fdf3e7;
  color: var(--c-orange);
  border-color: #f5ddbb;
}

/* 画布区 */
.edit-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.canvas-toolbar .ct-url {
  flex: 1;
  font-family: Consolas, monospace;
  font-size: 11px;
  color: var(--c-text-soft);
  background: #f4f7fb;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--c-text-soft);
  transition: all 0.12s;
}
.icon-btn:hover {
  background: #eef4fc;
  border-color: var(--c-border-strong);
  color: var(--c-primary);
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.zoom-val {
  font-size: 11px;
  color: var(--c-text-soft);
  min-width: 40px;
  text-align: center;
  font-family: Consolas, monospace;
}
.canvas-wrap {
  flex: 1;
  min-height: 0;
  background: #e6ecf5;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: auto;
  position: relative;
  padding: 24px;
}
.canvas-stage {
  width: 1280px;
  height: 720px;
  margin: 0 auto;
  transform-origin: top center;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(30, 60, 110, 0.2);
  overflow: hidden;
  position: relative;
  display: flex;
}
.canvas-stage.dim {
  opacity: 0.6;
}
.canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-faint);
  font-size: 13px;
  background:
    linear-gradient(45deg, #f2f5fa 25%, transparent 25%, transparent 75%, #f2f5fa 75%),
    linear-gradient(45deg, #f2f5fa 25%, transparent 25%, transparent 75%, #f2f5fa 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.webframe {
  width: 100%;
  height: 100%;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.webframe-webview {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* 属性面板 */
.edit-props {
  width: 292px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.prop-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prop-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prop-item label {
  font-size: 11px;
  color: var(--c-text-soft);
  font-weight: 600;
}
.prop-item input[type='text'],
.prop-item textarea,
.prop-item select {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  color: var(--c-text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.prop-item input:focus,
.prop-item textarea:focus,
.prop-item select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 176, 0.15);
}
.prop-item textarea {
  resize: vertical;
  min-height: 46px;
  font-family: Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
}
.prop-item .hint {
  font-size: 10px;
  color: var(--c-text-faint);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-text);
  cursor: pointer;
}
.check-row input {
  accent-color: var(--c-accent);
  width: 15px;
  height: 15px;
}
.prop-section {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--c-border);
  margin-top: 4px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--c-border-strong);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(180deg, #fff, #f0f4fa);
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.12s;
}
.btn:hover {
  border-color: var(--c-accent);
  color: var(--c-primary);
}
.btn:active {
  background: linear-gradient(180deg, #e3ecf9, #d9e5f6);
}
.btn.primary {
  background: linear-gradient(180deg, var(--c-green), var(--c-green-strong));
  border-color: var(--c-green-strong);
  color: #fff;
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.accent {
  background: linear-gradient(180deg, var(--c-accent), var(--c-primary-strong));
  border-color: var(--c-primary-strong);
  color: #fff;
}
.btn.accent:hover {
  filter: brightness(1.12);
}
.btn.danger {
  background: linear-gradient(180deg, #fdf3f2, #f8e6e4);
  border-color: #e8c6c2;
  color: var(--c-red);
}
.btn.danger:hover {
  border-color: var(--c-red);
}
.btn.small {
  padding: 4px 10px;
  font-size: 11px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============ 配置视图 ============ */
.config-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.config-card .panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.config-row .cr-label {
  color: var(--c-text-soft);
}
.config-row .cr-value {
  font-weight: 600;
  color: var(--c-text);
  font-family: Consolas, monospace;
  font-size: 12px;
}

/* ============ 状态栏 ============ */
.statusbar {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  background: linear-gradient(180deg, #f2f6fc, #e6edf7);
  border-top: 1px solid var(--c-border-strong);
  font-size: 11px;
  color: var(--c-text-soft);
  flex-shrink: 0;
}
.statusbar .sb-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.statusbar .sb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dirty-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
}
.dirty-dot.on {
  background: var(--c-orange);
  box-shadow: 0 0 5px rgba(217, 122, 30, 0.8);
}

/* ============ Toast ============ */
.toast-box {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(28, 40, 60, 0.92);
  color: #fff;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  animation: toast-in 0.22s ease;
  max-width: 70vw;
}
.toast.out {
  animation: toast-out 0.26s ease forwards;
}
.toast .t-ic {
  font-size: 14px;
}
.toast.ok .t-ic {
  color: #5cd98f;
}
.toast.warn .t-ic {
  color: #ffc266;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.empty-hint {
  text-align: center;
  color: var(--c-text-faint);
  font-size: 12px;
  padding: 24px 0;
}

/* ============ 全屏预览遮罩 ============ */
.fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #060d1c;
  display: flex;
  flex-direction: column;
  animation: fs-in 0.2s ease;
}
.fs-head {
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
}
.fs-body {
  flex: 1;
  min-height: 0;
}
.fs-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7b8aa3;
  font-size: 14px;
  background: radial-gradient(circle at 50% 40%, #101a30, #060d1c);
}
@keyframes fs-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============ 发布弹窗（Modal） ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(10, 18, 34, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fs-in 0.15s ease;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(8, 16, 32, 0.35);
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  max-width: 92vw;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, #f7fafd, #eef3fa);
  flex-shrink: 0;
}
.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-primary-strong);
}
.modal-x {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--c-text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}
.modal-x:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--c-red);
}
.modal-body {
  padding: 14px 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--c-border);
  background: #f7fafd;
  flex-shrink: 0;
}
.m-hint {
  font-size: 12px;
  color: var(--c-text-soft);
  line-height: 1.6;
  margin: 0;
}
.m-empty {
  text-align: center;
  color: var(--c-text-faint);
  font-size: 12px;
  padding: 20px 0;
}
.m-screen-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m-screen-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: #fbfcfe;
  cursor: pointer;
  transition: all 0.12s;
}
.m-screen-row:hover {
  border-color: var(--c-accent);
  background: #f3f8ff;
}
.m-screen-row.sel {
  border-color: var(--c-green-strong);
  background: #eefaf3;
  box-shadow: 0 0 0 2px rgba(47, 158, 99, 0.12);
}
.msr-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.msr-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-primary-strong);
}
.msr-badge {
  font-size: 10px;
  color: var(--c-orange);
  background: #fdf1e3;
  border: 1px solid #f2d4ae;
  border-radius: 10px;
  padding: 1px 8px;
  font-weight: 600;
}
.msr-res {
  font-size: 11px;
  color: var(--c-text-soft);
  font-family: Consolas, monospace;
}
.msr-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--c-text-soft);
}
.msr-playing {
  color: var(--c-green-strong);
  background: #eaf7f0;
  border-radius: 10px;
  padding: 1px 8px;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msr-idle {
  color: var(--c-text-faint);
}
.m-screen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.m-scard {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fbfcfe;
}
.m-scard-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.m-scard-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  min-height: 22px;
}
.m-page-chip {
  font-size: 10.5px;
  color: var(--c-primary-strong);
  background: #e9f0fb;
  border-radius: 5px;
  padding: 2px 7px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-page-empty {
  font-size: 11px;
  color: var(--c-text-faint);
}
.m-page-more {
  font-size: 10.5px;
  color: var(--c-text-soft);
  padding: 2px 5px;
}
.m-scard-play {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--c-green-strong);
  background: #eaf7f0;
  border-radius: 5px;
  padding: 2px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-text);
  cursor: pointer;
  padding-top: 2px;
  border-top: 1px dashed var(--c-border);
  padding-top: 10px;
  user-select: none;
}
.m-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--c-green-strong);
  cursor: pointer;
}
.m-carousel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--c-border);
  padding-top: 12px;
  margin-top: 2px;
}
.m-carousel .m-check em {
  font-style: normal;
  color: var(--c-text-faint);
  font-size: 11px;
}
.m-interval {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--c-text);
  padding-left: 24px;
}
.m-interval-label {
  flex-shrink: 0;
}
.m-interval input[type='number'] {
  width: 76px;
  padding: 5px 8px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fbfcfe;
  font-size: 13px;
  text-align: center;
  outline: none;
}
.m-interval input[type='number']:focus {
  border-color: var(--c-green-strong);
  box-shadow: 0 0 0 2px rgba(47, 158, 99, 0.14);
}

/* ============ 配置中心（菜单在 Ribbon 上，此处为整块配置区） ============ */
.config-shell {
  height: 100%;
  min-height: 0;
}
.config-area {
  height: 100%;
  overflow: auto;
  padding: 16px;
}
.cfg-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 980px;
}
.cfg-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(20, 40, 70, 0.04);
}
.cfg-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--c-primary-strong);
  background: linear-gradient(180deg, #f7fafd, #eef3fa);
  border-bottom: 1px solid var(--c-border);
}
.cfg-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cfg-badge {
  font-size: 10px;
  color: var(--c-orange);
  background: #fdf1e3;
  border: 1px solid #f2d4ae;
  border-radius: 10px;
  padding: 1px 8px;
  font-weight: 600;
}
.cfg-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cfg-field > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
}
.cfg-input {
  padding: 7px 10px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--c-text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  font-family: inherit;
}
.cfg-input:focus,
.cfg-input.focus {
  border-color: var(--c-green-strong);
  box-shadow: 0 0 0 2px rgba(47, 158, 99, 0.14);
}
.cfg-pwd {
  display: flex;
  gap: 8px;
}
.cfg-pwd .cfg-input {
  flex: 1;
}
.cfg-tip {
  font-size: 12px;
  color: var(--c-text-soft);
  line-height: 1.7;
  margin: 0;
}
.cfg-tip b {
  color: var(--c-primary-strong);
}
.cfg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}
.cfg-row-label {
  color: var(--c-text-soft);
  flex-shrink: 0;
}
.cfg-row-value {
  color: var(--c-text);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cfg-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cfg-range input[type='range'] {
  flex: 1;
  accent-color: var(--c-green-strong);
}
.cfg-range-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-green-strong);
  width: 62px;
  text-align: right;
  font-family: Consolas, monospace;
}
.cfg-radio,
.cfg-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--c-text);
  cursor: pointer;
  user-select: none;
  padding: 6px 8px;
  border-radius: 8px;
}
.cfg-radio:hover,
.cfg-check:hover {
  background: #f2f7fc;
}
.cfg-radio input,
.cfg-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--c-green-strong);
  cursor: pointer;
}
.cfg-cards3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cfg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.cfg-table th,
.cfg-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
}
.cfg-table th {
  color: var(--c-text-soft);
  background: #f7fafd;
  font-weight: 600;
}
.cfg-table tr:last-child td {
  border-bottom: none;
}
.cfg-table td:first-child {
  color: var(--c-primary-strong);
  font-weight: 600;
  white-space: nowrap;
}

/* ============ 遥控器模拟器 ============ */
.rc-body {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.rc-remote {
  width: 224px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #233149, #18233a);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 26px rgba(10, 20, 40, 0.35);
}
.rc-name {
  text-align: center;
  color: #9fd8b5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.rc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.rc-btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: #34455f;
  transition: all 0.1s;
  user-select: none;
}
.rc-btn:hover {
  background: #45587a;
  transform: translateY(-1px);
}
.rc-btn:active {
  transform: translateY(1px) scale(0.97);
}
.rc-btn.num {
  height: 46px;
  font-size: 18px;
  color: #eaf7f0;
}
.rc-btn.nav {
  height: 40px;
  font-size: 16px;
}
.rc-btn.esc {
  background: #b3453f;
  height: 40px;
  font-size: 13px;
}
.rc-btn.esc:hover {
  background: #cf5550;
}
.rc-btn.lock {
  height: 40px;
  font-size: 16px;
  background: #2f6b52;
}
.rc-btn.lock.on {
  background: #c7a03a;
}
.rc-rows {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.rc-state {
  text-align: center;
  font-size: 11.5px;
  color: #aebdd4;
}
.rc-side {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rc-test {
  min-height: 90px;
  resize: vertical;
  font-family: Consolas, monospace;
  line-height: 1.8;
}
.rc-log {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rc-log-item {
  font-size: 11.5px;
  background: #f0f5fb;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--c-text-soft);
}
.rc-log-item b {
  color: var(--c-green-strong);
  font-size: 13px;
  margin-right: 4px;
}
.rc-log-item i {
  font-style: normal;
  color: var(--c-text-faint);
  margin-right: 4px;
}
.txt-red {
  color: #e5484d;
}
.txt-green {
  color: var(--c-green-strong);
}

/* ============ 设备测试 ============ */
.mic-meter {
  height: 12px;
  background: #eef1f5;
  border-radius: 6px;
  overflow: hidden;
}
.mic-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.06s linear;
  background: #3b82f6;
}
.mic-level {
  font-size: 12px;
  color: var(--c-text-soft);
}

/* ============ 关于 ============ */
.about-hero {
  text-align: center;
  padding: 22px 0 18px;
}
.about-hero .cfg-card-body {
  align-items: center;
}
.about-logo {
  font-size: 46px;
  line-height: 1;
  margin: 4px 0 8px;
}
.about-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--c-primary-strong);
}
.about-ver {
  font-size: 12px;
  color: var(--c-text-soft);
  margin-top: 4px;
}
.about-desc {
  font-size: 12.5px;
  color: var(--c-text-soft);
  line-height: 1.8;
  max-width: 620px;
  margin: 12px auto 0;
}
