/* ===========================
   全局基础
=========================== */
:root {
  --page-padding-x: 15px;
  --page-padding-y: 0px;
  --left-margin: 3px;     /* 新增，控制左手机位置 */

  /* 3 个分页点的垂直位置（可以手动调整） */
  --card-dots-offset: 15px;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* ===========================
   背景与 HUD 效果（保留你的原版）
=========================== */
body {




  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;







  padding: var(--page-padding-y) var(--page-padding-x);
  min-height: 100vh;
  background: radial-gradient(circle at 50% 60%, #11131a 0%, #0a0c10 60%, #050509 100%);
  color: #fff;
  font-family: 'Inter', 'Segoe UI', sans-serif;

  position: relative;
  overflow: hidden;
}

body::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 50, 100, 0.25) 0%, transparent 70%),
    radial-gradient(circle at 80% 20%, rgba(50, 150, 255, 0.25) 0%, transparent 70%);
  filter: blur(120px);
  z-index: -2;
}

body::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 80px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 80px
    ),
    url("https://www.transparenttextures.com/patterns/noise-pattern-with-subtle-cross-lines.png");
  opacity: 0.2;
  mix-blend-mode: overlay;
  z-index: -1;
  pointer-events: none;
}

/* ===========================
   手机框结构（左右都用此结构）
=========================== */
.phone-frame {
  height: calc(95vh - 2 * var(--page-padding-y));
  box-sizing: border-box;
  border: 1px solid #464646;
  border-radius: 14px;
  position: relative;
  overflow: visible; /* 让圆角裁剪内容 */
  z-index: 1;
}

/* 黑色屏幕 */
.phone-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  border-radius: inherit;
  z-index: 2;
}

/* 外部光效 */
.phone-frame::after {
  content: "";
  position: absolute;
  inset: 0px;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: normal;
  z-index: 0;

  box-shadow:
    0 0 3px rgba(251, 198, 83, 0.55),
    0 0 4px rgba(255, 255, 255, 0.35),
    0 0 6px rgba(255, 255, 255, 0.20);
}

/* 左侧手机呼吸光（Ice White / Device Status Glow） */
.fixed-left::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;

  box-shadow:
    0 0 8px  rgba(220, 235, 255, 0.50),
    0 0 14px rgba(220, 235, 255, 0.32),
    0 0 22px rgba(220, 235, 255, 0.18);

  animation: deviceBreathGlow 6s ease-in-out infinite;
}

/* 呼吸动画 —— 冰白一致 */
@keyframes deviceBreathGlow {
  0% {
    box-shadow:
      0 0 8px  rgba(220, 235, 255, 0.40),
      0 0 14px rgba(220, 235, 255, 0.26),
      0 0 22px rgba(220, 235, 255, 0.15);
  }

  50% {
    box-shadow:
      0 0 12px rgba(220, 235, 255, 0.60),
      0 0 18px rgba(220, 235, 255, 0.40),
      0 0 26px rgba(220, 235, 255, 0.28);
  }

  100% {
    box-shadow:
      0 0 8px  rgba(220, 235, 255, 0.40),
      0 0 14px rgba(220, 235, 255, 0.26),
      0 0 22px rgba(220, 235, 255, 0.15);
  }
}






/* 左侧屏幕比例锁定 */
.fixed-left {
  aspect-ratio: 9 / 19.5;
  flex: 0 0 auto;
  margin-left: var(--left-margin);   /* ← ← 你真正想要的效果在这里 */
}


/* 右侧手机框 */
.flex-right {
  flex: 1;
  width: auto;
  position: relative;
}



/* 🔑 关键：明确左右手机层级 */
.phone-frame.fixed-left {
  z-index: 5;
}

.phone-frame.flex-right {
  z-index: 1;
}













/* ======================================================
   🔥 关键升级点：右侧卡片区域 = 完全贴合黑背景本体
   让卡片与黑背景等比例缩放（解决你截图里的问题）
====================================================== */
.flex-right .right-content {
  position: absolute;
  inset: 0;           /* 完全贴合黑色背景区域 */
  z-index: 3;         /* 高于黑屏 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 0;        /* 使用百分比，可以等比例缩放 */
  box-sizing: border-box;
}

