/* app.css — macOS 浅色风格（银白、圆角、轻阴影），对齐桌面版 ui 视觉 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: #F5F5F7;
  color: #1C1C1E;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ── 登录遮罩 ── */
#login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #F0F0F4 0%, #E7E7EC 100%);
}
.login-card {
  width: 340px; padding: 36px 32px 28px;
  background: rgba(255,255,255,.92);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
  text-align: center;
}
.login-card h1 { font-size: 22px; margin-bottom: 6px; letter-spacing: .5px; }
.login-card .sub { font-size: 12px; color: #8E8E93; margin-bottom: 24px; }
.login-card input {
  width: 100%; height: 40px; margin-bottom: 12px;
  border: 1px solid #D1D1D6; border-radius: 10px;
  padding: 0 14px; font-size: 14px; background: #fff; outline: none;
}
.login-card input:focus { border-color: #0A84FF; box-shadow: 0 0 0 3px rgba(10,132,255,.15); }
.login-card .err { color: #FF3B30; font-size: 12px; min-height: 16px; margin-bottom: 8px; }
.btn-primary {
  width: 100%; height: 40px; border-radius: 10px;
  background: #0A84FF; color: #fff; font-size: 15px; font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover { background: #0071E3; }

/* ── 应用壳 ── */
#app { display: none; flex-direction: column; height: 100vh; }
#app.visible { display: flex; }

.topbar {
  height: 48px; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #D9D9DE;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.topbar .title { font-size: 16px; font-weight: 700; letter-spacing: .5px; margin-right: 6px; }
.tab-btn {
  height: 30px; padding: 0 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  color: #48484A; transition: all .15s;
}
.tab-btn.active { background: #E8E8ED; color: #1C1C1E; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); }
.tab-btn:hover { background: #ECECF0; }
.topbar .spacer { flex: 1; }
.status-badge { font-size: 12px; color: #8E8E93; white-space: nowrap; }
.online-list { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #48484A; white-space: nowrap; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(160deg, #0A84FF, #4DA3FF);
  color: #fff; font-size: 10px; font-weight: 700;
}
.role-chip {
  font-size: 10px; padding: 1px 7px; border-radius: 8px;
  background: #E8E8ED; color: #6E6E73;
}
.icon-btn {
  height: 30px; min-width: 30px; padding: 0 10px; border-radius: 9px;
  font-size: 13px; color: #48484A; transition: background .15s;
}
.icon-btn:hover { background: #ECECF0; }
.icon-btn.danger:hover { background: #FFE4E1; color: #FF3B30; }

/* ── 内容区 ── */
#content { flex: 1; display: flex; min-height: 0; position: relative; }
.tab-body { display: none; flex: 1; min-width: 0; min-height: 0; }
.tab-body.active { display: flex; }
#timeline-body { flex-direction: column; }

/* ── 时间线 ── */
.toolbar {
  flex: none; height: 42px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid #E2E2E6;
  background: #F8F8FA;
}
.toolbar .sep { width: 1px; height: 20px; background: #D9D9DE; margin: 0 4px; }
.tbtn {
  height: 28px; padding: 0 12px; border-radius: 8px;
  background: #ECECF0; color: #3A3A3C; font-size: 12px; font-weight: 600;
  transition: all .12s;
}
.tbtn:hover { background: #E2E2E6; }
.tbtn.active { background: #0A84FF; color: #fff; }
.tbtn:disabled { opacity: .4; cursor: not-allowed; }
.tbtn-select { position: relative; }
.tbtn-select select {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

.timeline-wrap {
  flex: 1; display: flex; min-height: 0;
}
.timeline-canvas-host { flex: 1; position: relative; min-width: 0; }
#timeline-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; cursor: default;
}
.empty-hint {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  color: #8E8E93; font-size: 13px; text-align: center; pointer-events: none; line-height: 1.7;
}

/* ── 状态栏 ── */
.statusbar {
  flex: none; height: 28px;
  display: flex; align-items: center; padding: 0 12px;
  font-size: 12px; color: #8E8E93;
  border-top: 1px solid #E2E2E6; background: #fff;
}

/* ── 用户管理弹窗 ── */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.28); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: 420px; background: #fff; border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
  padding: 20px 22px; max-height: 80vh; overflow: auto;
}
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal th, .modal td { text-align: left; padding: 7px 6px; border-bottom: 1px solid #F0F0F2; }
.modal th { color: #8E8E93; font-weight: 600; }
.modal input, .modal select {
  height: 32px; border: 1px solid #D1D1D6; border-radius: 8px; padding: 0 10px; font-size: 13px;
}
.modal .row { display: flex; gap: 8px; margin: 12px 0 4px; }
.modal .row input { flex: 1; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* 简单确认/输入弹窗 */
.prompt-modal .modal { width: 340px; }
.prompt-modal input { width: 100%; margin-top: 8px; }
