/* ===== sop-timeline.css v2 — SKU 运营时间轴 ===== */
/* 三级展开 max-height 动画 · 横向时间轴 · 卡片选择器翻转 · 高级暗色毛玻璃 */
/* 所有类使用 .sop-tl- 前缀 */

/* ═══════════ Level 3 面板容器 ═══════════ */
.sop-tl-panel {
  width: 100%;
  grid-column: 1 / -1;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              margin-top 0.35s ease,
              margin-bottom 0.35s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sop-tl-panel.sop-tl-open {
  /* max-height 由 JS 动态设置（scrollHeight），CSS 只控制其他属性 */
  opacity: 1;
  margin-top: 16px;
  margin-bottom: 8px;
}

.sop-tl-panel.sop-tl-closing {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease,
              margin-top 0.25s ease, margin-bottom 0.25s ease;
}

/* ═══════════ SKU 卡片置灰（面板打开时同 grid 的其他卡片） ═══════════ */
.sku-card.sop-tl-dimmed {
  opacity: 0.35;
  pointer-events: none;
  transform: scale(0.97);
  filter: grayscale(0.6);
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

/* ═══════════ 面板头部 ═══════════ */
.sop-tl-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.sop-tl-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sop-tl-header-title span:first-child {
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sop-tl-header-sku {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

.sop-tl-header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ═══════════ 按钮 ═══════════ */
.sop-tl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.sop-tl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.sop-tl-btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: white;
  font-weight: 600;
}

.sop-tl-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sop-tl-btn-close {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  color: #94a3b8;
}

.sop-tl-btn-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ═══════════ 时间轴区域 ═══════════ */
.sop-tl-timeline {
  padding: 20px 20px 16px;
  overflow-x: auto;
}

/* 横向时间轴线 */
.sop-tl-axis {
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(99, 102, 241, 0.5) 5%,
    rgba(139, 92, 246, 0.4) 95%,
    transparent 100%
  );
  margin-bottom: 0;
  position: relative;
}

.sop-tl-axis::before,
.sop-tl-axis::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.sop-tl-axis::before { left: 0; }
.sop-tl-axis::after { right: 0; }

/* 卡片横向滚动容器 */
.sop-tl-cards-scroll {
  overflow-x: auto;
  padding: 20px 4px 8px;
}

.sop-tl-cards-scroll::-webkit-scrollbar { height: 6px; }
.sop-tl-cards-scroll::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}
.sop-tl-cards-scroll::-webkit-scrollbar-track { background: transparent; }

.sop-tl-cards-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-width: max-content;
}

/* ═══════════ 卡片槽（每个操作卡片的位置） ═══════════ */
.sop-tl-card-slot {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 200px;
  position: relative;
}

/* 上方虚线连接器 */
.sop-tl-slot-connector {
  width: 2px;
  height: 20px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    to bottom,
    rgba(99, 102, 241, 0.4) 0px,
    rgba(99, 102, 241, 0.4) 3px,
    transparent 3px,
    transparent 6px
  );
}

/* 下方虚线 */
.sop-tl-slot-dash {
  height: 0;
  border-top: 1px dashed rgba(99, 102, 241, 0.25);
  margin-top: 10px;
}

/* ═══════════ 操作卡片（工具卡风格） ═══════════ */
.sop-tl-action-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  box-sizing: border-box;
}