/* ===========================
   卡片视口（等比例缩放）
=========================== */
.cards-viewport {
  width: 80%;         /* 相对于黑背景 */
  height: 80%;        /* 相对于黑背景 */
  min-width: 0;
  min-height: 0;

  overflow: hidden;
  position: relative;
  border-radius: 14px;
}

/* 轨道 */
.cards-track {
  height: 100%;
  width: 300%;
  display: flex;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ===========================
   单张卡片（完全用 % 缩放）
=========================== */
.info-card {
  flex: 0 0 100%;
  height: 100%;

  padding: 4% 5%;     /* 全部用百分比，跟随黑背景缩放 */
  box-sizing: border-box;

  border-radius: 14px;

  background: linear-gradient(
    135deg,
    rgba(32, 32, 42, 0.98),
    rgba(8, 8, 14, 0.96)
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.65);

  display: flex;
  flex-direction: column;
}

.card-header h2 {
  margin: 0;
  font-size: 2.4vw;        /* 使用 vw 自动缩放，完全同步黑框缩放 */
  max-font-size: 26px;
}

.card-body {
  font-size: 1.55vw;
  line-height: 1.45;
  opacity: 0.9;
}

.card-body ul {
  margin-top: 2%;
  padding-left: 6%;
}

/* ===========================
   3 个分页点
=========================== */
.card-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  margin-top: var(--card-dots-offset);
}

.card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  cursor: pointer;
  transition: transform 0.25s, background-color 0.25s;
}

.card-dot.active {
  background: white;
  transform: none;
}

/* 让左侧 HUD 空间具有固定高度 */
#left-hud {
  height: calc(100vh - var(--offset-top) - var(--offset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 让 record-box 占满左侧手机内部 */
/* inner-screen 负责裁剪，保持满框 */
.inner-screen {
    position: absolute;
    inset: 0;
    background: #000;
    border-radius: 0px;     /* ★ 你手机屏幕圆角大小 */
    overflow: hidden;        /* ★ 负责真正裁剪截图 */
    z-index: 3;
}

/* record-box 依然是截图容器 */
#record-box {
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    border-radius: 20px;   /* ★ 加大截图区域圆角 */
    overflow: hidden;
    z-index: 5;
}





/* 背后光效层 —— 位于黑屏上、截图下 */


.screen-container {
    position: absolute;
    inset: 0;
    z-index: 3;    /* 在 glow 上层，在 screenshot 下层 */
    border-radius: 24px;
    overflow: hidden;
}


/* ✅ 左侧圆形开合按钮（压在右边框上） */
/* 左侧圆形开合按钮（img 版） */
.left-toggle-btn {
  position: absolute;
  top: 45%;
  right: -35px;
  transform: translateY(-50%);

  width: clamp(60px, 5vw, 60px);
  height: clamp(60px, 5vw, 60px);
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(30, 30, 38, 0.85); /* 底色，避免透明图边缘发虚 */
  border: 0.5px solid rgba(255, 255, 255, 0.25);

  padding: 0;          /* 防止 button 默认 padding */
  cursor: pointer;
  z-index: 30;

  box-shadow: 0 0 3px rgba(220, 235, 255, 0.35);
}

/* 图片本体 */
.left-toggle-btn .toggle-icon {
  width: 100%;          /* 关键：这类图片要大 */
  height: 100%;
  border-radius: 50%;  /* 防止 JPG 边角 */
  object-fit: cover;

  pointer-events: none; /* 不挡点击 */
  user-select: none;
}

/* 按下反馈 */
.left-toggle-btn:active {
  transform: translateY(-50%) scale(0.96);
}





/* 针对特斯拉圆形隐藏按钮的大小调节 */
@media (min-aspect-ratio: 16/6) {
  .left-toggle-btn {
    width: clamp(40px, 8vw, 110px);
    height: clamp(40px, 8vw, 110px);
  }
}

/* ============================================================
   RDG 中间控制按钮区：搜索 / 最新 / 折叠展开 / 最旧 / 语板精灵
   版本：RDG_MIDDLE_CONTROLS_V2_SEARCH_YUBAN
============================================================ */

.rdg-middle-controls {
  flex: 0 0 clamp(56px, 5.2vw, 82px);
  height: calc(95vh - 2 * var(--page-padding-y));

  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: stretch;
  justify-items: center;

  position: relative;
  z-index: 40;

  pointer-events: auto;
  user-select: none;
}

.rdg-control-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 搜索：放在左右屏中间靠上的位置 */
.rdg-control-group-top {
  justify-content: flex-start;
  padding-top: clamp(28px, 7vh, 92px);
}

/* 原有 3 个核心按钮：继续保持中间位置 */
.rdg-control-group-main {
  justify-content: center;
  gap: clamp(26px, 5.2vh, 72px);
}

/* 语板精灵：中间下部占位，先不绑定功能 */
.rdg-control-group-bottom {
  justify-content: flex-end;
  padding-bottom: clamp(30px, 8vh, 110px);
}

/* 中间透明 PNG 按钮 */
.rdg-control-btn {
  width: clamp(58px, 5vw, 76px);
  height: clamp(58px, 5vw, 76px);

  border: none;
  outline: none;
  padding: 0;
  margin: 0;

  border-radius: 50%;
  background: transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  position: relative;
  z-index: 41;
  isolation: isolate;
  overflow: visible;

  transition:
    transform 0.12s ease,
    filter 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease;

  /* V5.1：把可见光效放到按钮外圈，避免被不透明 PNG 圆面盖住 */
  box-shadow:
  0 0 4px rgba(170, 220, 255, 0.16),
  0 0 8px rgba(76, 132, 255, 0.08);
}

/* 按钮背后的网页光效：与 PNG 图分离，后期更好统一控制 */
.rdg-control-btn::before,
.rdg-control-btn::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}

