/* app.css - 广告项目管理系统前端样式（浅色主题） */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2329;
  --text2: #646a73;
  --text3: #8f959e;
  --primary: #3370ff;
  --primary-bg: #eef3ff;
  --green: #34c724;
  --green-bg: #eaf9e7;
  --orange: #ff8800;
  --orange-bg: #fff3e0;
  --red: #f54a45;
  --red-bg: #feeceb;
  --purple: #7b61ff;
  --purple-bg: #f0ecff;
  --teal: #14c0cc;
  --teal-bg: #e0f7f9;
  --shadow: 0 1px 3px rgba(31,35,41,.06), 0 4px 12px rgba(31,35,41,.04);
  --side-w: 232px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ===== 通用 ===== */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #2860e0; color: #fff; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.icon-btn {
  border: 1px solid transparent; background: transparent; border-radius: 5px;
  width: 26px; height: 26px; cursor: pointer; font-size: 12px; color: var(--text3);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(31,35,41,.06); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); }

.search-input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  width: 210px;
  outline: none;
  background: var(--card);
  transition: border .15s;
}
.search-input:focus { border-color: var(--primary); }

.block-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* ===== 登录页 ===== */
.login-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef3ff 0%, #f5f0ff 55%, #e0f7f9 100%);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 16px;
  width: 380px;
  max-width: 100%;
  padding: 40px 36px 32px;
  box-shadow: 0 12px 40px rgba(51,112,255,.12);
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #3370ff, #7b61ff);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700;
}
.login-card h1 { font-size: 19px; margin-bottom: 6px; }
.login-sub { font-size: 12px; color: var(--text3); margin-bottom: 28px; }
.login-card .form-item { text-align: left; }
.login-card .form-item + .form-item { margin-top: 14px; }
.login-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border .15s;
  font-family: inherit;
}
.login-card input:focus { border-color: var(--primary); }
.login-error { color: var(--red); font-size: 12px; min-height: 18px; margin: 10px 0 4px; text-align: left; }
.login-card .btn-block { margin-top: 10px; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w);
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid #f0f1f3;
}
.side-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #3370ff, #7b61ff);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; font-weight: 700;
  flex-shrink: 0;
}
.side-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.side-sub { font-size: 10px; color: var(--text3); letter-spacing: .5px; margin-top: 2px; }
.side-nav { flex: 1; padding: 14px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text2);
  margin-bottom: 4px;
  transition: all .15s;
  user-select: none;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-ico { font-size: 15px; }
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 1px 7px;
  font-weight: 500;
}
.side-foot { padding: 12px; border-top: 1px solid #f0f1f3; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg);
  border-radius: 10px;
  padding: 9px 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text3); }
.user-chip .icon-btn { margin-left: 2px; }

.main { flex: 1; min-width: 0; padding: 0 24px 60px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 18px;
  gap: 14px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 19px; }
