/* ./公用模块/第一行滑动.css */
/* 

 * 
 * 核心功能：无论屏幕多小，都能通过滑动看到完整内容
 */

/* ========== 960px开关控制 ========== */

/* 大屏幕（>960px）完全禁用滑动 */
@media (min-width: 961px) {
  .top-row {
    overflow: visible !important;
    transform: none !important;
    transition: none !important;
    touch-action: auto !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    white-space: normal !important;
    will-change: auto !important;

    /* 恢复正常布局 */
    display: flex !important;
    flex-wrap: wrap !important;
  }

  .滑动行 {
    display: contents !important;
    transform: none !important;
    transition: none !important;
    width: auto !important;
    min-width: auto !important;
    will-change: auto !important;
  }

  /* 移除所有滑动相关效果 */
  .top-row.touch-slide-enabled,
  .top-row.can-slide-left,
  .top-row.can-slide-right {
    overflow: visible !important;
  }

  .top-row::before,
  .top-row::after {
    display: none !important;
  }

  .top-left,
  .top-right {
    flex-shrink: 1 !important;
    white-space: normal !important;
    display: flex !important;
  }

  .controls {
    display: flex !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
  }

  .主页按钮,
  .输入框,
  .dot,
  owfueu-qwtfbb {
    flex-shrink: 1 !important;
    white-space: normal !important;
  }
}

/* ========== 小屏幕（≤960px）启用完整滑动查看 ========== */

@media (max-width: 960px) {
  .top-row {
    /* 核心设置：隐藏溢出但确保内容完整可见 */
    overflow: hidden;
    position: relative;

    /* 触摸滑动设置 */
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;

    /* 容器基础设置 */
    width: 100%;
    will-change: transform;

    /* 关键：防止内容换行，确保所有内容在一行内 */
    white-space: nowrap;

    /* 布局设置：确保子元素不被压缩 */
    display: flex;
    align-items: center;
    flex-wrap: nowrap;

    /* 确保容器有足够的宽度容纳内容 */
    min-width: 100%;
  }

  /* 内容包装器 - 这是滑动的核心容器 */
  .滑动行 {
    /* 布局设置 */
    display: flex;
    align-items: center;
    flex-wrap: nowrap;

    /* 关键：确保内容宽度根据实际需要扩展 */
    width: max-content;
    min-width: 100%;

    /* 确保所有子元素都能完整显示 */
    max-width: none;

    /* 滑动动画效果 */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    transform: translateX(0);

    /* 防止内容被截断 */
    overflow: visible;
  }

  /* 滑动状态效果 */
  .滑动行.dragging {
    transition: none;
    /* 拖拽时禁用过渡 */
  }

  .滑动行.momentum {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* 弹性回弹效果 */
  .滑动行.bounce-left {
    transform: translateX(20px) !important;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }

  .滑动行.bounce-right {
    transform: translateX(-20px) !important;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }

  /* ========== 左右容器完整显示设置 ========== */

  .top-left {
    /* 确保左侧内容完整显示 */
    flex-shrink: 0;
    white-space: nowrap;
    margin-right: 12px;

    /* 确保内容不被压缩 */
    min-width: max-content;
    display: inline-flex;
    align-items: center;
  }

  .top-right {
    /* 确保右侧内容完整显示 */
    flex-shrink: 0;
    white-space: nowrap;

    /* 布局设置 */
    display: inline-flex;
    align-items: center;

    /* 确保内容不被压缩 */
    min-width: max-content;
  }

  /* ========== 控件容器完整显示设置 ========== */

  .controls {
    /* 关键：确保控件容器不换行且完整显示 */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;

    /* 防止压缩和换行 */
    flex-shrink: 0;
    flex-wrap: nowrap;
    white-space: nowrap;

    /* 确保有足够宽度 */
    min-width: max-content;
    width: max-content;
  }

  /* ========== 所有控件元素完整显示设置 ========== */

  .主页按钮,
  .输入框,
  .dot,
  owfueu-qwtfbb,
  .相对页面_浮窗,
  [contenteditable],
  input,
  button {
    /* 防止所有控件被压缩 */
    flex-shrink: 0;
    white-space: nowrap;

    /* 确保有合适的最小宽度 */
    min-width: max-content;

    /* 防止内容溢出 */
    overflow: visible;
  }

  /* 输入框特殊处理 - 确保在小屏幕下也有合理宽度 */
  .输入框 {
    min-width: 80px;
    /* 最小宽度保证可用性 */
    width: auto;
    /* 自动宽度 */
    max-width: none;
    /* 移除最大宽度限制 */
  }

  /* 可编辑元素特殊处理 */
  .输入框[contenteditable="true"] {
    min-width: 60px;
    width: auto;
    max-width: none;
  }

  /* 时间显示完整显示 */
  .动感时钟,
  #timeDisplay {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 12px;
    font-family: monospace;

    /* 确保时间显示不被截断 */
    min-width: max-content;
  }

  /* ========== 边界提示效果 ========== */

  /* 左边界阴影提示 */
  .top-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.08) 50%,
        transparent 100%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  /* 右边界阴影提示 */
  .top-row::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.08) 50%,
        transparent 100%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  /* 显示边界提示的条件 */
  .top-row.can-slide-left::before {
    opacity: 1;
  }

  .top-row.can-slide-right::after {
    opacity: 1;
  }

  /* ========== 滑动范围指示器（可选） ========== */

  .slide-progress-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 5;
  }

  .slide-progress-indicator .progress-bar {
    height: 100%;
    background: #007bff;
    transition: transform 0.3s ease;
    transform-origin: left;
    width: 100%;
    transform: scaleX(0);
  }

  .top-row.has-slide-content .slide-progress-indicator .progress-bar {
    transform: scaleX(1);
  }
}

