:root {
  --bg: #f6f8fb;
  --panel: #fff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --gray: #6b7280;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(100% - 32px, 1400px);
  margin: 0 auto;
  padding: 22px 0 40px;
}

.topbar,
.section-head,
.userbar,
.order-head,
.name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.subtle {
  color: var(--muted);
  font-size: 13px;
}

.panel,
.status-card,
.orders-panel,
.summary-card,
.order-editor,
.history-panel,
.manager-content {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.login-panel {
  max-width: 720px;
}

.login-grid,
.toolbar,
.form-grid,
.manager-tools,
.assignment-controls,
.advanced-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

label,
.status-form {
  display: grid;
  gap: 6px;
}

label span,
.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.summary-card {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.summary-card strong {
  font-size: 26px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.tag-row,
.status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.status-pill,
.risk-pill,
.freshness-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag {
  background: #e0f2fe;
  color: #075985;
}

.status-可接 {
  background: #dcfce7;
  color: var(--green);
}

.status-谨慎 {
  background: #fef3c7;
  color: var(--amber);
}

.status-满载 {
  background: #fee2e2;
  color: var(--red);
}

.status-休息 {
  background: #e5e7eb;
  color: var(--gray);
}

.risk-pill {
  background: #fff7d6;
  color: var(--amber);
}

.risk-high,
.stale {
  background: #fee2e2;
  color: var(--red);
}

.fresh {
  background: #dcfce7;
  color: var(--green);
}

.artist-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

.status-card,
.orders-panel,
.manager-content {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.status-form {
  margin-top: 12px;
}

.status-option {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  cursor: pointer;
}

.status-option.active {
  border-color: var(--blue);
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.notice,
.success,
.empty-state {
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}

.notice {
  background: #eff6ff;
  color: #1d4ed8;
}

.success {
  background: #dcfce7;
  color: var(--green);
  font-weight: 800;
}

.login-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.login-message.error {
  color: var(--red);
  font-weight: 800;
}

.login-message.success {
  color: var(--green);
  font-weight: 800;
}

.orders-list,
.history-list {
  display: grid;
  gap: 10px;
}

.order-editor,
.history-panel {
  padding: 12px;
}

.readonly-badge:empty {
  display: none;
}

.wide {
  grid-column: 1 / -1;
}

.history-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.manager-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.manager-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  cursor: pointer;
}

.manager-tab.active {
  border-color: var(--blue);
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.placeholder-card {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.recommend-panel,
.project-filter-panel,
.warning-group,
.profile-manager,
.project-list,
.recommend-list,
.reason-list {
  display: grid;
  gap: 12px;
}

.recommend-panel,
.project-filter-panel,
.warning-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 14px;
}

.quick-filters,
.tag-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filter,
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
}

.quick-filter strong {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
}

.quick-filter.active {
  border-color: var(--blue);
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.recommend-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.recommend-card,
.project-card,
.profile-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 13px;
}

.recommend-head,
.profile-head,
.project-card-head,
.project-meta-line,
.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-card {
  cursor: pointer;
}

.project-card:hover,
.expanded-project {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.score-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
  padding: 4px 10px;
  white-space: nowrap;
}

.score-help {
  position: relative;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--muted);
  cursor: help;
  font-size: 12px;
  font-weight: 900;
}

.score-help:hover::after,
.score-help:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: 28px;
  z-index: 5;
  width: 220px;
  white-space: pre-line;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  box-shadow: var(--shadow);
}

.load-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.load-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
}

.risk-mid {
  background: #fef3c7;
  color: var(--amber);
}

.project-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.project-detail div {
  display: grid;
  gap: 4px;
}

.project-detail span {
  color: var(--muted);
  font-size: 12px;
}

.text-action {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-panel,
.team-capacity {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.business-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.metric-tile,
.schedule-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfdff;
  padding: 12px;
}

.metric-tile strong,
.schedule-item strong {
  font-size: 24px;
}

.metric-tile small,
.metric-tile span,
.schedule-item span {
  color: var(--muted);
  font-size: 12px;
}

.progress-block,
.bar-list,
.capacity-board,
.capacity-list {
  display: grid;
  gap: 10px;
}

.progress-head,
.bar-label,
.capacity-person,
.team-capacity summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-bar,
.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-bar span,
.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  color: var(--muted);
  font-size: 13px;
}

.bar-label strong {
  color: var(--ink);
}

.capacity-note,
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.capacity-note span {
  border-radius: 8px;
  background: #f1f5f9;
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.team-capacity summary {
  cursor: pointer;
  font-weight: 800;
}

.team-capacity summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.capacity-person {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .topbar,
  .section-head,
  .artist-layout,
  .order-head,
  .project-card-head,
  .project-meta-line,
  .list-head,
  .project-detail,
  .dashboard-grid,
  .progress-head,
  .bar-label,
  .capacity-person,
  .team-capacity summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wide-panel {
    grid-column: auto;
  }
}