.page-sub { font-size: 12px; color: var(--text3); margin-top: 3px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-switch { display: flex; background: var(--bg); border-radius: 6px; padding: 3px; }
.view-switch button {
  border: none; background: transparent; padding: 5px 12px;
  border-radius: 5px; cursor: pointer; font-size: 13px; color: var(--text2);
}
.view-switch button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* ===== 统计卡 ===== */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-card .sub { font-size: 12px; color: var(--text2); margin-top: 7px; }
.stat-card .value.c1 { color: var(--primary); }
.stat-card .value.c2 { color: var(--orange); }
.stat-card .value.c3 { color: var(--green); }
.stat-card .value.c4 { color: var(--red); }

/* ===== 财务概览 ===== */
.fin-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.fin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.fin-item { padding: 4px 2px; }
.fin-item + .fin-item { border-left: 1px solid #f0f1f3; padding-left: 18px; }
.fin-label { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.fin-value { font-size: 22px; font-weight: 700; line-height: 1; }
.fin-sub { font-size: 12px; color: var(--text2); margin-top: 7px; }
.fin-mini { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ===== 分类占比 + 负责人 ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.cat-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #f0f1f3; }
.cat-bar .seg { transition: width .3s; }
.cat-legend { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.cat-legend .item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.cat-legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.owner-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.owner-bar-row .nm { width: 56px; font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.owner-bar-row .track { flex: 1; height: 8px; background: #eceef1; border-radius: 4px; overflow: hidden; }
.owner-bar-row .fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.owner-bar-row .cnt { width: 40px; font-size: 12px; color: var(--text2); text-align: right; flex-shrink: 0; }
.owner-empty { font-size: 12px; color: var(--text3); padding: 12px 0; }

/* ===== 工具栏/筛选 ===== */
.toolbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab {
  padding: 5px 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all .15s;
  user-select: none;
}
.tab:hover { background: var(--bg); }
.tab.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.tab .count {
  background: rgba(31,35,41,.06);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 11px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}
.tab.active .count { background: rgba(51,112,255,.15); }

/* ===== 表格 ===== */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 1160px; }
th {
  text-align: left;
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; cursor: pointer; }
tbody tr:hover { background: #f8f9fb; }
.proj-name { font-weight: 600; }
.proj-meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.proj-client { font-size: 12px; color: var(--text3); }
.row-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
tr:hover .row-actions { opacity: 1; }

/* 标签 */
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.tag .dt { width: 6px; height: 6px; border-radius: 50%; }
.tag-video { background: var(--primary-bg); color: var(--primary); } .tag-video .dt { background: var(--primary); }
.tag-design { background: var(--purple-bg); color: var(--purple); } .tag-design .dt { background: var(--purple); }
.tag-event { background: var(--orange-bg); color: var(--orange); } .tag-event .dt { background: var(--orange); }
.tag-social { background: var(--teal-bg); color: var(--teal); } .tag-social .dt { background: var(--teal); }
.tag-gray { background: #f0f1f3; color: var(--text2); } .tag-gray .dt { background: var(--text3); }

.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.status .dt { width: 6px; height: 6px; border-radius: 50%; }
.st-pending { background: #f0f1f3; color: var(--text2); } .st-pending .dt { background: var(--text3); }
.st-doing { background: var(--primary-bg); color: var(--primary); } .st-doing .dt { background: var(--primary); }
.st-done { background: var(--green-bg); color: var(--green); } .st-done .dt { background: var(--green); }
.st-paused { background: var(--red-bg); color: var(--red); } .st-paused .dt { background: var(--red); }

.tag-inv-none { background: #f0f1f3; color: var(--text2); } .tag-inv-none .dt { background: var(--text3); }
.tag-inv-partial { background: var(--orange-bg); color: var(--orange); } .tag-inv-partial .dt { background: var(--orange); }
.tag-inv-done { background: var(--green-bg); color: var(--green); } .tag-inv-done .dt { background: var(--green); }

.prio { font-size: 12px; white-space: nowrap; }
.prio-high { color: var(--red); font-weight: 600; }
.prio-mid { color: var(--orange); }
.prio-low { color: var(--text3); }

.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.progress-track { flex: 1; height: 7px; background: #eceef1; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.progress-num { font-size: 12px; color: var(--text2); width: 34px; text-align: right; }

.deadline { font-size: 13px; white-space: nowrap; }
.deadline.overdue { color: var(--red); font-weight: 600; }
.deadline.soon { color: var(--orange); }

.empty { padding: 60px 20px; text-align: center; color: var(--text3); }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ===== 看板 ===== */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kb-col { background: #eef0f3; border-radius: 10px; padding: 12px; min-height: 260px; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.kb-col-head .t { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kb-col-head .n { font-size: 12px; color: var(--text3); background: var(--card); border-radius: 8px; padding: 0 7px; line-height: 18px; }
.kb-cards { display: flex; flex-direction: column; gap: 10px; }
.kb-card {
  background: var(--card);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: transform .12s;
}
.kb-card:hover { transform: translateY(-2px); }
.kb-card .name { font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.kb-card .meta { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.kb-prog { display: flex; align-items: center; gap: 8px; }
.kb-prog .track { flex: 1; height: 5px; background: #eceef1; border-radius: 3px; overflow: hidden; }
.kb-prog .fill { height: 100%; border-radius: 3px; }
.kb-prog .num { font-size: 11px; color: var(--text3); }
.kb-card .foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text2); }
.kb-card .owner {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  font-size: 11px; font-weight: 600;
}
.kb-empty { text-align: center; color: var(--text3); font-size: 12px; padding: 20px 0; }

/* ===== 弹窗 ===== */
.mask {
  position: fixed; inset: 0;
  background: rgba(31,35,41,.45);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.mask.show { display: flex; }
.modal {
  background: var(--card);
  border-radius: 12px;
  width: 580px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(31,35,41,.25);
}
.modal-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600;
  position: sticky; top: 0; background: var(--card); z-index: 2;
}
.modal-close { border: none; background: none; font-size: 20px; color: var(--text3); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-body.cols1 { grid-template-columns: 1fr; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12px; color: var(--text2); font-weight: 500; }
.form-item label .req { color: var(--red); margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border .15s;
  background: var(--card);
  color: var(--text);
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item textarea { resize: vertical; min-height: 60px; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--card);
}
.progress-editor { display: flex; align-items: center; gap: 12px; }
.progress-editor input[type=range] { flex: 1; accent-color: var(--primary); }
.progress-editor .pv { width: 40px; font-weight: 600; color: var(--primary); text-align: right; }

.team-tip { font-size: 12px; color: var(--text3); margin-top: 14px; line-height: 1.7; }

/* ===== 分类管理 ===== */
.cat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cat-card-top { display: flex; align-items: center; gap: 10px; }
.cat-swatch { width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0; }
.cat-card-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cat-badge {
  font-size: 10px; font-weight: 400;
  background: #f0f1f3; color: var(--text3);
  border-radius: 4px; padding: 1px 6px;
}
.cat-card-meta { font-size: 12px; color: var(--text3); }
.cat-card-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.cat-builtin-tip { font-size: 12px; color: var(--text3); }

/* 色板 */
.color-palette { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.color-dot {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .12s;
}
.color-dot:hover { transform: scale(1.12); }
.color-dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--card); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 70px; left: 50%; transform: translateX(-50%) translateY(-10px);
  background: var(--text); color: #fff;
  border-radius: 6px; padding: 9px 18px;
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: all .25s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); }

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .fin-grid { grid-template-columns: repeat(3, 1fr); }
  .fin-item:nth-child(4) { border-left: none; padding-left: 2px; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .modal-body { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats, .fin-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-item:nth-child(3) { border-left: none; padding-left: 2px; }
  .kanban { grid-template-columns: 1fr; }
  .search-input { width: 100%; }
}