.sop-tl-action-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* 等级顶部色条 */
.sop-tl-action-card[data-grade="SS"] { border-top: 3px solid #fb923c; }
.sop-tl-action-card[data-grade="SSS"] { border-top: 3px solid #f87171; }
.sop-tl-action-card[data-grade="S"] { border-top: 3px solid #f59e0b; }
.sop-tl-action-card[data-grade="A"] { border-top: 3px solid #8b5cf6; }
.sop-tl-action-card[data-grade="B"] { border-top: 3px solid #3b82f6; }
.sop-tl-action-card[data-grade="C"] { border-top: 3px solid #64748b; }
.sop-tl-action-card[data-grade=""]  { border-top: 3px solid rgba(99, 102, 241, 0.5); }

/* 等级徽章 */
.sop-tl-card-grade {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.sop-tl-grade-SSS {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.35);
}

.sop-tl-grade-SS {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: white;
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.3);
}

.sop-tl-grade-S {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.sop-tl-grade-A {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: white;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.25);
}

.sop-tl-grade-B {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: white;
}

.sop-tl-grade-C {
  background: #475569;
  color: #cbd5e1;
}

/* 卡片标题 */
.sop-tl-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 8px 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 平台标签 */
.sop-tl-card-platform {
  display: inline-block;
  font-size: 10px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 8px;
}

/* 日期与操作人 */
.sop-tl-card-date {
  font-size: 10px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

/* 表情 */
.sop-tl-card-emotion {
  font-size: 28px;
  text-align: center;
  margin: 6px 0;
  line-height: 1;
}

.sop-tl-card-emotion.sop-tl-emotion-pending {
  filter: grayscale(1);
  opacity: 0.4;
}

/* 备注 */
.sop-tl-card-note {
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 备注子类型：操作方法（tc_how）— 高亮显示 */
.sop-tl-note-how {
  color: #94a3b8;
  font-size: 11px;
  border-top-color: rgba(148, 163, 184, 0.15);
  -webkit-line-clamp: 3;
}

/* 备注子类型：用户自由填写 */
.sop-tl_note-user {
  color: #e2e8f0;
  font-size: 11px;
  border-top-style: dashed;
  -webkit-line-clamp: 4;
}

/* 备注子类型：原因描述（tc_why）— 辅助信息 */
.sop-tl-note-why {
  color: #64748b;
  font-size: 10px;
  font-style: italic;
  opacity: 0.7;
  -webkit-line-clamp: 2;
}

/* 备注子类型：JSON 美化展示 */
.sop-tl_note-json {
  -webkit-line-clamp: unset;
  max-height: 120px;
  overflow-y: auto;
}
.sop-tl_note-json pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 9px;
  line-height: 1.5;
  color: #94a3b8;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* 删除按钮 */
.sop-tl-card-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 10px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sop-tl-action-card:hover .sop-tl-card-delete { display: flex; }

.sop-tl-card-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* 旧版操作类型色条（向后兼容） */
.sop-tl-action-card[data-type="price_cut"]    { border-top: 3px solid #f87171; }
.sop-tl-action-card[data-type="image_opt"]    { border-top: 3px solid #34d399; }
.sop-tl-action-card[data-type="promotion"]    { border-top: 3px solid #fbbf24; }
.sop-tl-action-card[data-type="flash_sale"]   { border-top: 3px solid #f97316; }
.sop-tl-action-card[data-type="event_reg"]    { border-top: 3px solid #60a5fa; }
.sop-tl-action-card[data-type="new_launch"]   { border-top: 3px solid #a78bfa; }
.sop-tl-action-card[data-type="ad_push"]      { border-top: 3px solid #ec4899; }
.sop-tl-action-card[data-type="price_adjust"] { border-top: 3px solid #818cf8; }
.sop-tl-action-card[data-type="stock_replen"] { border-top: 3px solid #2dd4bf; }
.sop-tl-action-card[data-type="custom"]       { border-top: 3px solid rgba(99, 102, 241, 0.5); }

/* 当同时有 data-grade 和 data-type 时，grade 优先（通过 CSS 特异性） */
.sop-tl-action-card[data-grade][data-type] {
  border-top-width: 3px;
  border-top-style: solid;
}

/* ═══════════ 添加按钮槽 ═══════════ */
.sop-tl-add-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 180px;
  min-height: 180px;
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(99, 102, 241, 0.02);
  gap: 6px;
}

.sop-tl-add-slot:hover {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.sop-tl-add-slot svg {
  width: 24px;
  height: 24px;
  color: #818cf8;
  transition: transform 0.2s;
}

.sop-tl-add-slot:hover svg {
  transform: rotate(90deg);
}

.sop-tl-add-slot-text {
  font-size: 11px;
  color: #64748b;
}

/* ═══════════ 卡片内评论区（每张卡片独立） ═══════════ */
.sop-tl-slot-comments {
  margin-top: 6px;
  max-height: 100px;
  overflow-y: auto;
}

.sop-tl-slot-comments::-webkit-scrollbar { width: 3px; }
.sop-tl-slot-comments::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.sop-tl-slot-comments-empty {
  font-size: 10px;
  color: #475569;
  text-align: center;
  padding: 4px 0;
}

.sop-tl-card-comment-item {
  display: flex;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
}

.sop-tl-card-comment-item:last-child { border-bottom: none; }

.sop-tl-card-comment-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.sop-tl-card-comment-text {
  color: #94a3b8;
  line-height: 1.3;
  word-break: break-word;
}

.sop-tl-card-comment-meta {
  font-size: 9px;
  color: #475569;
  margin-top: 1px;
}

.sop-tl-card-comment-del {
  background: none;
  border: none;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  opacity: 0.6;
}
.sop-tl-card-comment-del:hover { color: #ef4444; opacity: 1; }

.sop-tl-card-comment-input-row {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  align-items: center;
  overflow: hidden;
}

.sop-tl-card-comment-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  color: #e2e8f0;
  font-size: 11px;
  outline: none;
  font-family: inherit;
  min-height: 24px;
  max-height: 48px;
  resize: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.sop-tl-card-comment-input:focus {
  border-color: rgba(99, 102, 241, 0.4);
}

.sop-tl-card-comment-input::placeholder { color: #334155; }

.sop-tl-card-comment-send {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
  border: none;
  border-radius: 6px;
  color: #818cf8;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  box-sizing: border-box;
}

.sop-tl-card-comment-send:hover {
  background: #6366f1;
  color: white;
}

.sop-tl-card-comment-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 评论角标 */
.sop-tl-card-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  color: #818cf8;
  margin-top: 6px;
  background: rgba(99, 102, 241, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
}

.sop-tl-card-comment-badge:hover {
  background: rgba(99, 102, 241, 0.15);
}

/* ═══════════ 卡片选择器（从页面顶部滑出） ═══════════ */
.sop-tl-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: sopTlFadeIn 0.2s ease;
}

.sop-tl-picker-overlay.sop-tl-picker-closing {
  animation: sopTlFadeOut 0.2s ease forwards;
}

@keyframes sopTlFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.sop-tl-picker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 0 0 20px 20px;
  padding: 20px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: sopTlPickerSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sopTlPickerSlideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.sop-tl-picker.sop-tl-picker-closing {
  animation: sopTlPickerSlideUp 0.3s ease forwards;
}

@keyframes sopTlPickerSlideUp {
  from { transform: translateY(0); }
  to { transform: translateY(-100%); }
}

.sop-tl-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sop-tl-picker-title {
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sop-tl-picker-hint {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}

.sop-tl-picker-scroll {
  overflow-x: auto;
  padding: 8px 0 16px;
}

.sop-tl-picker-scroll::-webkit-scrollbar { height: 6px; }
.sop-tl-picker-scroll::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}

.sop-tl-picker-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-width: max-content;
}

/* 等级分组线 */
.sop-tl-picker-grade-divider {
  width: 100%;
  border: none;
  border-top: 2px dashed #cbd5e1;
  margin: 10px 0 6px 0;
  position: relative;
  text-align: center;
}
.sop-tl-picker-grade-tag {
  position: relative;
  top: -13px;
  display: inline-block;
  padding: 2px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

.sop-tl-picker-empty {
  text-align: center;
  color: #475569;
  padding: 32px 20px;
  font-size: 13px;
  line-height: 1.6;
}

.sop-tl-picker-empty a {
  color: #818cf8;
  text-decoration: none;
  cursor: pointer;
}

.sop-tl-picker-empty a:hover { text-decoration: underline; }

/* ═══════════ 选择器缩略卡片（单面，hover 发光） ═══════════ */
.sop-tl-picker-card {
  width: 180px;
  min-height: 120px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sop-tl-picker-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.sop-tl-picker-card:active {
  transform: translateY(-2px);
}

/* 等级色条 */
.sop-tl-picker-card[data-grade="SS"] { border-top: 3px solid #fb923c; }
.sop-tl-picker-card[data-grade="SSS"] { border-top: 3px solid #f87171; }
.sop-tl-picker-card[data-grade="S"] { border-top: 3px solid #f59e0b; }
.sop-tl-picker-card[data-grade="A"] { border-top: 3px solid #8b5cf6; }
.sop-tl-picker-card[data-grade="B"] { border-top: 3px solid #3b82f6; }
.sop-tl-picker-card[data-grade="C"] { border-top: 3px solid #64748b; }

.sop-tl-pcf-grade {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
}

.sop-tl-pcf-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 8px 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sop-tl-pcf-platform {
  font-size: 10px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
  width: fit-content;
}

.sop-tl-pcf-desc {
  font-size: 10px;
  color: #475569;
  margin-top: auto;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════ 游戏卡模态（精美居中弹出 + 翻转入场） ═══════════ */
.sop-tl-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: sopTlFadeIn 0.25s ease;
}

.sop-tl-modal-overlay.sop-tl-modal-closing {
  animation: sopTlFadeOut 0.25s ease forwards;
}

/* 外层容器——透视空间 */
.sop-tl-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10011;
  perspective: 1200px;
  transform: translate(-50%, -50%);
}

/* 翻转入场 */
.sop-tl-modal > * {
  transform: rotateY(90deg) scale(0.8);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
}

.sop-tl-modal.sop-tl-modal-entered > * {
  transform: rotateY(0deg) scale(1);
  opacity: 1;
}

/* 关闭动画 */
.sop-tl-modal.sop-tl-modal-closing > * {
  transform: rotateY(-90deg) scale(0.8);
  opacity: 0;
  transition: transform 0.35s ease-in, opacity 0.25s ease;
}

/* ═══ 游戏卡本体 ═══ */
.sop-tl-gcard {
  width: 640px;
  max-width: 92vw;
  position: relative;
  background: linear-gradient(165deg,
    rgba(30, 35, 55, 0.97) 0%,
    rgba(15, 23, 42, 0.98) 40%,
    rgba(20, 15, 40, 0.97) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 32px 80px -12px rgba(0, 0, 0, 0.6),
    0 0 160px -40px rgba(99, 102, 241, 0.12);
}

/* 斜向光效 */
.sop-tl-gcard-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    transparent 30%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 55%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 10;
}

/* 等级外部发光 */
.sop-tl-gcard-glow {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 80%;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.sop-tl-gcard-glow-S { background: #f59e0b; opacity: 0.2; }
.sop-tl-gcard-glow-A { background: #8b5cf6; opacity: 0.18; }
.sop-tl-gcard-glow-B { background: #3b82f6; opacity: 0.15; }
.sop-tl-gcard-glow-C { background: #64748b; opacity: 0.1; }

/* ═══ 顶部等级横幅 ═══ */
.sop-tl-gcard-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  position: relative;
  z-index: 2;
}
.sop-tl-gcard-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.sop-tl-gcard-banner-S { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.08)); }
.sop-tl-gcard-banner-A { background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(167, 139, 250, 0.08)); }
.sop-tl-gcard-banner-B { background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(96, 165, 250, 0.06)); }
.sop-tl-gcard-banner-C { background: rgba(255, 255, 255, 0.03); }

.sop-tl-gcard-banner-grade {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sop-tl-gcard-banner-S .sop-tl-gcard-banner-grade { color: #fbbf24; text-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
.sop-tl-gcard-banner-A .sop-tl-gcard-banner-grade { color: #c4b5fd; text-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
.sop-tl-gcard-banner-B .sop-tl-gcard-banner-grade { color: #93c5fd; }
.sop-tl-gcard-banner-C .sop-tl-gcard-banner-grade { color: #94a3b8; }

.sop-tl-gcard-banner-platform {
  font-size: 12px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 500;
}

/* ═══ 核心区域（插图 + 信息） ═══ */
.sop-tl-gcard-core {
  display: flex;
  gap: 0;
  padding: 24px 28px;
  position: relative;
  z-index: 2;
}

/* 卡面插图区 */
.sop-tl-gcard-art {
  width: 140px;
  flex-shrink: 0;
  height: 180px;
  border-radius: 16px;
  background: linear-gradient(150deg,
    rgba(99, 102, 241, 0.08),
    rgba(139, 92, 246, 0.05),
    rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.sop-tl-gcard-art-badge {
  font-size: 56px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  z-index: 2;
  animation: sopTlBadgeFloat 3s ease-in-out infinite;
}

@keyframes sopTlBadgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 装饰粒子 */
.sop-tl-gcard-art-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sop-tl-gcard-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.4);
  animation: sopTlParticleDrift 4s ease-in-out infinite;
}

.sop-tl-gcard-particle:nth-child(1) { top: 15%; left: 20%; animation-delay: 0s; }
.sop-tl-gcard-particle:nth-child(2) { top: 70%; left: 75%; animation-delay: 0.6s; background: rgba(139, 92, 246, 0.4); }
.sop-tl-gcard-particle:nth-child(3) { top: 40%; left: 50%; animation-delay: 1.2s; background: rgba(245, 158, 11, 0.3); }
.sop-tl-gcard-particle:nth-child(4) { top: 85%; left: 30%; animation-delay: 0.8s; }
.sop-tl-gcard-particle:nth-child(5) { top: 25%; left: 80%; animation-delay: 1.6s; background: rgba(59, 130, 246, 0.4); }
.sop-tl-gcard-particle:nth-child(6) { top: 55%; left: 15%; animation-delay: 2s; background: rgba(139, 92, 246, 0.3); }

@keyframes sopTlParticleDrift {
  0%, 100% { opacity: 0.3; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(-12px) scale(1.5); }
}

/* 信息区 */
.sop-tl-gcard-info {
  flex: 1;
  min-width: 0;
  margin-left: 24px;
  display: flex;
  flex-direction: column;
}

.sop-tl-gcard-title {
  font-size: 22px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 20px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* HOW / WHY 区块 */
.sop-tl-gcard-section {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s;
}

.sop-tl-gcard-section:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sop-tl-gcard-section:last-child { margin-bottom: 0; }

.sop-tl-gcard-section-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.sop-tl-gcard-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.sop-tl-gcard-section-text {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
}

/* ═══ 底部操作栏 ═══ */
.sop-tl-gcard-actions {
  padding: 20px 28px 24px;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.15);
}

.sop-tl-gcard-form {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.sop-tl-gcard-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sop-tl-gcard-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.5px;
}

.sop-tl-gcard-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.sop-tl-gcard-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  letter-spacing: 0.3px;
}

.sop-tl-gcard-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.sop-tl-gcard-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.18);
}

.sop-tl-gcard-btn-confirm {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow:
    0 4px 16px rgba(99, 102, 241, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

.sop-tl-gcard-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(99, 102, 241, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sop-tl-gcard-btn-confirm:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.sop-tl-pcb-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.sop-tl-pcb-date {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: #e2e8f0;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  margin-bottom: 10px;
}

.sop-tl-pcb-date:focus {
  border-color: rgba(99, 102, 241, 0.4);
}

.sop-tl-pcb-note {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: #e2e8f0;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  resize: none;
  margin-bottom: 10px;
  min-height: 32px;
}

.sop-tl-pcb-note:focus {
  border-color: rgba(99, 102, 241, 0.4);
}

.sop-tl-pcb-note::placeholder { color: #334155; }

.sop-tl-pcb-actions {
  display: flex;
  gap: 8px;
}

.sop-tl-pcb-confirm {
  flex: 1;
  padding: 8px 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.35);
}

.sop-tl-pcb-confirm:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.sop-tl-pcb-confirm:active {
  transform: translateY(0);
}

.sop-tl-pcb-cancel {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.sop-tl-pcb-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ═══════════ 用户选择浮层 ═══════════ */
.sop-tl-user-picker {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10002;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 16px;
  padding: 24px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: sopTlModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sopTlModalIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.sop-tl-user-picker h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: #e2e8f0;
  text-align: center;
}

.sop-tl-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.sop-tl-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  color: #cbd5e1;
  border: 1px solid transparent;
}

.sop-tl-user-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.sop-tl-user-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
}

.sop-tl-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.sop-tl-user-name { font-size: 14px; font-weight: 500; color: #f1f5f9; }
.sop-tl-user-role { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ═══════════ 顶部用户徽标 ═══════════ */
.sop-tl-current-user {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}

.sop-tl-current-user:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(15, 23, 42, 0.95);
}

.sop-tl-current-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

/* ═══════════ 操作日志页面 ═══════════ */
.sop-tl-logs-page {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.sop-tl-logs-page h2 {
  font-size: 20px;
  color: #f1f5f9;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sop-tl-log-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  animation: sopTlFadeIn 0.2s ease;
}

.sop-tl-log-time {
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
  width: 120px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.sop-tl-log-detail { color: #cbd5e1; line-height: 1.5; }
.sop-tl-log-user { color: #818cf8; font-weight: 500; }

/* ═══════════ 通用遮罩 ═══════════ */
.sop-tl-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

/* ═══════════ 动画 ═══════════ */
@keyframes sopTlFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sopTlFlyIn {
  0% { opacity: 0; transform: scale(0.5) translateX(200px); }
  60% { opacity: 1; transform: scale(1.1) translateX(10px); }
  100% { transform: scale(1) translateX(0); }
}

.sop-tl-card-fly-in {
  animation: sopTlFlyIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sopTlFlyOut {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.6) translateY(-60px); }
}

.sop-tl-card-fly-out {
  animation: sopTlFlyOut 0.35s ease forwards;
}

/* 时间轴空状态 */
.sop-tl-timeline-empty {
  text-align: center;
  color: #475569;
  padding: 30px 20px;
  font-size: 13px;
}

/* 加载状态 */
.sop-tl-timeline-loading {
  text-align: center;
  padding: 20px;
  color: #475569;
  font-size: 13px;
}

/* ===== 已部署卡片详情翻转放大 ===== */
.sop-tl-detail-overlay {
  position: fixed; inset: 0; z-index: 30000;
  background: rgba(0, 0, 0, 0); backdrop-filter: blur(0);
  transition: all .3s ease;
}
.sop-tl-detail-overlay.sop-tl-detail-visible {
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
}

.sop-tl-detail {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.85) rotateX(12deg);
  z-index: 30001;
  width: 480px; max-width: 92vw; max-height: 85vh;
  border-radius: 20px;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow:
    0 25px 80px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 -20px 40px -20px var(--detail-accent, #6366f1) inset;
  opacity: 0; pointer-events: none;
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
  overflow-y: auto;
}
.sop-tl-detail-entered {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1) rotateX(0);
}

/* 关闭按钮 */
.sop-tl-detail-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05);
  color: #94a3b8; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.sop-tl-detail-close:hover { background: rgba(239,68,68,.15); color: #ef4444; border-color: rgba(239,68,68,.3); }

/* 内部容器 */
.sop-tl-detail-inner { padding: 28px 24px 20px; }

/* 头部 */
.sop-tl-detail-header { margin-bottom: 6px; }
.sop-tl-detail-grade {
  display: inline-block; padding: 2px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--detail-accent, #64748b); opacity: .9;
  letter-spacing: 1px;
}
.sop-tl-detail-title {
  margin: 10px 0 4px; font-size: 20px; font-weight: 700; color: #f1f5f9;
  line-height: 1.3;
}
.sop-tl-detail-platform {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; color: #94a3b8; background: rgba(148,163,184,.1);
  margin-top: 4px;
}
.sop-tl-detail-meta {
  font-size: 12px; color: #64748b; margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sop-tl-detail-emotion { font-size: 16px; }

/* 内容区 */
.sop-tl-detail-body { min-height: 60px; }
.sop-tl-detail-section {
  margin-bottom: 14px; padding: 12px 14px;
  border-radius: 10px; background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.04);
}
.sop-tl-detail-user-note {
  background: rgba(99,102,241,.06); border-color: rgba(99,102,241,.12);
}
.sop-tl-detail-section-label {
  font-size: 11px; font-weight: 600; color: var(--detail-accent, #818cf8);
  margin-bottom: 6px; letter-spacing: .5px;
}
.sop-tl-detail-section-content {
  font-size: 13px; color: #cbd5e1; line-height: 1.65; white-space: pre-wrap;
  word-break: break-word;
}

/* 底部 */
.sop-tl-detail-footer {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.04);
  text-align: right;
}
.sop-tl-detail-hint { font-size: 10px; color: #334155; }

/* 卡片可点击提示（鼠标悬停时微亮 + cursor） */
.sop-tl-action-card[data-can-view="1"] { cursor: pointer; }
.sop-tl-action-card[data-can-view="1"]:hover {
  border-color: rgba(255,255,255,.2) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.08) inset !important;
}
