/* 旗开综合平台 · 云桌面样式 */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1b2333;
  --muted: #6b7789;
  --line: #e3e8f0;
  --brand: #2f6fed;
  --brand-dark: #1f56c9;
  --ok: #0e9f6e;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --tb-h: 48px;
}

* { box-sizing: border-box; }

/* hidden 属性必须生效：防止被 display:flex 等作者样式覆盖 */
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  background: #0b1220;
  color: var(--text);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

/* ============================ 桌面 ============================ */

.desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
}

.wallpaper {
  position: absolute;
  inset: 0;
  /* 品牌深色 #0B1220 为基调，配暗红光晕呼应品牌红 #E31E24 */
  background:
    radial-gradient(1100px 640px at 14% -6%, rgba(227, 30, 36, .16) 0%, transparent 55%),
    radial-gradient(900px 560px at 94% 106%, rgba(227, 30, 36, .10) 0%, transparent 52%),
    radial-gradient(900px 600px at 62% 42%, rgba(120, 30, 40, .12) 0%, transparent 60%),
    linear-gradient(150deg, #0b1220 0%, #12101a 52%, #0b0f18 100%);
}

.wallpaper::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .55;
}

/* ============================ 桌面图标 ============================ */

.desk-icons {
  position: absolute;
  inset: 0 0 var(--tb-h) 0;
  z-index: 5;
}

.desk-icon {
  position: absolute;
  width: 92px;
  padding: 8px 4px 6px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background .12s;
}

.desk-icon:hover { background: rgba(255, 255, 255, .1); }
.desk-icon.sel { background: rgba(47, 111, 237, .28); outline: 1px solid rgba(120, 170, 255, .5); }

.di-glyph {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 25px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .22);
  pointer-events: none;
}

.di-label {
  font-size: 12px;
  line-height: 1.35;
  color: #eaf1ff;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .75);
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  pointer-events: none;
}

/* ============================ 窗口 ============================ */

.windows-layer {
  position: absolute;
  inset: 0 0 var(--tb-h) 0;
  z-index: 10;
  pointer-events: none;
}

.win {
  position: absolute;
  pointer-events: auto;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .42), 0 0 0 1px rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 380px;
  min-height: 260px;
}

.win.minimized {
  display: none;
}