/* 外层柔和蓝白光晕
   关键修正：原来 inset:10% 画在按钮内部，会被 PNG 圆面遮住。
   现在改为向外扩展，并放在图片下层，所以按钮加载后外圈仍然能看到光。 */
.rdg-control-btn::before {
  inset: -6%;
  z-index: 0;
  background:
    radial-gradient(circle,
      rgba(215, 238, 255, 0.28) 0%,
      rgba(140, 198, 255, 0.18) 34%,
      rgba(74, 130, 245, 0.10) 56%,
      rgba(25, 45, 95, 0.00) 76%);
  filter: blur(5px);
  opacity: 0.62;
  transform: scale(1.00);
}

/* 内层冷色托光：同样略微外扩，避免完全被 PNG 遮住 */
.rdg-control-btn::after {
  inset: -2%;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 44%,
      rgba(255, 255, 255, 0.10) 0%,
      rgba(168, 207, 255, 0.08) 28%,
      rgba(94, 145, 240, 0.06) 48%,
      rgba(10, 17, 28, 0.00) 72%);
  box-shadow:
    0 0 5px rgba(142, 196, 255, 0.12),
    0 0 9px rgba(76, 116, 224, 0.08);
  opacity: 0.55;
  transform: scale(1.00);
}

.rdg-control-btn:hover {
  filter: brightness(1.08);
}

.rdg-control-btn:hover::before {
  opacity: 0.78;
  transform: scale(1.03);
  filter: blur(6px);
}

.rdg-control-btn:hover::after {
  opacity: 0.68;
  transform: scale(1.01);
  box-shadow:
    0 0 6px rgba(170, 218, 255, 0.16),
    0 0 10px rgba(88, 132, 240, 0.10);
}

.rdg-control-btn:hover .rdg-control-icon {
  filter:
    drop-shadow(0 0 9px rgba(195, 232, 255, 0.44))
    drop-shadow(0 0 20px rgba(86, 142, 255, 0.24));
}

.rdg-control-btn:active {
  transform: scale(0.94);
  filter: brightness(1.16);
}

.rdg-control-btn:active::before {
  opacity: 1;
  transform: scale(1.05);
}

.rdg-control-btn:active::after {
  opacity: 1;
  transform: scale(0.98);
}

