/* apps.css — 系统应用样式:文件管理器 / 设置 / 预览 / 通用控件 */
/* 通用控件 */
.ctrl { display: flex; align-items: center; gap: 8px; }
.btn {
  padding: 7px 14px;
  border-radius: var(--radius-control);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); }
.btn.danger { background: rgba(224, 108, 108, 0.15); border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: default; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.field input, .field select {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--bg-field);
  color: var(--text);
  font-size: 13px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 11px; color: var(--text-dim); margin-top: 5px; line-height: 1.5; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  padding: 60px 20px;
  gap: 10px;
}
.empty-state .es-ico { font-size: 40px; opacity: 0.5; }

/* ===== 文件管理器 ===== */
.fm { display: flex; height: 100%; }
.fm-sidebar {
  width: 168px;
  flex: 0 0 168px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 8px;
  overflow-y: auto;
}
.fm-sb-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); padding: 8px 8px 4px; }
.fm-sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.fm-sb-item:hover { background: var(--bg-hover); }
.fm-sb-item.active { background: var(--bg-selected); color: #fff; }
.fm-sb-item .sb-ico { width: 18px; text-align: center; }

.fm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fm-toolbar {
  height: 46px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 46px;
}
.fm-path {
  flex: 1;
  display: flex; align-items: center; gap: 3px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 6px 10px;
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
}
.fm-path .seg { color: var(--text-dim); }
.fm-path .cur { color: var(--text); }

.fm-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  align-content: start;
}
.fm-item {
  border-radius: 8px;
  padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: default; user-select: none;
}
.fm-item:hover { background: var(--bg-hover); }
.fm-item.selected { background: var(--bg-selected); }
.fm-item .fi-thumb {
  width: 64px; height: 48px;
  display: grid; place-items: center;
  background: var(--bg-field);
  border-radius: 6px;
  overflow: hidden;
}
.fm-item .fi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fm-item .fi-thumb .fi-ico { font-size: 24px; }
.fm-item .fi-name {
  font-size: 12px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fm-item .fi-size { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
.fm-item.missing { opacity: 0.45; }

/* 列表视图(可选) */
.fm-list { flex: 1; overflow-y: auto; }
.fm-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; font-size: 13px; border-bottom: 1px solid rgba(69, 79, 99, 0.4);
  cursor: default;
}
.fm-list-row:hover { background: var(--bg-hover); }
.fm-list-row.selected { background: var(--bg-selected); }
.fm-list-row .lr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-list-row .lr-size { width: 90px; text-align: right; color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; }

/* 状态栏 */
.fm-status {
  height: 26px; flex: 0 0 26px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 12px;
  font-size: 11px; color: var(--text-dim); gap: 14px;
}

/* ===== 设置 ===== */
.st { display: flex; height: 100%; }
.st-sidebar {
  width: 172px; flex: 0 0 172px;
  background: var(--bg-panel); border-right: 1px solid var(--border);
  padding: 8px;
}
.st-sb-item {
  padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.st-sb-item:hover { background: var(--bg-hover); }
.st-sb-item.active { background: var(--bg-selected); color: #fff; }
.st-main { flex: 1; padding: 22px; overflow-y: auto; }
.st-main h2 { font-size: 17px; margin: 0 0 4px; }
.st-main .st-sub { color: var(--text-dim); font-size: 12px; margin: 0 0 20px; }
.st-section { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.st-section h3 { font-size: 13px; margin: 0 0 12px; color: var(--text-bright); }
.st-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(69,79,99,0.4); }
.st-row:last-child { border-bottom: none; }
.st-row .lbl { font-size: 13px; }
.st-row .lbl .dsc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* 扫码 / 二维码 */
.qr-box {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 16px;
}
.qr-canvas { background: #fff; border-radius: 8px; padding: 8px; }

/* 设备列表 */
.dev-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(69,79,99,0.4); font-size: 13px; }
.dev-row:last-child { border-bottom: none; }
.dev-row .dev-ico { font-size: 16px; }
.dev-row .dev-name { flex: 1; }
.dev-row .dev-date { color: var(--text-dim); font-size: 11px; }

/* 进度条 */
.progress-bar {
  position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%);
  width: 300px;
  background: var(--bg-window);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow-window);
  z-index: 40;
}
.progress-bar .pb-title { font-size: 12px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-bar .pb-track { height: 5px; background: var(--bg-field); border-radius: 3px; overflow: hidden; }
.progress-bar .pb-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.15s; }
.progress-bar .pb-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-dim); margin-top: 5px; font-family: var(--font-mono); }

/* ===== 预览窗口 ===== */
.pv-stage {
  flex: 1;
  display: grid; place-items: center;
  background: #10141d;
  overflow: auto;
}
.pv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pv-stage video { max-width: 100%; max-height: 100%; }
.pv-info { padding: 10px 14px; font-size: 12px; color: var(--text-dim); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }

/* ===== 认证覆盖层 ===== */
.auth {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, #1a2740 0%, #0d1420 100%);
  display: grid; place-items: center;
  z-index: 100;
}
.auth-card {
  width: min(360px, 92vw);
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-window);
  padding: 32px 28px;
  text-align: center;
}
.auth-logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  background: var(--accent);
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 24px; color: #fff;
}
.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-sub { font-size: 12px; color: var(--text-dim); margin: 0 0 22px; line-height: 1.6; }
.auth-field { text-align: left; margin-bottom: 14px; }
.auth-field label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 5px; }
.auth-field input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-field); color: var(--text); font-size: 14px; }
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-btn {
  width: 100%; padding: 11px;
  border-radius: 9px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
  margin-bottom: 10px;
}
.auth-btn:hover { background: var(--accent-hi); }
.auth-link { color: var(--text-dim); font-size: 12px; text-decoration: underline; }
.auth-link:hover { color: var(--accent-hi); }