.win-titlebar {
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px 0 12px;
  background: linear-gradient(180deg, #f8fafc, #eef2f8);
  border-bottom: 1px solid var(--line);
  cursor: default;
}

.win.focused .win-titlebar { background: linear-gradient(180deg, #ffffff, #eef4ff); }

.win-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}

.win-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-btns { display: flex; gap: 2px; }

.wb {
  width: 34px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.wb:hover { background: rgba(15, 23, 42, .08); color: #0f172a; }
.wb.close:hover { background: #e11d48; color: #fff; }

.win-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
  position: relative;
}

.win-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(100, 116, 139, .5) 50%, rgba(100, 116, 139, .5) 62%, transparent 62%, transparent 72%, rgba(100, 116, 139, .5) 72%, rgba(100, 116, 139, .5) 84%, transparent 84%);
}

.win-loading, .win-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* 模块 iframe */
.mod-wrap { position: absolute; inset: 0; }
.mod-wrap iframe { width: 100%; height: 100%; border: none; display: block; background: #fff; }

.mod-down {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  padding: 24px;
}

.mod-down .e-ico { font-size: 38px; opacity: .5; }

/* ============================ 窗口内通用 ============================ */

.win-pane { padding: 18px 20px 24px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.section-head.mt { margin-top: 22px; }
.section-title { font-size: 14px; font-weight: 650; }
.section-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mb { margin-bottom: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card.pad { padding: 18px; }
.mt { margin-top: 16px; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; font-weight: 600; color: #475569; font-size: 12px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }
.mono-sm { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--muted); }

/* 标签 */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 18px;
  background: #eef2f7;
  color: #475569;
}
.tag.blue { background: #e8f0ff; color: #1f56c9; }
.tag.green { background: #e6f7f0; color: #067647; }
.tag.red { background: #fdecec; color: #b42318; }
.tag.gray { background: #f1f5f9; color: #64748b; }

/* 表单 */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }

.field input, .input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13.5px;
  background: #fbfcfe;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus, .input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .12);
  background: #fff;
}

.switches { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 2px; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.switch input { width: 15px; height: 15px; accent-color: var(--brand); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #fecaca; background: #fff5f5; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; }
.pager-info { font-size: 12.5px; color: var(--muted); }

/* 我的账号 */
.me-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.me-name { font-size: 16px; font-weight: 650; }
.me-sub { font-size: 12.5px; color: var(--muted); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f6fed, #6f9bff);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.xl { width: 52px; height: 52px; font-size: 20px; }

/* 提示框 */
.hint-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f0f7ff;
  border: 1px solid #d6e6ff;
  border-radius: 10px;
  font-size: 12.5px;
  color: #33507d;
  line-height: 1.7;
}
.hint-box code {
  background: rgba(47, 111, 237, .1);
  padding: 1px 6px;
  border-radius: 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

/* 帮助 */
.help { max-width: 720px; line-height: 1.85; }
.help h3 { font-size: 14px; margin: 18px 0 8px; color: #1e293b; }
.help h3:first-child { margin-top: 0; }
.help ul { margin: 0; padding-left: 20px; color: #475569; font-size: 13px; }
.help li { margin-bottom: 5px; }
.help b { color: #1e293b; }

/* 空态 */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 13px; }

/* ============================ 任务栏 ============================ */

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tb-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: rgba(11, 18, 32, .88);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid rgba(255, 255, 255, .1);
  z-index: 500;
}

.tb-start {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px 0 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  flex: none;
  transition: background .15s;
}
.tb-start:hover, .tb-start.on { background: rgba(255, 255, 255, .12); }

.tb-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: block;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.tb-apps {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 4px;
}
.tb-apps::-webkit-scrollbar { height: 0; }

.tb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  max-width: 190px;
  padding: 0 11px;
  border: none;
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  flex: none;
  transition: background .15s;
  position: relative;
}
.tb-item:hover { background: rgba(255, 255, 255, .14); }
.tb-item.active { background: rgba(47, 111, 237, .32); color: #fff; }
.tb-item.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -3px;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #7ea8ff;
}
.tb-item.min { opacity: .62; }
.tb-ico { font-size: 14px; }
.tb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tb-right { display: flex; align-items: center; gap: 8px; flex: none; }

.tb-clock {
  text-align: right;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.25;
  padding: 0 8px;
  cursor: default;
}
.clock-time { font-size: 13px; font-weight: 600; }
.clock-date { font-size: 10.5px; color: #94a3b8; }

.tb-user { display: flex; align-items: center; padding: 4px; }

/* ============================ 开始菜单 ============================ */

/* 菜单打开时盖住 iframe 的透明接收层：否则点进 iframe 内部，
   父页面收不到事件，菜单就关不掉 */
.menu-catcher {
  position: fixed;
  inset: 0;
  z-index: 590;      /* 在菜单(600)之下、窗口(10~500)之上 */
  background: transparent;
}

.start-menu {
  position: absolute;
  left: 8px;
  bottom: calc(var(--tb-h) + 8px);
  width: 300px;
  max-height: min(560px, calc(100vh - 90px));
  background: rgba(17, 26, 43, .96);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  z-index: 600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop .16s ease;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.sm-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sm-name { color: #f1f5f9; font-size: 13.5px; font-weight: 600; }
.sm-role { color: #94a3b8; font-size: 11.5px; }

.sm-list { overflow-y: auto; padding: 8px; flex: 1; }
.sm-list::-webkit-scrollbar { width: 8px; }
.sm-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 4px; }

.sm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background .12s;
}
.sm-item:hover { background: rgba(255, 255, 255, .1); }

.sm-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex: none;
}
.sm-title { color: #e2e8f0; font-size: 13px; }

.sm-foot { padding: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }

/* ============================ 公告气泡 ============================ */

.announce {
  position: absolute;
  right: 20px;
  bottom: calc(var(--tb-h) + 18px);
  width: min(330px, calc(100vw - 40px));
  background: rgba(255, 255, 255, .97);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  z-index: 400;
  overflow: hidden;
  animation: pop .2s ease;
}

.ann-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #eef4ff;
  font-size: 12.5px;
  font-weight: 600;
  color: #1f56c9;
}

.ann-close {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: inherit;
}
.ann-close:hover { background: rgba(0, 0, 0, .08); }

.ann-body { padding: 12px 14px; font-size: 13px; color: #334155; line-height: 1.7; }

/* ============================ 弹窗 ============================ */

.dlg-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  display: grid;
  place-items: center;
  z-index: 900;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.dlg {
  width: min(480px, 100%);
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dlg-title { padding: 18px 20px 0; font-size: 15px; font-weight: 650; }
.dlg-body { padding: 16px 20px; overflow-y: auto; }
.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fafbfd;
}

/* ============================ 提示 ============================ */

.toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #111827;
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  animation: slidein .2s ease;
}
.toast.error { background: #b42318; }
.toast.ok { background: #067647; }

@keyframes slidein {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.boot-error {
  display: grid;
  place-items: center;
  height: 100vh;
  color: #cbd5e1;
  font-size: 14px;
  gap: 10px;
  text-align: center;
  padding: 24px;
}
.boot-error .e-ico { font-size: 40px; }

/* ============================ 登录页 ============================ */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  /* 浅色调 + 品牌红色光晕，与红底白火炬 logo 呼应 */
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(227, 30, 36, .10) 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(227, 30, 36, .07) 0%, transparent 55%),
    #f5f7fb;
  overflow: auto;
}

.login-card {
  width: min(400px, calc(100vw - 32px));
  background: var(--panel);
  border-radius: 20px;
  padding: 32px 28px 22px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, .12);
  border: 1px solid rgba(255, 255, 255, .8);
}

.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(227, 30, 36, .28);
}

.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.btn.block { width: 100%; }

.login-error {
  background: #fff1f1;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 13px;
  margin-bottom: 14px;
}

.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: #9aa5b5; }

/* ============================ 响应式 ============================ */

@media (max-width: 720px) {
  .win {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    min-width: 0;
  }
  .win-resize { display: none; }
  .tb-start-text { display: none; }
  .tb-item { max-width: 120px; }
  .tb-clock { display: none; }
  .desk-icon { width: 80px; }
  .di-glyph { width: 46px; height: 46px; font-size: 22px; }
  .di-label { font-size: 11px; max-width: 76px; }
  .start-menu { left: 6px; right: 6px; width: auto; }
}
