* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Microsoft YaHei','PingFang SC',sans-serif;
  background: #f0f2f5; color: #222; font-size: 14px;
}
.hide { display: none !important; }
.btn {
  border: 1px solid #cbd5e1; background: #fff; color: #333; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn:hover { background: #f1f5f9; }
.btn.primary { background: #1565c0; color: #fff; border-color: #1565c0; }
.btn.primary:hover { background: #0d4ea3; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e293b; color: #fff; padding: 0 16px; height: 52px;
}
.brand { font-weight: bold; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar select, .topbar input { padding: 5px 8px; border-radius: 6px; border: 1px solid #334; }
.dropdown {
  position: absolute; right: 16px; top: 50px; background: #fff; border: 1px solid #cbd5e1;
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 50; display: flex; flex-direction: column;
}
.dropdown button { background: #fff; border: none; padding: 8px 16px; text-align: left; cursor: pointer; color: #222; }
.dropdown button:hover { background: #f1f5f9; }
#userBox { display: flex; align-items: center; gap: 6px; }
#userBox .uname { color: #cfe; font-size: 13px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: #fff; padding: 8px 16px; border-bottom: 1px solid #e2e8f0;
}
.tabs { display: flex; gap: 4px; }
.tab {
  border: none; background: transparent; padding: 8px 14px; cursor: pointer; border-radius: 6px;
  color: #475569; font-size: 13px;
}
.tab.active { background: #e0ecff; color: #1565c0; font-weight: bold; }
.chart-ctrls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #555; }
.chart-ctrls label { display: flex; align-items: center; gap: 3px; }
.chart-ctrls select { padding: 4px 6px; border-radius: 5px; border: 1px solid #cbd5e1; }

.settings.card { margin: 10px 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; }
.settings-head { padding: 10px 14px; cursor: pointer; font-weight: bold; color: #334155; user-select: none; }
.settings-body { padding: 0 14px 14px; display: none; }
.settings-body.open { display: block; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #555; }
.grid input { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
.sig { margin-top: 10px; }
.sig summary { cursor: pointer; color: #1565c0; }

main { padding: 0 16px 24px; }
.input-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.panel { display: none; padding: 12px; }
.panel.active { display: block; }
.panel-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.hint { color: #94a3b8; font-size: 12px; }
.table-scroll { overflow: auto; max-height: 360px; border: 1px solid #e2e8f0; border-radius: 6px; }
.task-table { border-collapse: collapse; width: 100%; min-width: 1100px; }
.task-table th, .task-table td { border: 1px solid #e2e8f0; padding: 4px 6px; font-size: 12px; white-space: nowrap; }
.task-table th { background: #f8fafc; position: sticky; top: 0; z-index: 2; }
.task-table input, .task-table select { width: 100%; border: 1px solid #cbd5e1; border-radius: 4px; padding: 3px 5px; font-size: 12px; }
.task-table .row-idx { text-align: center; color: #94a3b8; }
.task-table .del { color: #e53935; cursor: pointer; text-align: center; }
.import-preview { margin-top: 10px; max-height: 300px; overflow: auto; }
.import-preview table { border-collapse: collapse; width: 100%; }
.import-preview th, .import-preview td { border: 1px solid #e2e8f0; padding: 4px 8px; font-size: 12px; }
.ai-text { width: 100%; height: 200px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px; font-size: 13px; font-family: inherit; resize: vertical; }
.ai-status { color: #1565c0; font-size: 12px; }

.chart-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; }
.warnings { margin-bottom: 10px; }
.warn-item { padding: 6px 10px; border-radius: 6px; margin-bottom: 6px; font-size: 13px; }
.warn-item.danger { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6cb; }
.warn-item.warn { background: #fff8e1; color: #8d6e00; border: 1px solid #ffe082; }
.gantt-container { overflow: auto; max-height: 70vh; border: 1px solid #eee; border-radius: 6px; padding: 4px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: #fff; border-radius: 10px; padding: 20px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-box h3 { margin: 0 0 12px; }
.modal-box label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; color: #555; }
.modal-box input { padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; }
.seg { display: flex; gap: 6px; margin-bottom: 12px; }
.seg-btn { flex: 1; border: 1px solid #cbd5e1; background: #f8fafc; padding: 6px; border-radius: 6px; cursor: pointer; }
.seg-btn.active { background: #1565c0; color: #fff; border-color: #1565c0; }
.auth-msg { color: #e53935; font-size: 12px; min-height: 16px; margin-bottom: 8px; }
.modal-box .tip { color: #94a3b8; font-size: 11px; margin-top: 10px; }
.cols-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; max-height: 320px; overflow: auto; }
.cols-list label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
