/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.project-controls {
    display: flex;
    gap: 10px;
}

button {
    padding: 8px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

input, select, textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 横向板块样式 */
.board-container {
    padding: 20px;
    overflow-x: auto;
}

.board {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 幕行样式 */
.act-row {
    display: flex;
    flex-direction: column;
    background: #ecf0f1;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.act-header {
    padding: 15px;
    background: #34495e;
    color: white;
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 节拍槽样式 */
.beat-slots {
    display: flex;
    padding: 10px;
    overflow-x: auto;
    min-height: 200px;
}

.beat-slot {
    min-width: 250px;
    width: 250px; /* 固定宽度 */
    margin: 0 10px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
}

/* 过渡区域样式 */
.flexible-area {
    min-width: 150px;
    background: #f3f8fa;
}

.flexible-area h3 {
    background: #95a5a6;
    color: white;
    font-size: 12px;
    opacity: 0.7;
}

.beat-slot h3 {
    padding: 10px;
    height: 40px; /* 固定高度 */
    background: #95a5a6;
    color: white;
    text-align: center;
    font-size: 14px;
    border-radius: 5px 5px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.card-list {
    padding: 10px;
    height: 250px; /* 固定高度 */
    min-height: unset; /* 覆盖之前的设置 */
    max-height: unset; /* 覆盖之前的设置 */
    overflow-y: auto;
    flex-grow: 1;
}

.add-card-btn {
    width: 100%;
    padding: 5px;
    margin-top: auto;
    background: #7f8c8d;
    color: white;
    border: none;
    border-radius: 0 0 5px 5px;
    cursor: pointer;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: move; /* 表示可拖动 */
    position: relative;
    user-select: none; /* 防止拖动时选中文本 */
}

.card:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.card-location {
    font-weight: bold;
    margin-bottom: 5px;
}

.card-description {
    font-size: 14px;
    color: #555;
}

.card-type-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

/* 卡片类型颜色 */
.card[data-type="single-beat"] .card-type-indicator { background-color: #e74c3c; }
.card[data-type="setup"] .card-type-indicator { background-color: #3498db; }
.card[data-type="fun-games"] .card-type-indicator { background-color: #2ecc71; }
.card[data-type="villain"] .card-type-indicator { background-color: #f1c40f; }
.card[data-type="dark-night"] .card-type-indicator { background-color: #9b59b6; }
.card[data-type="finale"] .card-type-indicator { background-color: #e67e22; }

/* 拖动时的样式 */
/* 拖动时的样式 */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    background-color: #f8f9fa;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* 卡片堆叠效果 */
.card-stack {
    position: relative;
    height: 80px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-stack::before {
    content: attr(data-count) "张卡片";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #34495e;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 5;
}

.card-stack .stack-preview {
    position: absolute;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    padding: 15px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.card-stack .stack-preview:nth-child(1) {
    top: 0;
    left: 0;
    z-index: 4;
}

.card-stack .stack-preview:nth-child(2) {
    top: 3px;
    left: 3px;
    z-index: 3;
    opacity: 0.8;
}

.card-stack .stack-preview:nth-child(3) {
    top: 6px;
    left: 6px;
    z-index: 2;
    opacity: 0.6;
}

/* 卡片堆叠悬停效果 */
.card-stack:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 卡片展开时的容器 */
.expanded-stack {
    background: rgba(236, 240, 241, 0.8);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    position: relative;
}

.expanded-stack .stack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.expanded-stack .stack-title {
    font-weight: bold;
    color: #34495e;
}

.expanded-stack .collapse-btn {
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
}

.expanded-stack .collapse-btn:hover {
    background: #7f8c8d;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
}
/* 修改统计模态框样式 */
#stats-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
    max-width: 800px;
}
  
.stats-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

/* 桶区域样式 */
.bucket-row {
    background: #ffeaa7;
}

.bucket-row .act-header {
    background: #fdcb6e;
    color: #333;
}

.bucket {
    background: #fff6dd;
}

/* 页脚样式 */
footer {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    position: sticky;
    bottom: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* 卡片计数样式 */
.card-count {
    font-size: 14px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* 剧本类型选择器样式 */
.script-type-selector {
    padding: 8px 12px;
    margin-right: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

/* 节拍推荐数量样式 */
.beat-recommended {
    font-size: 12px;
    color: #7f8c8d;
    margin: 0;
    padding: 5px 10px;
    text-align: center;
    height: 25px; /* 固定高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 幕标题样式优化 */
.act-header h2 {
    font-size: 18px;
    margin: 0;
}

/* 改进的节拍提示样式 */
.beat-hint {
    padding: 10px;
    font-style: italic;
    font-size: 12px;
    color: #95a5a6;
    text-align: center;
    border-bottom: 1px dashed #ecf0f1;
    height: 60px; /* 固定高度 */
    min-height: unset; /* 覆盖之前的设置 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 隐藏有卡片时的提示 */
.beat-slot.has-cards .beat-hint {
    display: none;
}

/* 单幕视图时的样式 */
.board.filtered-view .act-row {
    display: flex;
}

.board.filtered-view .act-row.hidden {
    display: none;
}

.board.filtered-view .beat-slots {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.board.filtered-view .beat-slot {
    width: calc(33.33% - 20px);
    min-width: auto;
}

/* 视图控制样式 */
.view-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 0;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 60px;
    z-index: 90;
}

.view-btn {
    padding: 8px 15px;
    background: #ecf0f1;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: #dfe6e9;
}

.view-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

/* 顶部按钮样式调整 */
.project-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.header-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


/* 确保不同状态的卡片有不同的视觉样式 */
.card[data-status="confirmed"] {
    border-left: 3px solid #2ecc71;
}

.card[data-status="pending"] {
    border-left: 3px solid #f1c40f;
}

.card[data-status="question"] {
    border-left: 3px solid #e74c3c;
}

/* 版本信息样式调整 */
.version-info {
  display: inline-block;
  margin-left: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  vertical-align: middle;
}

/* 反馈按钮 */
.feedback-btn {
  background-color: #9b59b6;
}

.feedback-btn:hover {
  background-color: #8e44ad;
}

/* 自动保存指示器 */
.autosave-indicator {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(46, 204, 113, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.autosave-indicator.show {
  opacity: 1;
}

/* 提示消息样式 */
.toast-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 快速添加菜单简化样式 */
.quick-add-menu {
    position: fixed;
    bottom: 100px;
    right: 40px;
    width: 400px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.2);
    z-index: 96;
    display: none;
    overflow: hidden;
}

.quick-add-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #3498db;
    color: white;
}

.quick-add-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-quick-add {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.quick-add-content {
    padding: 20px;
}

.quick-add-section {
    margin-bottom: 15px;
}

.quick-add-section label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.act-beat-selector {
    display: flex;
    gap: 10px;
}

.act-selector {
    flex: 1;
}

.beat-selector {
    flex: 2;
}

#quick-add-description {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    font-size: 15px;
    resize: vertical;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.quick-add-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.quick-add-actions button {
    flex: 1;
    padding: 12px;
    font-size: 15px;
}
.quick-add-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #3498db;
  color: white;
}

.quick-add-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-quick-add {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-quick-add:hover {
  background: rgba(255,255,255,0.2);
}

.quick-add-content {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.quick-add-section {
  margin-bottom: 20px;
}

.quick-add-section label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

.act-beat-selector {
  display: flex;
  gap: 10px;
}

.act-selector {
  flex: 1;
}

.beat-selector {
  flex: 2;
}

.status-options {
  display: flex;
  gap: 15px;
}

.status-option {
  flex: 1;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.status-option:hover {
  background: #f8f9fa;
}

.status-option.selected {
  border-color: #3498db;
  background: #f0f9ff;
}

.status-emoji {
  font-size: 20px;
  display: block;
  margin-bottom: 5px;
}

.location-input {
  display: flex;
  gap: 10px;
}

#quick-add-location-type {
  width: 100px;
}

#quick-add-location {
  flex-grow: 1;
}

#quick-add-description {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
}

.quick-add-actions {
  display: flex;
  gap: 10px;
}

.quick-add-actions button {
  flex: 1;
  padding: 12px;
  font-size: 16px;
}

#quick-add-save {
  background: #2ecc71;
}

#quick-add-save:hover {
  background: #27ae60;
}

#quick-add-save-and-new {
  background: #3498db;
}

#quick-add-save-and-new:hover {
  background: #2980b9;
}

/* 将下拉菜单和输入框的样式更统一 */
select, input, textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 优化冲突输入区域 */
.conflict-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* 优化情感变化输入区域 */
.emotional-change-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

#emotional-change-type {
  width: 120px;
}

#emotional-change-content {
  flex-grow: 1;
}

/* 浮动添加按钮 */
.floating-add-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #3498db;
  color: white;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 95;
  transition: all 0.2s;
}

.floating-add-button:hover {
  transform: scale(1.1);
  background: #2980b9;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .board.filtered-view .beat-slot {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .header-buttons {
        flex-direction: row;
        width: 100%;
        margin-top: 10px;
    }
    
    .view-controls {
        flex-wrap: wrap;
    }
    
    .board.filtered-view .beat-slot {
        width: 100%;
    }
    
    .beat-slots {
        flex-direction: column;
    }
    
    .beat-slot {
        min-width: 100%;
        margin: 10px 0;
    }
    
    .conflict-inputs {
        grid-template-columns: 1fr;
    }
    
    .emotional-change-inputs {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #emotional-change-type,
    #emotional-change-content {
        width: 100%;
    }
}

/* iPad 和移动设备优化 */
@media (max-width: 1024px) {
    /* iPad Pro 和其他平板设备 */
    html {
      font-size: 18px; /* 增大基础字体大小 */
    }
    
    .beat-slot {
      min-width: 280px;
    }
    
    button, .add-card-btn, .view-btn {
      min-height: 44px; /* Apple 推荐的最小触控尺寸 */
      padding: 12px 15px;
    }
    
    .card {
      padding: 16px;
      margin-bottom: 12px;
    }
    
    /* 改进卡片拖动手柄 */
    .card::before {
      content: "≡";
      position: absolute;
      top: 8px;
      left: 8px;
      color: #ccc;
      font-size: 20px;
      opacity: 0.7;
    }
}

/* 检测 iPad 设备 */
@media (pointer: coarse) and (min-width: 768px) and (max-width: 1024px) {
    /* 特定的 iPad 优化 */
    .board-container {
      -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    }
    
    /* 优化触控区域 */
    .beat-slot h3 {
      padding: 15px 10px;
    }
    
    .card-list {
      min-height: 150px; /* 增大拖放区域 */
    }
    
    .quick-add-menu {
      width: 500px;
    }
    
    .status-options {
      gap: 20px;
    }
    
    select, input, textarea, button {
      font-size: 16px; /* 更大的文本提高可点击性 */
    }
}

@media (max-width: 500px) {
  .quick-add-menu {
    width: 90%;
    right: 5%;
    left: 5%;
  }
  
  .status-options {
    flex-direction: column;
    gap: 5px;
  }
  
  .quick-add-actions {
    flex-direction: column;
  }
}
/* 浮动功能菜单 */
.floating-menu {
  position: fixed;
  bottom: 30px;
  right: 100px; /* 位于添加按钮右侧 */
  display: flex;
  gap: 15px;
  z-index: 95;
}

.floating-menu-item {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #3498db;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.floating-menu-item:hover {
  transform: scale(1.1);
  background: #2980b9;
}

.menu-icon {
  font-size: 20px;
  font-style: normal;
}

.menu-text {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
  margin-bottom: 5px;
}

.floating-menu-item:hover .menu-text {
  opacity: 1;
}

#trash-bin-btn {
  background: #e74c3c;
}

#trash-bin-btn:hover {
  background: #c0392b;
}

#inspiration-btn {
  background: #f39c12;
}

#inspiration-btn:hover {
  background: #d35400;
}

/* 拖拽删除用的垃圾桶 */
.drag-trash-bin {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 120px;
  height: 120px;
  background-color: rgba(231, 76, 60, 0.8);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
}

.drag-trash-bin.visible {
  opacity: 1;
  pointer-events: all;
}

.drag-trash-bin.drag-over {
  transform: scale(1.1);
  background-color: rgba(231, 76, 60, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.trash-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.trash-text {
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.hidden {
  display: none;
}

/* 卡片被拖拽时的样式 */
.card.is-dragging {
  opacity: 0.8;
  transform: scale(0.95);
}
/* 项目加载模态框样式 */
#load-project-modal .modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.project-list-container {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.project-list-header {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr;
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.project-list {
    max-height: 400px;
    overflow-y: auto;
}

.project-item {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.project-item:hover {
    background-color: #f5f5f5;
}

.project-item:last-child {
    border-bottom: none;
}

.project-actions {
    display: flex;
    gap: 8px;
}

.project-action-btn {
    padding: 5px 10px;
    font-size: 12px;
    min-height: unset;
}

.load-btn {
    background-color: #2ecc71;
}

.load-btn:hover {
    background-color: #27ae60;
}

.rename-btn {
    background-color: #3498db;
}

.rename-btn:hover {
    background-color: #2980b9;
}

.delete-btn {
    background-color: #e74c3c;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.no-projects {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

.project-date {
    color: #7f8c8d;
    font-size: 14px;
}

/* 高亮当前加载的项目 */
.project-item.current {
    background-color: #e8f6ff;
}

.project-item.current::before {
    content: "当前项目";
    position: absolute;
    right: 10px;
    top: 5px;
    background: #3498db;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
}

/* 工具提示样式 */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    width: max-content;
    max-width: 300px;
    text-align: center;
    margin-bottom: 5px;
    pointer-events: none;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: -5px;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 针对顶部导航栏按钮的特殊调整 */
.header-buttons [data-tooltip]::before {
    bottom: auto;
    top: 100%;
    margin-top: 5px;
}

.header-buttons [data-tooltip]::after {
    bottom: auto;
    top: 100%;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
    margin-top: 0;
}
/* 拖拽增强样式 */
.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f8ff !important; /* 淡蓝色背景 */
    border: 2px dashed #3498db !important;
    box-shadow: none !important;
    transform: scale(0.98);
    transition: all 0.2s ease;
}

.sortable-chosen {
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
    transform: scale(1.02) rotate(1deg);
    z-index: 100;
    transition: all 0.2s ease;
}

.sortable-drag {
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: scale(1.02) rotate(1deg);
}

/* 可放置区域高亮 */
.beat-slot.drop-target {
    background-color: rgba(52, 152, 219, 0.1);
    border: 2px dashed #3498db;
    transition: all 0.2s ease;
}

.card-list.drop-target {
    background-color: rgba(52, 152, 219, 0.15);
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* 垃圾桶拖拽动画增强 */
.drag-trash-bin {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.drag-trash-bin.visible {
    opacity: 1;
    transform: scale(1);
}

.drag-trash-bin.drag-over {
    transform: scale(1.1);
    background-color: #e74c3c;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.drag-trash-bin.drag-over .trash-icon {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    animation-iteration-count: infinite;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* 拖拽卡片的动画效果 */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.card.is-dragging {
    opacity: 0.9;
    transform: scale(1.02) rotate(1deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 100;
}
/* 改进的提示消息样式 */
.toast-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 500;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success {
  background: rgba(46, 204, 113, 0.9);
}

.toast-error {
  background: rgba(231, 76, 60, 0.9);
}

.toast-warning {
  background: rgba(241, 196, 15, 0.9);
}

.toast-info {
  background: rgba(52, 152, 219, 0.9);
}

/* iPad专用布局优化 */
@media only screen and (min-width: 768px) and (max-width: 1366px) {
  /* 调整主容器布局 */
  .board-container {
      padding: 10px;
  }
  
  /* 修改幕区域布局 */
  .act-row {
      margin-bottom: 20px;
  }
  
  /* 重要改变：使节拍槽在iPad上横向排列成网格 */
  .beat-slots {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 15px;
      padding: 15px;
      overflow-x: initial; /* 覆盖原来的横向滚动 */
      min-height: initial; /* 覆盖原来的最小高度 */
  }
  
  /* 调整节拍槽尺寸 */
  .beat-slot {
      width: 100%;
      min-width: initial;
      margin: 0;
      height: auto;
  }
  
  /* 调整卡片列表区域 */
  .card-list {
      height: auto;
      min-height: 150px;
      max-height: 400px;
  }
  
  /* 增大卡片尺寸和间距以便于触控 */
  .card {
      padding: 18px;
      margin-bottom: 15px;
      border-radius: 8px;
  }
  
  /* 改进添加按钮的触控区域 */
  .add-card-btn {
      height: 44px;
      font-size: 20px;
  }
  
  /* 优化浮动按钮位置和大小 */
  .floating-add-button {
      bottom: 40px;
      right: 40px;
      width: 70px;
      height: 70px;
      font-size: 35px;
  }
  
  .floating-menu {
      bottom: 40px;
      right: 120px;
  }
  
  .floating-menu-item {
      width: 60px;
      height: 60px;
  }
  
  /* 优化滚动体验 */
  .card-list, .beat-slots {
      -webkit-overflow-scrolling: touch;
      scroll-behavior: smooth;
  }
  
  /* 针对分屏模式的优化 */
  @media (max-width: 900px) {
      .beat-slots {
          grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      }
  }
  
  /* 横屏模式可以显示更多列 */
  @media (orientation: landscape) {
      .beat-slots {
          grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      }
  }
}

/* iPad Pro 大屏幕优化 */
@media only screen and (min-width: 1024px) and (max-width: 1366px) {
  .beat-slots {
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* 触控设备通用优化 */
@media (pointer: coarse) {
  /* 增强可点击区域 */
  button, .add-card-btn, .card, .beat-slot h3 {
      cursor: pointer;
  }
  
  /* 触摸反馈效果 */
  .card:active {
      transform: scale(0.98);
      background-color: #f9f9f9;
      transition: transform 0.1s ease, background-color 0.1s ease;
  }
  
  button:active, .add-card-btn:active, .floating-add-button:active, .floating-menu-item:active {
      transform: scale(0.95);
      opacity: 0.9;
      transition: transform 0.1s ease, opacity 0.1s ease;
  }
}

/* 拖拽动画增强 */
.sortable-ghost {
  opacity: 0.4;
  background-color: #f0f8ff !important;
  border: 2px dashed #3498db !important;
  box-shadow: none !important;
  transform: scale(0.95);
  transition: all 0.2s ease;
}

.sortable-chosen {
  z-index: 100;
  box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23) !important;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

.sortable-drag {
  opacity: 0.9;
  background: white;
  transform: rotate(1deg) scale(1.02);
  transition: all 0.2s ease;
  box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}

/* 拖放目标区域样式 */
.card-list.drop-target {
  background-color: rgba(52, 152, 219, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.card-list.active-drop-target {
  background-color: rgba(52, 152, 219, 0.15);
  border: 1px dashed #3498db;
  transition: all 0.2s ease;
}

/* 删除动画 */
.card-deleted {
  transform: scale(0) rotate(10deg);
  opacity: 0;
  transition: all 0.3s ease;
}

/* 拖拽中的卡片样式 */
.card.is-dragging {
  opacity: 0.9;
  background-color: white;
  transform: scale(1.02) rotate(1deg);
  box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  z-index: 100;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 垃圾桶拖拽动画增强 */
.drag-trash-bin {
  display: none;
  position: fixed;
  bottom: 50px;
  right: 50px;
  width: 120px;
  height: 120px;
  background-color: rgba(231, 76, 60, 0.85);
  border-radius: 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.drag-trash-bin.visible {
  transform: scale(1);
  opacity: 1;
}

.drag-trash-bin.drag-over {
  transform: scale(1.1);
  background-color: #e74c3c;
  box-shadow: 0 7px 20px rgba(0,0,0,0.4);
}

.drag-trash-bin.drag-over .trash-icon {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  animation-iteration-count: infinite;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* iPad专用动画优化 */
@media only screen and (min-width: 768px) and (max-width: 1366px) {
  .drag-trash-bin {
      width: 150px;
      height: 150px;
      bottom: 60px;
      right: 60px;
  }
  
  .trash-icon {
      font-size: 50px;
  }
  
  .trash-text {
      font-size: 16px;
  }
}
/* 卡片编辑优化样式 */
.card-edit-content {
    padding: 24px;
    max-width: 550px;
}

/* 改进卡片状态选择器 */
.card-status-selector .status-options {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.card-status-selector .status-option {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
}

.card-status-selector .status-option:hover {
    background: #f0f0f0;
}

.card-status-selector .status-option.selected {
    border-color: #3498db;
    background: #e6f7ff;
    box-shadow: 0 0 0 1px #3498db;
}
.location-input {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

#scene-location-type {
    width: 80px;
    font-weight: bold;
}

#scene-location {
    flex: 1;
}

#scene-description {
    min-height: 100px;
    font-size: 15px;
    margin-top: 8px;
    line-height: 1.5;
}

/* 冲突选项卡样式 */
.conflict-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

/* 改进冲突部分 */
.conflict-tabs {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.conflict-tab {
    padding: 12px 15px;
    cursor: pointer;
    flex: 1;
    text-align: center;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    transition: all 0.2s;
    font-weight: 500;
}

.conflict-tab:last-child {
    border-right: none;
}

.conflict-tab.active {
    background: white;
    color: #3498db;
    box-shadow: inset 0 -2px 0 #3498db;
}

.conflict-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    display: none;
}

.conflict-input.active {
    display: block;
}
.conflict-input:focus {
    outline: none;
}

.conflict-input.active {
    display: block;
}

/* 改进情感变化按钮 */
.emotion-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 10px;
}

.emotion-btn {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.emotion-btn:hover {
    background: #f0f0f0;
}

.emotion-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 0 0 1px #3498db;
}
/* 按钮样式改进 */
.primary-btn {
    background: #2ecc71;
    font-size: 16px;
    padding: 10px 24px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.primary-btn:hover {
    background: #27ae60;
}

.secondary-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
}

.secondary-btn:hover {
    background: #e5e5e5;
}

.danger-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
}

.danger-btn:hover {
    background: #c0392b;
}

/* 调整按钮样式 */
.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.primary-btn {
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #27ae60;
}

.secondary-btn {
    background: #f5f7fa;
    color: #444;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #eef2f7;
}

.danger-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.danger-btn:hover {
    background: #c0392b;
}

/* 快速添加优化样式 */
.quick-add-menu {
    width: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.quick-add-header {
    background: #3498db;
    padding: 16px 20px;
}

.quick-add-header h3 {
    font-size: 18px;
    margin: 0;
}

.quick-add-content {
    padding: 20px;
}

.quick-add-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.quick-status-options {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.quick-status-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #f5f5f5;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-status-option:hover {
    background: #f0f0f0;
}

.quick-status-option.selected {
    border-color: #3498db;
    background: #ebf5fb;
}

.quick-add-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.quick-add-actions button {
    flex: 1;
    padding: 12px;
    font-size: 15px;
}

#quick-add-description {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    font-size: 15px;
    resize: vertical;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 8px;
}

#quick-add-description:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 触控优化 */
@media (pointer: coarse) {
    .status-option, .conflict-tab, .emotion-btn, .quick-status-option {
        padding: 12px;
        min-height: 44px;
    }
    
    .emotion-btn, .quick-status-option {
        width: 50px;
        height: 50px;
    }
    
    .form-actions button, .quick-add-actions button {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    input, select, textarea {
        font-size: 16px; /* iOS避免缩放的最小字体 */
    }
}

/* 移动端适配 */
@media (max-width: 500px) {
    .quick-add-menu {
        width: 100%;
        height: 100%;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .quick-add-content {
        height: calc(100% - 60px);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .quick-add-section:not(:last-child) {
        flex: 0 0 auto;
    }
    
    #quick-add-description {
        flex: 1;
        min-height: 120px;
    }
    
    .quick-add-actions {
        margin-top: auto;
        padding-top: 20px;
    }
    
    .quick-add-grid {
        grid-template-columns: 1fr;
    }
}

/* 确保emoji正确显示 */
.status-emoji {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

.quick-status-option {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

/* 调整剧情内容输入框 */
#scene-description {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 8px;
}

#scene-description:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}