/* 图片本体 */
.rdg-control-icon {
  width: 100%;
  height: 100%;

  display: block;
  object-fit: contain;

  position: relative;
  z-index: 3;

  /* V5.1：直接给 PNG 边缘加 drop-shadow，保证加载完成后外圈仍有光 */
  filter:
    drop-shadow(0 0 3px rgba(170, 220, 255, 0.22))
    drop-shadow(0 0 6px rgba(72, 124, 245, 0.10));

  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* 防止按钮禁用时太突兀 */
.rdg-control-btn:disabled {
  opacity: 0.35;
  cursor: default;
  filter: none;
}

.rdg-control-btn:disabled::before,
.rdg-control-btn:disabled::after {
  opacity: 0.18;
}

.rdg-control-btn:disabled .rdg-control-icon {
  filter: none;
}


/* ============================================================
   RDG 当前订单位置显示：搜索按钮下方  例：12 / 50
============================================================ */
.rdg-page-indicator {
  margin-top: clamp(6px, 0.9vh, 10px);
  min-width: clamp(54px, 5vw, 78px);
  padding: 4px 9px;
  box-sizing: border-box;

  border-radius: 999px;
  border: 1px solid rgba(170, 220, 255, 0.24);
  background: rgba(8, 14, 24, 0.58);
  box-shadow:
    0 0 8px rgba(120, 190, 255, 0.16),
    inset 0 0 8px rgba(180, 230, 255, 0.06);

  color: rgba(235, 246, 255, 0.88);
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0 5px rgba(130, 200, 255, 0.22);

  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  position: relative;
  z-index: 42;
}

/* ============================================================
   订单日期搜索浮层（Tesla 网格版）
   - 不使用 input type="date"
   - 年份用 -/+，月份与日期用大按钮网格
   - 点击搜索后面板不关闭；点击关闭才退出搜索模式
============================================================ */

.rdg-search-panel {
  position: fixed;

  /* 上下位置 */
  top: clamp(50px, 3.2vh, 34px);

  /*
     左侧固定定位：
     - 浏览器宽的时候，最多到 680px
     - 浏览器缩小时，最少保持 560px
     - 中间用 35vw 做轻微自适应
     这样搜索窗口不会再跟着浏览器中心点往左压订单回放窗口
  */
  left: clamp(430px, 35vw, 450px);
  right: auto;

  transform: translateY(-8px);
  z-index: 9999;

  display: none;
  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.rdg-search-panel.is-open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.rdg-search-card {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 15px 17px 15px;
  border-radius: 24px;
  position: relative;
  isolation: isolate;

  background:
    radial-gradient(circle at 18% 0%, rgba(116, 179, 255, 0.20) 0%, rgba(116, 179, 255, 0.00) 34%),
    radial-gradient(circle at 92% 10%, rgba(54, 210, 150, 0.10) 0%, rgba(54, 210, 150, 0.00) 28%),
    linear-gradient(145deg, rgba(12, 18, 30, 0.97), rgba(5, 8, 15, 0.965));
  border: 1px solid rgba(198, 224, 255, 0.34);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.055) inset,
    0 18px 54px rgba(0, 0, 0, 0.66),
    0 0 34px rgba(96, 158, 255, 0.20),
    0 0 2px rgba(255, 255, 255, 0.55) inset;

  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);

  color: rgba(243, 249, 255, 0.97);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.rdg-search-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.00) 26%),
    linear-gradient(90deg, rgba(120, 190, 255, 0.09), rgba(255, 255, 255, 0.00) 48%, rgba(76, 255, 180, 0.055));
}

.rdg-search-title {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  color: rgba(247, 252, 255, 0.98);
  text-shadow: 0 0 12px rgba(120, 190, 255, 0.25);
}

.rdg-search-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.04em;
  color: rgba(212, 230, 250, 0.78);
  margin: 10px 0 7px;
}

.rdg-search-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(126, 196, 255, 0.70);
  box-shadow: 0 0 8px rgba(126, 196, 255, 0.42);
}

.rdg-search-label.day-label {
  margin-top: 11px;
}

.rdg-search-year-row {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  gap: 7px;
  align-items: center;
}