/* ========== 响应式优化 - 确保在各种尺寸下都能完整查看 ========== */

/* 中等屏幕 (768px - 960px) */
@media (max-width: 960px) and (min-width: 769px) {
  .top-row {
    padding: 8px 16px;
    min-height: 50px;
  }

  .controls {
    gap: 8px;
  }

  .主页按钮 {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
  }

  .输入框 {
    font-size: 14px;
    padding: 8px 12px;
  }
}

/* 小屏幕 (481px - 768px) */
@media (max-width: 768px) {
  .top-row {
    padding: 6px 12px;
    min-height: 50px;
  }

  .controls {
    gap: 6px;
    margin-right: 8px;
  }

  .主页按钮 {
    padding: 6px 12px;
    font-size: 13px;
    min-width: auto;
  }

  .输入框 {
    font-size: 13px;
    padding: 6px 8px;
  }

  .top-left {
    margin-right: 8px;
  }

  .动感时钟,
  #timeDisplay {
    font-size: 13px;
    margin-left: 8px;
  }
}

/* 超小屏幕 (≤480px) - 确保即使在最小屏幕也能完整查看 */
@media (max-width: 480px) {
  .top-row {
    padding: 4px 8px;
    min-height: 50px;
  }

  .controls {
    gap: 4px;
    margin-right: 6px;
  }

  .主页按钮 {
    padding: 4px 8px;
    font-size: 12px;
    min-width: auto;

    /* 确保按钮文字不被截断 */
    white-space: nowrap;
    overflow: visible;
  }

  .输入框 {
    font-size: 12px;
    padding: 4px 6px;
    min-width: 50px;
    /* 最小可用宽度 */
  }

  .dot {
    width: 20px;
    height: 20px;
    font-size: 10px;
    flex-shrink: 0;
  }

  .top-left {
    margin-right: 6px;
  }

  .动感时钟,
  #timeDisplay {
    font-size: 12px;
    margin-left: 6px;
  }
}

/* ========== 触摸设备优化 ========== */
@media (max-width: 960px) and (hover: none) and (pointer: coarse) {
  .top-row {
    /* 增加触摸区域 */
    min-height: 48px;
    padding: 8px 12px;
  }

  .主页按钮,
  .dot {
    /* 增加触摸目标大小 */
    min-height: 40px;
    padding: 8px 12px;

    /* 确保触摸目标不被压缩 */
    flex-shrink: 0;
  }

  .输入框 {
    min-height: 40px;
    padding: 8px 12px;
  }
}

/* ========== 动画和交互优化 ========== */

/* 减少动画的用户 */
@media (prefers-reduced-motion: reduce) {
  .滑动行 {
    transition: none !important;
  }

  .top-row::before,
  .top-row::after {
    transition: none !important;
  }

  .slide-progress-indicator .progress-bar {
    transition: none !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {

  .top-row::before,
  .top-row::after {
    background: linear-gradient(to right, #000 0%, transparent 100%);
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .top-row::after {
    background: linear-gradient(to left,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        transparent 100%);
  }

  .top-row::before {
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        transparent 100%);
  }

  .slide-progress-indicator {
    background: rgba(255, 255, 255, 0.1);
  }

  .slide-progress-indicator .progress-bar {
    background: #4dabf7;
  }
}

/* ========== 调试辅助样式 ========== */
@media (max-width: 960px) {
  .debug-touch-slide .top-row {
    border: 3px solid red !important;
    position: relative;
  }

  .debug-touch-slide .top-row::after {
    content: '可滑动区域' !important;
    position: absolute !important;
    top: -25px !important;
    left: 0 !important;
    background: red !important;
    color: white !important;
    padding: 2px 8px !important;
    font-size: 10px !important;
    border-radius: 3px !important;
    z-index: 9999 !important;
  }

  .debug-touch-slide .滑动行 {
    border: 2px solid blue !important;
    position: relative !important;
  }

  .debug-touch-slide .滑动行::before {
    content: '滑动内容';
    position: absolute;
    top: -20px;
    left: 0;
    background: blue;
    color: white;
    padding: 1px 6px;
    font-size: 9px;
    border-radius: 2px;
    z-index: 9998;
  }

  .debug-touch-slide .controls {
    border: 1px solid green !important;
  }

  .debug-touch-slide .top-left {
    border: 1px solid orange !important;
  }

  .debug-touch-slide .top-right {
    border: 1px solid purple !important;
  }

  .debug-touch-slide .主页按钮,
  .debug-touch-slide .输入框,
  .debug-touch-slide .dot {
    border: 1px dashed #999 !important;
  }
}

/* ========== 完整性检查指示器 ========== */
.content-completeness-indicator {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 11px;
  z-index: 9999;
  font-family: monospace;
  display: none;
}

.debug-touch-slide .content-completeness-indicator {
  display: block;
}

@media (max-width: 960px) {
  .content-completeness-indicator::after {
    content: "可滑动查看完整内容";
  }
}

@media (min-width: 961px) {
  .content-completeness-indicator::after {
    content: "完整内容已显示";
  }
}