/* ============================================
   云卡栈 - 高级感UI系统 v15.0
   终极优化20项（第241-260项）
   总计260项高级感优化
   ============================================ */

/* ========== 241. AI文字识别(OCR) ========== */
.ocr-container {
  padding: 20px;
}

.ocr-dropzone {
  border: 2px dashed var(--border-light);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-secondary);
}

.ocr-dropzone:hover,
.ocr-dropzone.dragover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.ocr-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ========== 244. 图片滤镜 ========== */
.filter-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.filter-item {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.filter-item:hover {
  transform: scale(1.05);
}

.filter-item.active {
  border-color: var(--primary-500);
}

.filter-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.filter-item-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 11px;
  padding: 4px;
  text-align: center;
}

/* 滤镜效果 */
.filter-original { filter: none; }
.filter-grayscale { filter: grayscale(100%); }
.filter-sepia { filter: sepia(100%); }
.filter-vintage { filter: sepia(50%) contrast(1.1) brightness(1.1); }
.filter-cool { filter: hue-rotate(180deg) saturate(1.2); }
.filter-warm { filter: sepia(30%) saturate(1.4) hue-rotate(-10deg); }
.filter-bw { filter: grayscale(100%) contrast(1.2); }
.filter-blur { filter: blur(2px); }
.filter-sharpen { filter: contrast(1.5) saturate(1.2); }
.filter-vivid { filter: saturate(2) contrast(1.1); }
.filter-fade { filter: opacity(0.8) contrast(0.9); }
.filter-noir { filter: grayscale(100%) contrast(1.4) brightness(0.9); }

/* ========== 245. 图片水印 ========== */
.watermark-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.watermark-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.watermark-input:focus {
  border-color: var(--primary-400);
}

.watermark-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.watermark-slider-label {
  width: 60px;
  font-size: 13px;
  color: var(--text-secondary);
}

.watermark-slider {
  flex: 1;
}

.watermark-position {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.watermark-pos-btn {
  padding: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.watermark-pos-btn.active {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

/* ========== 247. 音频可视化 ========== */
.audio-visualizer {
  width: 100%;
  height: 120px;
  background: var(--bg-card);
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 16px;
  overflow: hidden;
}

.visualizer-bar {
  flex: 1;
  background: var(--gradient-primary);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.05s ease;
}

/* ========== 248. 音频均衡器 ========== */
.equalizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
}

.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.eq-slider {
  width: 30px;
  height: 120px;
  -webkit-appearance: slider-vertical;
  writing-mode: bt-lr;
  cursor: pointer;
}

.eq-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.eq-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-500);
}

/* ========== 251. 表格编辑器 ========== */
.spreadsheet {
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
}

.spreadsheet table {
  border-collapse: collapse;
  width: 100%;
}

.spreadsheet th,
.spreadsheet td {
  border: 1px solid var(--border-light);
  padding: 0;
  min-width: 80px;
  height: 28px;
}

.spreadsheet th {
  background: var(--bg-secondary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 8px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.spreadsheet th:first-child,
.spreadsheet td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-secondary);
  text-align: center;
  font-weight: 600;
  min-width: 40px;
}

.spreadsheet td input {
  width: 100%;
  height: 100%;
  border: none;
  padding: 6px 8px;
  font-size: 13px;
  background: transparent;
  outline: none;
}

.spreadsheet td input:focus {
  background: var(--primary-50);
  box-shadow: inset 0 0 0 2px var(--primary-400);
}

.spreadsheet td.selected {
  box-shadow: inset 0 0 0 2px var(--primary-500);
}

