/* Tempo 项目管理系统 —— 在原 Chatna 编译样式之上补充的交互组件样式 */

#root { min-height: 100vh; }

/* 主按钮（覆盖 Tailwind 工具类顺序导致的底色冲突） */
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.login-submit { background: #2563EB !important; color: #fff !important; min-height: 44px; }
.login-submit:hover { background: #1D4ED8 !important; }

/* 原生控件微调 */
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
input[type="checkbox"] { accent-color: #635BFF; }
::selection { background: rgba(99, 91, 255, .18); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #D1D5DB; }

/* ---------- 下拉选择 ---------- */
.t-select { position: relative; }
.t-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 36px; padding: 0 12px; font-size: 14px;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 8px;
  color: #111827; transition: border-color .15s, box-shadow .15s;
}
.t-select-trigger:hover { border-color: #D1D5DB; }
.t-select-trigger:focus-visible { outline: none; border-color: #635BFF; box-shadow: 0 0 0 3px rgba(99, 91, 255, .12); }
.t-select-trigger.is-placeholder { color: #9CA3AF; }
.t-select-menu {
  position: fixed; z-index: 220; min-width: 100%;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  max-height: 260px; overflow-y: auto; padding: 4px;
}
.t-select-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px;
  font-size: 14px; color: #374151; cursor: pointer; white-space: nowrap;
}
.t-select-item:hover, .t-select-item.active { background: #F3F4F6; color: #111827; }
.t-select-item .t-check { width: 14px; }

/* ---------- 多选筛选 ---------- */
.t-filter { position: relative; }
.t-filter-btn {
  display: flex; align-items: center; justify-content: space-between; width: 160px;
  height: 36px; padding: 0 12px; font-size: 14px; color: #374151;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.t-filter-btn:hover { background: #F9FAFB; }
.t-filter-btn:disabled { opacity: .5; cursor: not-allowed; }
.t-filter-panel {
  position: absolute; z-index: 120; top: calc(100% + 6px); left: 0; width: 220px;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 10px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.12); overflow: hidden;
}
.t-filter-search { padding: 8px; border-bottom: 1px solid #F3F4F6; }
.t-filter-search input {
  width: 100%; height: 32px; padding: 0 10px; font-size: 13px;
  border: 1px solid #E5E7EB; border-radius: 6px; outline: none;
}
.t-filter-search input:focus { border-color: #635BFF; }
.t-filter-list { max-height: 240px; overflow-y: auto; padding: 4px; }
.t-filter-option {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px;
  font-size: 14px; cursor: pointer; color: #374151;
}
.t-filter-option:hover { background: #F3F4F6; }
.t-filter-foot { display: flex; gap: 8px; padding: 8px; border-top: 1px solid #F3F4F6; }
.t-filter-empty { padding: 12px; text-align: center; font-size: 13px; color: #9CA3AF; }
.t-chevron { transition: transform .15s; }
.t-filter.open .t-chevron, .t-select.open .t-chevron { transform: rotate(180deg); }

/* ---------- 弹窗 ---------- */
.t-modal-overlay { animation: tFadeIn .15s ease; }
.t-modal-card { animation: tZoomIn .16s ease; }
@keyframes tFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tZoomIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.t-modal-close {
  position: absolute; right: 16px; top: 16px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center; border-radius: 4px;
  color: #71717A; opacity: .7; transition: opacity .15s, background .15s;
}
.t-modal-close:hover { opacity: 1; background: #F4F4F5; }

/* ---------- Toast ---------- */
.t-toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.t-toast {
  min-width: 280px; max-width: 380px; background: #fff; border: 1px solid #E5E7EB;
  border-radius: 10px; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1); padding: 14px 16px;
  animation: tSlideIn .2s ease;
}
.t-toast.error { border-color: #FECACA; background: #FEF2F2; }
.t-toast.success { border-color: #BBF7D0; background: #F0FDF4; }
.t-toast-title { font-size: 14px; font-weight: 600; color: #111827; }
.t-toast.error .t-toast-title { color: #B91C1C; }
.t-toast.success .t-toast-title { color: #15803D; }
.t-toast-desc { font-size: 13px; color: #4B5563; margin-top: 3px; }
@keyframes tSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Tabs / Switch / Checkbox ---------- */
.t-tabs { display: inline-flex; gap: 4px; background: #F3F4F6; padding: 4px; border-radius: 8px; }
.t-tab {
  padding: 8px 16px; font-size: 14px; font-weight: 500; border-radius: 6px;
  color: #4B5563; transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.t-tab:hover { color: #111827; }
.t-tab.active { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.t-switch {
  position: relative; width: 40px; height: 22px; border-radius: 999px; background: #E5E7EB;
  transition: background .2s; flex-shrink: 0;
}
.t-switch.checked { background: #635BFF; }
.t-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 999px; box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .2s;
}
.t-switch.checked::after { transform: translateX(18px); }
.t-check {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border: 1px solid #D1D5DB; border-radius: 4px; background: #fff; flex-shrink: 0;
}
.t-check.checked { background: #635BFF; border-color: #635BFF; color: #fff; }
.t-check svg { width: 11px; height: 11px; }

/* ---------- 表单辅助 ---------- */
.t-label { font-size: 14px; font-weight: 500; line-height: 1; color: #111827; }
.t-required { color: #EF4444; }
.t-help { font-size: 12px; color: #6B7280; }
.t-error { font-size: 13px; color: #DC2626; }
.t-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.t-empty { padding: 32px 16px; text-align: center; color: #9CA3AF; font-size: 14px; }

/* ---------- 图表 ---------- */
.t-chart { width: 100%; height: 280px; display: block; }
.t-chart text { font-family: inherit; }

/* ---------- 甘特图 ---------- */
.t-gantt-wrap { overflow-x: auto; }
.t-gantt { min-width: max-content; }
.t-gantt-head { display: flex; border-bottom: 1px solid #E5E7EB; }
.t-gantt-corner { width: 160px; min-width: 160px; padding: 8px; font-weight: 500; background: #F9FAFB; position: sticky; left: 0; z-index: 10; }
.t-gantt-day { width: 128px; min-width: 128px; padding: 8px; text-align: center; font-size: 12px; font-weight: 500; background: #F9FAFB; border-left: 1px solid #F3F4F6; }
.t-gantt-day .weekday { color: #6B7280; }
.t-gantt-group { display: flex; border-bottom: 1px solid #E5E7EB; background: #EFF6FF; }
.t-gantt-group-name { width: 160px; min-width: 160px; padding: 8px; font-weight: 500; position: sticky; left: 0; z-index: 10; background: #EFF6FF; }
.t-gantt-row { display: flex; border-bottom: 1px solid #F3F4F6; }
.t-gantt-row:hover { background: #F9FAFB; }
.t-gantt-name { width: 160px; min-width: 160px; padding: 8px; font-size: 14px; position: sticky; left: 0; z-index: 10; background: #fff; border-right: 1px solid #E5E7EB; }
.t-gantt-row:hover .t-gantt-name { background: #F9FAFB; }
.t-gantt-cell {
  width: 128px; min-width: 128px; min-height: 60px; padding: 4px; border-left: 1px solid #F3F4F6;
  cursor: pointer; position: relative; display: flex; flex-direction: column; gap: 3px;
}
.t-gantt-cell:hover { background: #EFF6FF; }
.t-gantt-idle { font-size: 12px; color: #9CA3AF; text-align: center; padding-top: 18px; }
.t-gantt-add {
  position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 999px;
  background: #2563EB; color: #fff; font-size: 12px; line-height: 1; display: flex;
  align-items: center; justify-content: center; z-index: 2; opacity: 0;
}
.t-gantt-cell:hover .t-gantt-add { opacity: 1; }
.t-task {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  color: #fff; font-size: 11px; line-height: 1.2; padding: 3px 5px; border-radius: 4px;
  cursor: pointer; overflow: hidden;
}
.t-task:hover { opacity: .82; }
.t-task .t-task-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-task .t-task-del { display: none; flex-shrink: 0; }
.t-task:hover .t-task-del { display: inline-flex; }
.t-gantt-more { font-size: 11px; color: #4B5563; background: #F3F4F6; border-radius: 4px; padding: 3px; text-align: center; }
.t-gantt-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 768px) { .t-gantt-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 附件 ---------- */
.t-attach-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.t-attach-thumb { position: relative; height: 96px; border-radius: 6px; overflow: hidden; border: 1px solid #E5E7EB; cursor: pointer; }
.t-attach-thumb img, .t-attach-thumb video { width: 100%; height: 100%; object-fit: cover; }
.t-attach-file { display: flex; align-items: center; gap: 6px; padding: 8px; border: 1px solid #E5E7EB; border-radius: 6px; font-size: 13px; color: #2563EB; overflow: hidden; }
.t-file-row { display: flex; align-items: center; gap: 8px; background: #F9FAFB; padding: 8px; border-radius: 6px; }
.t-progress { width: 128px; height: 6px; background: #E5E7EB; border-radius: 999px; overflow: hidden; }
.t-progress > div { height: 100%; background: #3B82F6; transition: width .3s; }

/* ---------- 其它 ---------- */
.t-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.t-comment { background: #F9FAFB; padding: 12px; border-radius: 8px; }
.t-history-item { font-size: 14px; border-left: 2px solid #D1D5DB; padding: 4px 0 4px 12px; }
.t-link { color: #2563EB; }
.t-link:hover { text-decoration: underline; }
.t-scroll-box { max-height: 240px; overflow-y: auto; }
.t-perm-box { max-height: 500px; overflow-y: auto; border: 1px solid #E5E7EB; border-radius: 10px; padding: 16px; background: #F9FAFB; }
.t-perm-item { display: flex; align-items: flex-start; gap: 12px; background: #fff; padding: 12px; border-radius: 8px; border: 1px solid #F3F4F6; }
.t-perm-item:hover { border-color: #E5E7EB; }
.t-logo-img { width: 100%; height: 100%; object-fit: cover; }
.t-page-title { font-size: 20px; font-weight: 600; color: #111827; }
.t-page-sub { font-size: 13px; color: #6B7280; margin-top: 4px; }
.t-stat-value { font-size: 32px; font-weight: 600; line-height: 1; }
.t-kbd { font-size: 11px; color: #9CA3AF; }
.t-divider { border-top: 1px solid #F3F4F6; }
.t-mention { color: #2563EB; font-weight: 500; }
.t-clickable { cursor: pointer; }
.t-cell-edit { display: flex; gap: 6px; align-items: center; }
.t-mini-btn { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.t-num { width: 96px; }
.t-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