.rdg-search-step,
.rdg-search-month-btn,
.rdg-search-day-btn,
.rdg-search-action {
  border: 1px solid rgba(206, 228, 255, 0.25);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
  color: rgba(242, 248, 255, 0.94);
  font-weight: 760;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 9px 18px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.12s ease,
    filter 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.rdg-search-step:hover,
.rdg-search-month-btn:hover,
.rdg-search-day-btn:hover,
.rdg-search-action:hover {
  border-color: rgba(178, 222, 255, 0.48);
  filter: brightness(1.08);
}

.rdg-search-step {
  height: 42px;
  font-size: 23px;
  line-height: 1;
  color: rgba(232, 244, 255, 0.96);
}

.rdg-search-year-display {
  height: 42px;
  line-height: 42px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid rgba(154, 205, 255, 0.44);
  background:
    radial-gradient(circle at 50% 0%, rgba(137, 203, 255, 0.24) 0%, rgba(137, 203, 255, 0.00) 55%),
    linear-gradient(180deg, rgba(27, 45, 70, 0.92), rgba(16, 26, 43, 0.92));
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 18px rgba(105, 175, 255, 0.15) inset,
    0 10px 24px rgba(0, 0, 0, 0.26);
  text-shadow: 0 0 12px rgba(162, 214, 255, 0.28);
}

.rdg-search-month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.rdg-search-month-btn {
  height: 38px;
  font-size: 13px;
}

.rdg-search-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.rdg-search-day-btn {
  height: 38px;
  font-size: 14px;
  position: relative;
  padding-bottom: 6px;
}

.rdg-search-day-btn.has-orders::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(50, 220, 136, 0.98);
  box-shadow:
    0 0 6px rgba(50, 220, 136, 0.78),
    0 0 13px rgba(50, 220, 136, 0.36);
}

.rdg-search-panel.is-loading-days .rdg-search-day-btn.has-orders::after {
  opacity: 0.45;
}

.rdg-search-month-btn.is-selected,
.rdg-search-day-btn.is-selected {
  background:
    radial-gradient(circle at 50% 0%, rgba(176, 225, 255, 0.34), rgba(112, 176, 255, 0.12) 58%),
    linear-gradient(180deg, rgba(54, 91, 130, 0.86), rgba(28, 48, 76, 0.88));
  border-color: rgba(189, 229, 255, 0.74);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 18px rgba(127, 196, 255, 0.32),
    0 10px 22px rgba(0, 0, 0, 0.24);
  text-shadow: 0 0 9px rgba(180, 226, 255, 0.30);
}

.rdg-search-day-btn.is-selected.has-orders::after {
  background: rgba(72, 255, 164, 1);
  box-shadow:
    0 0 8px rgba(72, 255, 164, 0.86),
    0 0 16px rgba(72, 255, 164, 0.40);
}