/* ========== 252. 幻灯片编辑器 ========== */
.slide-editor {
  display: flex;
  height: 600px;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.slide-sidebar {
  width: 160px;
  background: var(--bg-secondary);
  padding: 12px;
  overflow-y: auto;
  border-right: 1px solid var(--border-light);
}

.slide-thumbnail {
  aspect-ratio: 16/9;
  background: white;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
}

.slide-thumbnail:hover {
  transform: scale(1.02);
}

.slide-thumbnail.active {
  border-color: var(--primary-500);
}

.slide-thumbnail-number {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
}

.slide-canvas-area {
  flex: 1;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}

.slide-canvas {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16/9;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.slide-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.slide-tool {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slide-tool:hover {
  background: var(--bg-secondary);
}

/* ========== 253. 流程图编辑器 ========== */
.flowchart-editor {
  position: relative;
  width: 100%;
  height: 500px;
  background: 
    linear-gradient(var(--border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 12px;
  overflow: hidden;
}

.flowchart-node {
  position: absolute;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 2px solid var(--primary-400);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: move;
  user-select: none;
  z-index: 2;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.flowchart-node:hover {
  box-shadow: var(--shadow-md);
}

.flowchart-node.start {
  border-radius: 20px;
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.flowchart-node.end {
  border-radius: 20px;
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.flowchart-node.decision {
  transform: rotate(45deg);
  width: 80px;
  height: 80px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flowchart-node.decision span {
  transform: rotate(-45deg);
  font-size: 11px;
  text-align: center;
}

.flowchart-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.flowchart-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.flowchart-add-btn {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* ========== 254. 日历调度 ========== */
.calendar-scheduler {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: var(--bg-secondary);
}

.calendar-title {
  font-size: 16px;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.calendar-day {
  min-height: 80px;
  padding: 6px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
}

.calendar-day:hover {
  background: var(--bg-secondary);
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.today {
  background: var(--primary-50);
}

.calendar-day-number {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number {
  background: var(--primary-500);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: grab;
}

.calendar-event.blue { background: #dbeafe; color: #1e40af; }
.calendar-event.green { background: #dcfce7; color: #166534; }
.calendar-event.orange { background: #ffedd5; color: #9a3412; }
.calendar-event.purple { background: #f3e8ff; color: #6b21a8; }

/* ========== 255. 时间线编辑器 ========== */
.timeline-editor {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.timeline-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.timeline-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.timeline-time {
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
}

.timeline-ruler {
  height: 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.timeline-ruler-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--border-light);
  font-size: 10px;
  color: var(--text-tertiary);
  padding-left: 4px;
  padding-top: 4px;
}

.timeline-tracks {
  max-height: 300px;
  overflow-y: auto;
}

.timeline-track {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  min-height: 48px;
}

.timeline-track-label {
  width: 120px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
}

.timeline-track-content {
  flex: 1;
  position: relative;
  height: 48px;
}

.timeline-clip {
  position: absolute;
  top: 6px;
  bottom: 6px;
  background: var(--gradient-primary);
  border-radius: 4px;
  cursor: move;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  color: white;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.timeline-clip.audio { background: linear-gradient(135deg, #10b981, #059669); }
.timeline-clip.video { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.timeline-clip.text { background: linear-gradient(135deg, #f59e0b, #d97706); }

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 10;
  pointer-events: none;
}

.timeline-playhead::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -5px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #ef4444;
}

/* ========== 256. 粒子系统 ========== */
.particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ========== 257. 流体动画 ========== */
.fluid-bg {
  position: relative;
  overflow: hidden;
}

.fluid-bg::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.2) 0%, transparent 50%);
  animation: fluidMove 20s ease-in-out infinite;
}

@keyframes fluidMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(5%, -5%) rotate(5deg); }
  50% { transform: translate(-5%, 5%) rotate(-5deg); }
  75% { transform: translate(5%, 5%) rotate(3deg); }
}

/* ========== 258. 实时协作 ========== */
.collab-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 1000;
}

.collab-cursor-icon {
  width: 20px;
  height: 20px;
  transform: translate(-2px, -2px);
}

.collab-cursor-label {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.collab-user-avatars {
  display: flex;
  align-items: center;
}

.collab-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.collab-avatar:first-child {
  margin-left: 0;
}

/* ========== 259. 离线优先 ========== */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f59e0b;
  color: white;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  z-index: 10000;
  display: none;
  animation: slideDown 0.3s ease;
}

.offline-banner.show {
  display: block;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ========== 260. 版本历史 ========== */
.version-history {
  max-height: 400px;
  overflow-y: auto;
}

.version-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.version-item:hover {
  background: var(--bg-secondary);
}

.version-item.current {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
}

.version-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
  margin-top: 5px;
  flex-shrink: 0;
}

.version-item.current .version-dot {
  background: var(--primary-500);
  box-shadow: 0 0 0 4px var(--primary-100);
}

.version-info {
  flex: 1;
}

.version-number {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.version-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.version-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.version-actions {
  display: flex;
  gap: 6px;
}

.version-action-btn {
  padding: 4px 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.version-action-btn:hover {
  background: var(--bg-secondary);
}

/* 响应式 */
@media (max-width: 768px) {
  .filter-preview { grid-template-columns: repeat(3, 1fr); }
  .equalizer { gap: 8px; }
  .eq-slider { height: 80px; }
  .slide-sidebar { width: 100px; }
}
