/* ================= 看板区样式 ================= */
.board {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.board::-webkit-scrollbar { height: 8px; }
.board::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
.board::-webkit-scrollbar-track { background: transparent; }

/* 列样式 */
.column {
  flex: 0 0 320px;
  width: 320px;
  max-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  transition: transform .3s, box-shadow .3s;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  cursor: grab;
}

.column:active {
  cursor: grabbing;
}

.column:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.column.drag-over {
  border: 2px dashed var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: scale(1.02);
}

.column.dragging-column {
  opacity: 0.5;
  transform: scale(0.95);
}

@media (hover: none) {
  .column:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  }

  .column:active {
    transform: scale(0.98);
  }
}

/* 列头部 */
.column-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 8px;
  padding-left: 16px;
  cursor: grab;
}

.column-header:active {
  cursor: grabbing;
}

.column-header::before {
  content: '⋮⋮';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: -2px;
  transition: opacity 0.2s, color 0.2s;
  opacity: 0;
}

.column:hover .column-header::before {
  opacity: 1;
}

.column-header:hover::before {
  color: rgba(255, 255, 255, 0.5);
}

.column-title {
  flex: 1 1 auto;
  margin: 0;
  padding: 4px 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  outline: none;
  cursor: text;
  overflow-wrap: anywhere;
  transition: .2s;
}
.column-title:focus {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.column-count {
  flex: 0 0 auto;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  border-radius: 12px;
  min-width: 32px;
  text-align: center;
}

.icon-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: .2s;
}
.column:hover .icon-btn { opacity: 1; }
.icon-btn:hover { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.icon-btn.show { opacity: 1; }

/* 卡片列表 */
.card-list {
  flex: 1 1 auto;
  min-height: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.card-list::-webkit-scrollbar { width: 5px; }
.card-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.card-list::-webkit-scrollbar-track { background: transparent; }

/* 分组块 */
.group-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.group-block.hidden { display: none; }

.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
}
.group-dot {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.group-name {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  overflow-wrap: anywhere;
  letter-spacing: 0.5px;
}
.group-count {
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.group-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
  border-radius: 12px;
  min-height: 40px;
  transition: background .2s;
}
.group-cards:empty::before {
  content: '拖拽卡片到此处';
  display: block;
  padding: 12px 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

/* 添加卡片按钮 */
.add-card-mini {
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: .2s;
  display: flex;
  align-items: center;
}
.add-card-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(4px);
}
.add-card-mini svg {
  flex-shrink: 0;
}

/* 卡片样式 */
.card {
  position: relative;
  padding: 14px 16px;
  background: var(--card-gradient);
  border: none;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: grab;
  transition: transform .2s, box-shadow .2s;
  user-select: none;
  touch-action: auto;
  -webkit-tap-highlight-color: transparent;
}
.card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.15);
}
.card:active { cursor: grabbing; transform: scale(0.98); }
.card.dragging {
  opacity: .4;
  border: 2px dashed var(--primary);
  box-shadow: none;
}
.card.hidden { display: none; }

@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

.card-title {
  padding-right: 24px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card-desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 卡片内链接 */
.card-link {
  color: #818cf8;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  cursor: pointer;
  transition: color 0.15s;
}
.card-link:hover {
  color: #a5b4fc;
}

.card-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: .2s;
}
.card:hover .card-del { opacity: 1; }
.card-del:hover { background: #fee2e2; color: var(--danger); }

/* 卡片图片附件 */
.card-attachments {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-attachment-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.card-attachment-thumb:hover {
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  font-size: 11px;
  color: var(--primary);
  margin-top: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.card-attachment-badge:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
  border-color: var(--primary);
}

.card-attachment-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* 子看板标识 */
.card-sub-board {
  margin-top: 10px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  transition: .2s;
}
.card-sub-board:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border-color: var(--primary);
  transform: translateX(2px);
}
.card-sub-board svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* 卡片编辑器 */
.card-composer textarea {
  width: 100%;
  min-height: 70px;
  padding: 14px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: 14px;
  outline: none;
  resize: none;
  box-shadow: 0 0 0 4px var(--primary-glow), 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* 添加列按钮 */
.add-column-btn {
  flex: 0 0 300px;
  height: 56px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-column-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 30px var(--primary-glow);
}
.add-column-btn:hover svg {
  animation: icon-pulse 0.4s ease-in-out;
}

/* 新列输入框 */
.column-new {
  flex: 0 0 320px;
  width: 320px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}
.col-name-input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--primary);
  border-radius: 12px;
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.col-name-input::placeholder { color: rgba(255, 255, 255, 0.4); }