.rdg-search-range {
  margin-top: 11px;
  min-height: 52px;
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.48;
  color: rgba(214, 231, 250, 0.82);
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(166, 208, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

.rdg-search-actions {
  display: flex;
  gap: 10px;
  margin-top: 11px;
}

.rdg-search-action {
  flex: 1;
  min-width: 0;
  height: 42px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.rdg-search-action.primary {
  background:
    radial-gradient(circle at 50% 0%, rgba(174, 225, 255, 0.30), rgba(78, 144, 222, 0.12) 60%),
    linear-gradient(180deg, rgba(45, 80, 119, 0.92), rgba(26, 49, 81, 0.94));
  border-color: rgba(151, 210, 255, 0.62);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.075) inset,
    0 0 19px rgba(103, 176, 255, 0.24),
    0 12px 26px rgba(0, 0, 0, 0.26);
}

.rdg-search-step:active,
.rdg-search-month-btn:active,
.rdg-search-day-btn:active,
.rdg-search-action:active,
.rdg-control-btn:active {
  transform: scale(0.97);
  filter: brightness(1.18);
}

/* 特斯拉横屏 / 超宽屏微调 */
@media (min-aspect-ratio: 16/6) {
  .rdg-middle-controls {
    flex-basis: clamp(58px, 5.8vw, 96px);
  }

  .rdg-control-group-top {
    padding-top: clamp(26px, 7vh, 100px);
  }

  .rdg-control-group-main {
    gap: clamp(24px, 5.8vh, 86px);
  }

  .rdg-control-group-bottom {
    padding-bottom: clamp(28px, 8vh, 118px);
  }

  .rdg-control-btn {
    width: clamp(54px, 6.6vw, 96px);
    height: clamp(54px, 6.6vw, 96px);
  }
}

/* 小屏兜底 */
@media (max-width: 900px) {
  .rdg-middle-controls {
    flex-basis: 54px;
  }

  .rdg-control-group-top {
    padding-top: 24px;
  }

  .rdg-control-group-main {
    gap: 24px;
  }

  .rdg-control-group-bottom {
    padding-bottom: 24px;
  }

  .rdg-control-btn {
    width: 52px;
    height: 52px;
  }

  .rdg-search-panel {
    left: clamp(400px, 35vw, 450px);
    right: 12px;
    top: 40px;
    transform: translateY(-8px);
  }

  .rdg-search-panel.is-open {
    transform: translateY(0);
  }

  .rdg-search-card {
    width: auto;
    min-width: 260px;
  }
}

/* ============================================================
   RDG 空订单 / 图片失效状态
   目的：数据库清空或截图 URL 失效时，不显示黑屏 + 左上角破图标
   ============================================================ */
.rdg-empty-state {
    position: absolute;
    inset: 0;
    z-index: 20;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    color: rgba(235, 245, 255, 0.92);

    background:
        radial-gradient(circle at 50% 38%,
            rgba(70, 120, 180, 0.14) 0%,
            rgba(20, 35, 60, 0.08) 30%,
            rgba(0, 0, 0, 0.00) 62%);

    pointer-events: none;
}

.rdg-empty-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;

    color: rgba(230, 246, 255, 0.90);
    border: 1px solid rgba(180, 220, 255, 0.24);
    background: rgba(255, 255, 255, 0.045);

    box-shadow:
        0 0 6px rgba(160, 215, 255, 0.10),
        inset 0 0 10px rgba(255, 255, 255, 0.035);

    margin-bottom: 10px;
}

.rdg-empty-title {
    font-size: 15px;
    font-weight: 650;
    color: rgba(245, 250, 255, 0.94);
    margin-bottom: 6px;
}

.rdg-empty-sub {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(210, 225, 240, 0.62);
}
/* ============================================================
   RDG 手机端空订单提示强制放大版
   原因：手机浏览器会缩放显示电脑端页面，普通 15px/22px 会被缩得很小
   只影响手机窄屏，不影响电脑端
   ============================================================ */
@media screen and (max-width: 1024px), screen and (max-device-width: 768px) {

    .rdg-empty-state {
        z-index: 80 !important;
        padding: 0 18px !important;
        transform: none !important;
        transform-origin: center center !important;
    }

    .rdg-empty-icon {
        width: 118px !important;
        height: 118px !important;
        font-size: 28px !important;
        margin-bottom: 34px !important;

        border: 2px solid rgba(180, 220, 255, 0.34) !important;
        box-shadow:
            0 0 18px rgba(160, 215, 255, 0.16),
            inset 0 0 18px rgba(255, 255, 255, 0.05) !important;
    }

    .rdg-empty-title {
        font-size: 60px !important;
        line-height: 1.2 !important;
        font-weight: 800 !important;
        margin-bottom: 18px !important;
        color: rgba(245, 250, 255, 0.98) !important;
        text-shadow: 0 0 8px rgba(160, 215, 255, 0.22) !important;
        white-space: nowrap !important;
    }

    .rdg-empty-sub {
        font-size: 38px !important;
        line-height: 1.45 !important;
        color: rgba(220, 235, 250, 0.78) !important;
        white-space: nowrap !important;
    }
}

/* ============================================================
   RDG 手机端订单截图完整显示
   只影响手机端：不裁切订单底部；电脑端保持现有 cover 效果
   注意：不要给 .shot-stage 加 display:flex，否则会影响上下滑动动画
   ============================================================ */
@media screen and (max-width: 1024px), screen and (max-device-width: 768px) {

    .shot-stage {
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        position: relative !important;
        background: #000 !important;
    }

    .shot-stage .shot,
    img.shot {
        width: 100% !important;
        height: 99% !important;

        object-fit: contain !important;
        object-position: center center !important;

        display: block !important;
        background: #000 !important;
    }
}

/* ============================================================
   RDG_TESLA_PAGE_INDICATOR_VERTICAL_FINAL
   Tesla 浏览器：页码改为竖向小气泡
   目的：不让页码气泡撑宽中间按钮区
============================================================ */
body.rdg-tesla-ui #rdgMiddleControls .rdg-page-indicator {
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;

  min-height: 54px !important;
  box-sizing: border-box !important;

  margin-top: 4px !important;
  padding: 4px 0 !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;

  border-width: 2px !important;
  border-radius: 999px !important;

  background: rgba(8, 14, 24, 0.58) !important;
  border-color: rgba(170, 220, 255, 0.28) !important;

  box-shadow:
    0 0 9px rgba(120, 190, 255, 0.22),
    inset 0 0 8px rgba(180, 230, 255, 0.10) !important;

  white-space: normal !important;
  pointer-events: none !important;
  user-select: none !important;
  overflow: hidden !important;
}

