/* Personal_AI_OS 统一操作驾驶舱样式
 * 主题色沿用整站的深紫 #8B008B（与 portal.css / paios-theme.css 一致）。
 *
 * 布局要点：整页不做滚动（100vh 锁死），滚动条只出现在下方 iframe 内部 ——
 * 这样顶部两个下拉框与状态条永远可见，切换子系统时不用"滚回顶部"。
 */

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

/* 关键：本文件大量使用 display:flex/inline-flex，会压掉浏览器对
 * [hidden] 属性的默认 display:none —— JS 靠 hidden 控制显隐，必须补回。
 * 没有这一行，"未接入"遮罩和三个提示徽章会永远显示（预演截图实测踩中）。 */
.ck-body [hidden] { display: none !important; }

:root {
  --primary: #8B008B;
  --primary-dark: #6E006E;
  --primary-deep: #4E004E;
  --accent: #A21CA2;
  --bg: #F6F4F1;
  --panel: #ffffff;
  --text: #16212B;
  --text-light: #8A959D;
  --border: #E7E3DD;
  --shadow: 0 2px 12px rgba(78, 26, 78, 0.08);
  --warn: #E0A33E;
  --warn-bg: #fdf3e2;
  --warn-border: #f0dcb6;
  --bar-h: 64px;
}

html, body { height: 100%; }

.ck-body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── 顶部控制条 ───────────────────────────────────────────── */
.ck-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 11px 20px;
  min-height: var(--bar-h);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
  flex-wrap: wrap;
}

.ck-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.ck-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: background 0.2s ease;
}

.ck-logo:hover { background: rgba(255, 255, 255, 0.3); }

.ck-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.ck-brand-text strong { font-size: 15px; letter-spacing: 0.5px; }
.ck-brand-text span { font-size: 11.5px; opacity: 0.82; }

.ck-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.ck-field {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  padding: 3px 10px 3px 12px;
  min-width: 0;
}

.ck-field-label {
  font-size: 11.5px;
  letter-spacing: 1px;
  opacity: 0.9;
  white-space: nowrap;
}

.ck-field select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 5px 22px 5px 2px;
  max-width: 330px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M0 1l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1px center;
}

/* 下拉展开后的选项在浅色背景上，必须强制深色字，
   否则 Windows 下会出现"白字白底"看不见 */
.ck-field select option {
  color: var(--text);
  background: #fff;
}

/* 下拉框分组（常用 / 全部）——原生 optgroup 只能调字重与配色，
   但足够让"两组"一眼分开；不引第三方组件，保持零依赖 */
.ck-field select optgroup {
  color: var(--primary-deep);
  background: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.ck-field select optgroup option {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: normal;
  padding-left: 6px;
}

.ck-field select:disabled { opacity: 0.55; cursor: not-allowed; }

.ck-arrow { color: rgba(255, 255, 255, 0.6); font-size: 17px; }

.ck-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.ck-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 9px;
  padding: 7px 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}

.ck-btn:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.ck-btn:active { transform: translateY(0); }
.ck-btn-ghost { background: transparent; }
.ck-ico { font-size: 13px; line-height: 1; }

/* 排序切换：按下态（=正在按常用排序）比幽灵按钮更实一点，一眼看出当前模式 */
.ck-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.28); }
/* 统计关闭 / 没有 NAV 时按钮不可点，别给"能切"的错觉 */
.ck-btn:disabled,
.ck-btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  background: transparent;
}

/* ── 状态条 ───────────────────────────────────────────────── */
.ck-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-light);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.ck-crumb {
  font-family: Consolas, Monaco, monospace;
  color: var(--primary-deep);
  font-weight: 600;
}

.ck-dot { opacity: 0.5; }

.ck-actual { color: var(--text); opacity: 0.82; }

.ck-spacer { flex: 1 1 auto; }

.ck-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #F8EAF8;
  color: var(--primary-deep);
  border: 1px solid #E6CBE6;
  flex: 0 0 auto;
}

.ck-chip-warn {
  background: var(--warn-bg);
  color: #9a6a15;
  border-color: var(--warn-border);
}

.ck-chip-loading {
  background: #EEF3F8;
  color: #4a6b8a;
  border-color: #D8E4EF;
  animation: ck-pulse 1.2s ease-in-out infinite;
}

@keyframes ck-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ── 舞台：iframe 占满剩余高度 ─────────────────────────────── */
.ck-stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  background: var(--panel);
}

#ck-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.ck-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  text-align: center;
  background: var(--bg);
}

.ck-empty-icon { font-size: 40px; }
.ck-empty h2 { font-size: 18px; color: var(--primary-deep); }

.ck-empty p {
  font-size: 13.5px;
  color: var(--text-light);
  line-height: 1.8;
  max-width: 460px;
}

/* ── 窄屏（手机 / 分栏窗口）：控制条换行，按钮不挤压下拉框 ──── */
@media (max-width: 900px) {
  .ck-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .ck-brand-text { display: none; }
  .ck-brand { justify-content: flex-start; }
  .ck-field { flex: 1 1 100%; }
  .ck-field select { max-width: none; flex: 1 1 auto; }
  .ck-arrow { display: none; }
  .ck-actions { margin-left: 0; flex-wrap: wrap; }
  .ck-status { padding: 7px 14px; }
}
