/* ═══════════════════════════════════════════════
   快反通 (FastResponse) — Apple 风格样式表
   ═══════════════════════════════════════════════ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Apple Gray Scale */
  --clr-bg:        #f5f5f7;
  --clr-surface:   #ffffff;
  --clr-border:    #d2d2d7;
  --clr-separator: #e5e5ea;
  --clr-text:      #1d1d1f;
  --clr-text2:     #6e6e73;
  --clr-text3:     #aeaeb2;

  /* Status Colors */
  --clr-pending:   #aeaeb2;  /* 灰色 — 未开始 */
  --clr-active:    #ff9f0a;  /* 黄色 — 进行中 */
  --clr-done:      #30d158;  /* 绿色 — 已完成 */
  --clr-overdue:   #ff453a;  /* 红色 — 逾期报警 */
  --clr-info:      #007aff;  /* iOS Blue */

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.10);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ═══ Reset ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--clr-info); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ═══ Layout ═══ */
.app-header {
  background: var(--clr-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--clr-separator);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.app-header .header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

/* ═══ Three-Column Kanban ═══ */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) {
  .kanban { grid-template-columns: 1fr; }
}

.kanban-column {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kanban-column-header {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--clr-separator);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-column-header .badge {
  font-size: 12px;
  font-weight: 500;
  background: var(--clr-bg);
  color: var(--clr-text2);
  padding: 2px 10px;
  border-radius: 99px;
}
.kanban-column-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

/* ���══ Cards ═══ */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-separator);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
}
.card:hover {
  border-color: var(--clr-info);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card .card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}
.card .card-meta {
  font-size: 12px;
  color: var(--clr-text2);
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.card .card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card .deadline-warning { color: var(--clr-overdue); }

/* ═══ Status Ball ═══ */
.status-ball {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.3s var(--ease);
}
.status-ball.pending    { background: var(--clr-pending); box-shadow: 0 0 6px rgba(174,174,178,0.3); }
.status-ball.in_progress,
.status-ball.active     { background: var(--clr-active); box-shadow: 0 0 6px rgba(255,159,10,0.4); }
.status-ball.completed,
.status-ball.done       { background: var(--clr-done); box-shadow: 0 0 6px rgba(48,209,88,0.4); }
.status-ball.overdue    { background: var(--clr-overdue); box-shadow: 0 0 6px rgba(255,69,58,0.5); animation: pulse-overdue 1.5s infinite; }

@keyframes pulse-overdue {
  0%, 100% { box-shadow: 0 0 6px rgba(255,69,58,0.4); }
  50%      { box-shadow: 0 0 16px rgba(255,69,58,0.8); }
}

/* ═══ Severity Badge ═══ */
.severity-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.severity-1 { background: #ffd1d1; color: #bf2b2b; }
.severity-2 { background: #ffe5b4; color: #b87a1b; }
.severity-3 { background: #d4edda; color: #166534; }
.severity-4 { background: #e8e8ed; color: #6e6e73; }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--clr-info);
  color: #fff;
}
.btn-primary:hover { background: #0062cc; }
.btn-secondary {
  background: var(--clr-bg);
  color: var(--clr-text);
}
.btn-secondary:hover { background: #e8e8ed; }
.btn-danger {
  background: var(--clr-overdue);
  color: #fff;
}
.btn-danger:hover { background: #d6312a; }
.btn-sm { font-size: 12px; padding: 5px 12px; }

/* ═══ Forms ═══ */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--clr-text2);
  margin-bottom: 4px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: var(--clr-surface);
  color: var(--clr-text);
  transition: border-color 0.2s var(--ease);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--clr-info);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* ═══ Modal ═══ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: modal-in 0.25s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 18px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--clr-bg);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text2);
  transition: background 0.2s;
}
.modal-close:hover { background: var(--clr-border); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--clr-separator);
}

/* ═══ Notifications ═══ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--clr-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: toast-in 0.3s var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ Loading ═══ */
.loading-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-info);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Timeline View ═══ */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--clr-separator);
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--clr-border);
  border: 2px solid var(--clr-surface);
}
.timeline-item.active::before { background: var(--clr-active); }
.timeline-item.done::before { background: var(--clr-done); }
.timeline-item.overdue::before { background: var(--clr-overdue); }

/* ═══ Empty State ═══ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--clr-text2);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ═══ Responsive helpers ═══ */
.hidden-mobile { display: inherit; }
.hidden-desktop { display: none; }
@media (max-width: 768px) {
  .hidden-mobile { display: none; }
  .hidden-desktop { display: inherit; }
  .container { padding: 12px; }
}