/* 当前页：上面的数字 */
body.rdg-tesla-ui #rdgMiddleControls .rdg-page-indicator .rdg-page-current {
  display: block !important;
  font-size: 19px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  letter-spacing: 0.01em !important;
  color: rgba(245, 250, 255, 0.96) !important;
}

/* 中间分隔线 */
body.rdg-tesla-ui #rdgMiddleControls .rdg-page-indicator .rdg-page-separator {
  display: block !important;
  width: 24px !important;
  height: 1px !important;
  margin: 1px 0 !important;
  background: rgba(180, 225, 255, 0.38) !important;
  border-radius: 999px !important;
}

/* 总数：下面的数字 */
body.rdg-tesla-ui #rdgMiddleControls .rdg-page-indicator .rdg-page-total {
  display: block !important;
  font-size: 15px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  color: rgba(220, 238, 255, 0.82) !important;
}
/* ============================================================
   RDG 手机端：修复底部边框被浏览器裁切
   只影响手机端，电脑端不变
============================================================ */
@media screen and (max-device-width: 768px), screen and (max-width: 1024px) {

  html,
  body {
    width: 100% !important;

    height: 100vh !important;
    min-height: 100vh !important;

    height: 100svh !important;
    min-height: 100svh !important;

    overflow: hidden !important;
  }

  body {
    box-sizing: border-box !important;
    padding: 6px 0 14px 0 !important;
    align-items: center !important;
    gap: 10px !important;

    --page-padding-x: 0px;
    --page-padding-y: 0px;
  }

  .phone-frame {
    height: calc(100vh - 34px) !important;
    max-height: calc(100vh - 34px) !important;

    height: calc(100svh - 36px) !important;
    max-height: calc(100svh - 36px) !important;
  }

  .fixed-left {
    margin-left: 0 !important;
  }
}
/* ============================================================
   RDG 手机端控制按钮最终版
   只保留这一段，不要再有其它 .rdg-control-btn / #btnSearch 尺寸规则
============================================================ */
@media screen and (max-device-width: 768px), screen and (max-width: 1024px) {

  #rdgMiddleControls.rdg-middle-controls {
    position: fixed !important;

    right: 4px !important;
    top: 52% !important;
    transform: translateY(-50%) !important;

    width: 150px !important;
    height: auto !important;
    flex: none !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 18px !important;

    z-index: 10000 !important;
    pointer-events: auto !important;
    overflow: visible !important;
  }

  #rdgMiddleControls .rdg-control-group,
  #rdgMiddleControls .rdg-control-group-top,
  #rdgMiddleControls .rdg-control-group-main,
  #rdgMiddleControls .rdg-control-group-bottom {
    width: 150px !important;
    padding: 0 !important;
    margin: 0 !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 20px !important;
    overflow: visible !important;
  }

  #rdgMiddleControls #btnSearch,
  #rdgMiddleControls #btnLatest,
  #rdgMiddleControls #btnLeftToggle,
  #rdgMiddleControls #btnOldest,
  #rdgMiddleControls #btnYuban {
    width: 132px !important;
    height: 132px !important;

    min-width: 132px !important;
    min-height: 132px !important;

    max-width: none !important;
    max-height: none !important;

    flex: 0 0 132px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #rdgMiddleControls .rdg-control-icon {
    width: 132px !important;
    height: 132px !important;

    min-width: 132px !important;
    min-height: 132px !important;

    max-width: none !important;
    max-height: none !important;

    object-fit: contain !important;
  }
}

/* ============================================================
   RDG_PAGE_INDICATOR_MOBILE_FINAL
   手机端：页码贴近搜索按钮，不额外拉长整组按钮区
============================================================ */
@media screen and (max-device-width: 768px), screen and (max-width: 1024px) {
  #rdgMiddleControls .rdg-control-group-top {
    gap: 4px !important;
  }

  #rdgMiddleControls .rdg-page-indicator {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;

    margin-top: -8px !important;
    padding: 5px 8px !important;

    font-size: 18px !important;
    line-height: 1.15 !important;
    letter-spacing: 0.02em !important;
  }
}
