/* === 小小看板 样式表 === */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --bg: #f0f2f5;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
input, textarea, button { font-family: inherit; font-size: 14px; }
input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500;
  transition: all 0.15s; white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { border: none; background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.btn-icon {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 4px; cursor: pointer; font-size: 18px;
  color: var(--text-secondary);
}
.btn-icon:hover { background: rgba(0,0,0,0.08); color: var(--text); }

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; }
.header-logo { font-size: 18px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 6px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-user { font-size: 14px; color: var(--text-secondary); }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Projects */
.projects-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.projects-header h2 { font-size: 24px; font-weight: 700; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); cursor: pointer; transition: box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 8px;
}
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project-card-name { font-size: 16px; font-weight: 600; }
.project-card-meta { font-size: 13px; color: var(--text-secondary); display: flex; justify-content: space-between; align-items: center; }

/* Boards */
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.board-card {
  background: var(--surface); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.15s;
  text-align: center;
}
.board-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.back-link { color: var(--text-secondary); font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--primary); }

/* Board View */
.board-toolbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.board-title { font-size: 18px; font-weight: 600; }

.board {
  display: flex; gap: 12px; padding: 16px 20px; overflow-x: auto;
  min-height: calc(100vh - 130px); align-items: flex-start;
}

/* List */
.list {
  background: #f3f4f6; border-radius: var(--radius); min-width: 272px; max-width: 272px;
  display: flex; flex-direction: column; max-height: calc(100vh - 160px);
  box-shadow: var(--shadow);
}
.list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--radius) var(--radius) 0 0;
}
.list-title { font-weight: 600; font-size: 14px; }
.list-actions { display: flex; gap: 4px; }

.list-cards {
  flex: 1; overflow-y: auto; padding: 0 8px 8px;
  display: flex; flex-direction: column; gap: 6px; min-height: 40px;
}

.add-list { background: rgba(255,255,255,0.3); min-width: 272px; border-radius: var(--radius); padding: 8px; }
.list-input, .card-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--primary); border-radius: var(--radius);
  background: var(--surface); font-size: 14px;
}

/* Card */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow); cursor: pointer; transition: box-shadow 0.15s;
  position: relative;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card.dragging { opacity: 0.5; transform: rotate(2deg); }
.card-completed { opacity: 0.6; }
.card-completed .card-title { text-decoration: line-through; }
.card-title { font-size: 14px; font-weight: 500; word-break: break-word; }
.card-desc-preview { font-size: 12px; color: var(--text-secondary); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.card-date { font-size: 12px; }
.card-badge { font-size: 10px; padding: 1px 6px; border-radius: 10px; }
.badge-done { background: #d1fae5; color: #065f46; }

.add-card-placeholder { padding: 8px 12px; color: var(--text-secondary); font-size: 14px; cursor: pointer; border-radius: var(--radius); }
.add-card-placeholder:hover { background: rgba(0,0,0,0.05); color: var(--text); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--surface); border-radius: 12px; padding: 24px;
  min-width: 360px; max-width: 640px; width: 90%; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal-card { max-width: 560px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Form */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; background: var(--surface); transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }

/* Card Detail */
.card-detail-header { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 16px; }
.card-detail-title { flex: 1; font-size: 18px; font-weight: 600; border: 1px solid transparent; padding: 4px 8px; border-radius: var(--radius); }
.card-detail-title:focus { border-color: var(--primary); }
.card-detail-desc { width: 100%; min-height: 80px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; }
.card-section { margin-bottom: 16px; }
.card-section-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Comments */
.comments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.comment { padding: 8px 12px; background: #f9fafb; border-radius: var(--radius); }
.comment-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.comment-time { font-size: 12px; color: var(--text-secondary); }
.comment-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: 8px; }
.comment-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); }

/* Login Page */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: var(--surface); border-radius: 16px; padding: 40px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; font-size: 48px; margin-bottom: 8px; }
.login-title { text-align: center; font-size: 24px; font-weight: 700; margin-bottom: 24px; color: var(--primary); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.form-error { background: #fef2f2; color: var(--danger); padding: 10px 12px; border-radius: var(--radius); font-size: 14px; }

/* States */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-secondary); font-size: 16px; }
.main-loading { text-align: center; padding: 48px; color: var(--text-secondary); }
.main-error { text-align: center; padding: 48px; color: var(--danger); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }
