/* ==========================================================================
   Twinkle Trimmings 定制器全局样式 (Optimized Version)
   ========================================================================== */

/* === 0. 全局与重置 === */
#tt-multistep-app {
  font-family: var(
    --e-global-typography-primary-font-family,
    "Poppins",
    sans-serif
  );
  color: var(--e-global-color-text, #333);
}

/* === 1. 核心指示器：菱形选中态 (The Gap Diamond) === */
.tt-diamond-indicator {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-radius: 3px;
  border: 1px solid #ccc;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  transition: all 0.3s ease;
  cursor: pointer;
}
.tt-diamond-indicator.active {
  border-color: var(--e-global-color-primary, #7f4c15);
}
.tt-diamond-indicator.active::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background-color: var(--e-global-color-primary, #7f4c15);
  border-radius: 1px;
}

/* === 2. 步骤头部与布局 === */
.tt-step-container {
  border: 1px dashed var(--e-global-color-accent, #ccc);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  background: #fff;
  transition: all 0.3s ease;
}
.tt-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--e-global-color-accent, #ccc);
  margin-bottom: 20px;
}
.tt-step-num {
  width: 28px;
  height: 28px;
  background-color: var(--e-global-color-primary, #7f4c15);
  color: #fff;
  transform: rotate(45deg);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tt-step-num span {
  transform: rotate(-45deg);
  font-weight: 600;
  font-size: 14px;
}
.tt-step-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--e-global-color-primary, #7f4c15);
}
.tt-step-desc {
  font-size: 13px;
  color: #666;
  margin: 4px 0 12px 26px;
  line-height: 1.4;
}
.tt-sub-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--e-global-color-text, #333);
  margin: 20px 0 12px 0;
}

/* 预留：折叠状态 */
.tt-step-container.is-collapsed .tt-step-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
  opacity: 0.5;
}
.tt-step-container.is-collapsed .tt-step-content {
  display: none;
}

/* ==========================================================================
   3. 公共卡片系统 (DRY 原则重构)
   ========================================================================== */

/* 3.1 基础卡片骨架 */
.tt-card,
.tt-color-card,
.tt-qty-card,
.tt-custom-qty-card,
.tt-backing-card,
.tt-date-card {
  border: 2px solid #eee;
  background: #fff;
  border-radius: 8px; /* 默认8px，个别可在下方覆盖 */
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}
.tt-backing-card {
  overflow: visible;
  width: 90%;
}
.tt-card {
  border-radius: 12px;
  padding: 0;
  min-height: 90px;
} /* Step 2/3 特殊覆盖 */
.tt-custom-qty-card {
  cursor: default;
  width: fit-content;
} /* Custom 不需 pointer */

/* 3.2 激活态：边框高亮 */
.tt-card.active,
.tt-color-card.active,
.tt-qty-card.is-selected,
.tt-backing-card.active,
.tt-date-card.active,
.tt-qty-group.is-active .tt-custom-qty-card,
.tt-card:hover,
.tt-color-card:hover,
.tt-qty-card:hover,
.tt-backing-card:hover,
.tt-date-card:hover {
  border-color: var(--e-global-color-primary, #7f4c15);
}

/* 3.3 激活态：浅色背景 (Quantity/Date 因有特殊底部颜色所以不加此背景) */
.tt-card.active,
.tt-color-card.active,
.tt-backing-card.active {
  background-color: rgba(127, 76, 21, 0.05);
}

/* 3.4 激活态：透明度反馈 (不选中的 Quantity/Date 变淡) */
.tt-qty-card:not(.is-selected),
.tt-date-card:not(.active) {
  opacity: 0.6;
}
.tt-qty-card.is-selected,
.tt-date-card.active {
  opacity: 1;
}

/* ==========================================================================
   4. 公共对勾系统 (Checkmarks)
   ========================================================================== */

/* 4.1 对勾基础样式 */
.tt-card.active::before,
.tt-color-card.active::before,
.tt-backing-card.active::before,
.tt-qty-card.is-selected::after,
.tt-date-card.active::after {
  content: "✓";
  position: absolute;
  background-color: var(--e-global-color-primary, #7f4c15);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 10;
}

/* 4.2 居中对勾 (Size, Coverage, Color) */
.tt-card.active::before,
.tt-color-card.active::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  font-size: 14px;
}

/* 4.3 偏下居中对勾 (Backing) */
.tt-backing-card.active::before {
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  font-size: 14px;
}

/* 4.4 右上角小对勾 (Quantity, Date) */
.tt-qty-card.is-selected::after,
.tt-date-card.active::after {
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  font-size: 10px;
}

/* 4.5 图片变淡反馈 (当有对勾压在上面时) */
.tt-card.active img,
.tt-color-card.active .tt-color-img,
.tt-backing-card.active .tt-backing-icon {
  opacity: 0.3;
}

/* ==========================================================================
   5. 各步骤专属局部细节
   ========================================================================== */

/* --- Step 1: Artwork --- */
.tt-artwork-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}
.tt-artwork-col {
  flex: 1;
  width: 50%;
}
.tt-upload-box {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 25px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  position: relative;
}
.tt-upload-box:hover {
  border-color: var(--e-global-color-primary, #7f4c15);
  background: #fffcf8;
}
.tt-upload-box.has-file {
  padding: 8px;
  border-color: var(--e-global-color-primary, #7f4c15);
}
.tt-image-preview {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 4px;
}
.tt-file-icon {
  font-size: 40px;
  margin-bottom: 10px;
  color: var(--e-global-color-primary, #7f4c15);
}
.tt-file-name {
  font-size: 12px;
  color: #555;
  word-break: break-all;
  padding: 0 10px;
}

.tt-close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--e-global-color-primary, #7f4c15);
  color: white;
  border: none;
  border-radius: 50% !important;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 !important;
  margin: 0;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
  font-size: 14px;
  font-weight: bold;
  box-sizing: border-box;
}
.tt-close-btn:hover {
  background: var(--e-global-color-03899bb, #aa440f);
  transform: scale(1.05);
}

/* --- 表单控件 (Inputs, Checkbox, Textarea) --- */
.tt-custom-size-inputs,
.tt-custom-size-form {
  display: flex;
  gap: 10px;
  padding-left: 24px;
  margin-top: 10px;
}
.tt-custom-size-form {
  flex-direction: column;
  gap: 12px;
  padding-left: 26px;
}
.tt-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--e-global-color-primary, #7f4c15);
  font-size: 15px;
}
.tt-input-row label {
  display: inline-block;
  width: 55px;
}
.tt-input-field {
  width: 140px !important;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #777;
  border-radius: 2px;
  font-family: inherit;
  font-size: 14px;
  padding: 0 !important;
  text-align: center;
}
.tt-input-field:focus,
.tt-textarea-field:focus {
  border-color: var(--e-global-color-primary, #7f4c15);
  outline: none;
}
.tt-textarea-field {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.tt-custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  outline: none;
  margin: 0;
  flex-shrink: 0;
}
.tt-custom-checkbox:checked {
  border-color: var(--e-global-color-primary, #7f4c15);
}
.tt-custom-checkbox:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--e-global-color-primary, #7f4c15);
  border-radius: 1px;
}

/* --- Step 2 & 3: Grid & Card Details --- */
.tt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}
.tt-card-body {
  padding: 12px 12px 0 12px;
  text-align: left;
}
.tt-card-label {
  font-size: 12px;
  line-height: 1.2;
  margin-top: auto;
  background-color: #777;
  color: #fff;
  padding: 4px 0;
}
.tt-coverage-img {
  width: 100%;
  display: block;
  margin-top: 10px;
  border-top: 1px solid #f0f0f0;
}
.tt-coverage-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* --- Step 4: Color Cards --- */
.tt-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.tt-color-card {
  padding: 6px;
  align-items: center;
  min-height: 80px;
}
.tt-color-img {
  width: 100%;
  height: 45px;
  object-fit: contain;
  margin-bottom: 6px;
}
.tt-color-label {
  font-size: 11px;
  line-height: 1.2;
  color: #555;
  word-break: break-word;
  margin-top: auto;
}

/* --- Step 5: Backing --- */
.tt-backing-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.tt-backing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 15px;
}
.tt-backing-card {
  min-height: 120px;
}
.tt-backing-header {
  padding: 5px 5px;
  font-weight: 600;
  font-size: 13px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px dashed #eee;
}
.tt-backing-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.tt-backing-icon {
  width: 7rem;
  height: 7rem;
  object-fit: contain;
  transition: opacity 0.2s;
}

/* --- Tooltip 悬浮框 --- */
.tt-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
}
.tt-tooltip-icon {
  width: 14px;
  height: 14px;
  background: #ccc;
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  transition: all 0.2s;
}
.tt-tooltip-wrapper:hover .tt-tooltip-icon {
  background: var(--e-global-color-primary, #7f4c15);
}
.tt-tooltip-text {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
  pointer-events: none;
  width: clamp(16rem, 80%, 10rem);
  text-align: left;
}
.tt-tooltip-wrapper:hover .tt-tooltip-text {
  opacity: 1;
  visibility: visible;
}
.tt-tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

/* --- Step 6 & 7: Quantity & Date (共用的底部深浅切换逻辑) --- */
.tt-qty-group {
  margin-bottom: 25px;
  transition: opacity 0.3s;
}

.tt-qty-card-top,
.tt-date-card-top {
  padding: 12px 5px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.tt-qty-card-top {
  padding: 0;
  min-height: 30px;
}
.tt-date-card-top {
  min-height: 70px;
  padding: 10px 5px;
}

.tt-qty-card-bottom,
.tt-custom-qty-card-bottom,
.tt-date-card-bottom {
  color: #fff;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.2s;
  font-size: 12px;
  font-weight: bold;
}
.old-price {
  font-size: 10px;
  text-decoration: line-through;
  opacity: 0.7;
}
.new-price {
  font-size: 13px;
  font-weight: bold;
}

/* 底部背景色：未激活为浅灰，激活为深色 */
.tt-qty-group:not(.is-active) .tt-qty-card-bottom,
.tt-qty-group:not(.is-active) .tt-custom-qty-card-bottom,
.tt-date-card:not(.active) .tt-date-card-bottom {
  background: #aaa;
}

.tt-qty-group.is-active .tt-qty-card-bottom,
.tt-qty-group.is-active .tt-custom-qty-card-bottom,
.tt-date-card.active .tt-date-card-bottom {
  background: #79694e;
}

/* Date 特有文字排版 */
.tt-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.tt-date-daynum {
  font-size: 28px;
  font-weight: 800;
  color: #333;
  line-height: 1;
  margin-bottom: 4px;
}
.tt-date-monthyear {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}
.tt-date-weekday {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}
.tt-warning-text {
  color: var(--e-global-color-primary, #7f4c15);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(127, 76, 21, 0.05);
  padding: 10px 15px;
  border-radius: 6px;
}

/* 计数器输入框 */
.tt-qty-counter {
  display: flex;
  align-items: center;
  border-radius: 4px;
  overflow: hidden;
}
.tt-qty-btn {
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  color: #333;
  border-width: 0 !important;
  border-radius: 0 !important;
}
.tt-qty-btn:hover:not(:disabled),
.tt-qty-btn:focus:not(:disabled) {
  background: #f5f5f5 !important;
  color: #333;
}
.tt-qty-btn:disabled,
.tt-qty-btn:hover:disabled {
  background: #f5f5f5;
  color: #333;
  opacity: 0.3;
  cursor: not-allowed;
}
.tt-qty-input {
  width: 55px !important;
  height: 32px;
  border: none !important;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  font-family: inherit;
  font-size: 14px;
  padding: 0 !important;
}

.tt-qty-input::-webkit-outer-spin-button,
.tt-qty-input::-webkit-inner-spin-button {
  /* 针对 Chrome, Safari, Edge 以及 Opera，取消input内部加减小按钮 */
  -webkit-appearance: none;
  margin: 0;
}
.tt-qty-input[type="number"] {
  /* 针对 Firefox，取消input内部加减小按钮  */
  -moz-appearance: textfield;
}

/* === 全局 Toast 轻提示系统 === */
.tt-toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background-color: var(--e-global-color-primary, #7f4c15);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(127, 76, 21, 0.3);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tt-toast-container.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}
.tt-toast-icon {
  font-weight: bold;
  font-size: 16px;
}

/* ==========================================================================
   6. 右侧确认面板与加购闭环 (Phase 8 Sidebar) - v2.0.7 更新
   ========================================================================== */

/* 双栏框架布局 */
.tt-customizer-wrapper {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}
.tt-wizard-steps {
  flex: 1;
  min-width: 0;
}
.tt-sidebar-sticky {
  width: 340px;
  position: sticky;
  top: 50px;
  flex-shrink: 0;
  z-index: 50;
}

/* 最外层容器取消边框和背景，透明承载 */
.tt-sidebar-container {
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 区块一：图片缩略图 (带边框、内距、透明底) */
.tt-sidebar-artwork {
  border: 1px solid var(--e-global-color-accent, #ccc);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  text-align: center;
  background: #fff;
}
.tt-sidebar-artwork img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 4px;
}

/* 区块二：Order Confirmation 核心灰底容器 */
.tt-sidebar-confirmation {
  background: #f2f2f2;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.tt-sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--e-global-color-primary, #7f4c15);
  margin: 0 0 10px 0;
}
.tt-divider {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 15px 0;
}
.tt-divider.title-divider {
  margin-top: 0;
}

.tt-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tt-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  font-size: 13px;
}
.tt-summary-label {
  color: #666;
  font-weight: 500;
  min-width: 70px;
}
.tt-summary-value {
  color: #333;
  font-weight: 600;
  text-align: right;
}

.tt-summary-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.tt-tiny-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
}

/* 费用与计价 */
.tt-pricing-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #555;
}
.tt-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tt-price-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.tt-price-strikethrough {
  text-decoration: line-through;
  color: #999;
  font-size: 11px;
  margin-top: 2px;
}
.tt-price-free {
  color: var(--e-global-color-03899bb, #aa440f);
  font-weight: 700;
}

/* 底部结算区 (取消背景色与顶边框) */
.tt-sidebar-footer {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.tt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.tt-total-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.tt-total-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--e-global-color-03899bb, #aa440f);
  line-height: 1;
}

.tt-atc-btn {
  width: 100%;
  background: var(--e-global-color-03899bb, #aa440f);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}
.tt-atc-btn:hover:not(.is-disabled) {
  background: var(--e-global-color-primary, #7f4c15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(127, 76, 21, 0.3);
}
.tt-atc-btn.is-disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}
.tt-atc-btn.is-loading {
  pointer-events: none;
  opacity: 0.9;
}

/* Loading Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   7. 可视化计价沙盘 (Pricing Debugger Sandbox)
   ========================================================================== */
.tt-debugger-wrapper {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  font-family: monospace, sans-serif;
}

.tt-debugger-btn {
  width: 50px;
  height: 50px;
  border-radius: 50% !important;
  background: var(--e-global-color-primary, #7f4c15);
  color: #fff;
  border: 3px solid #fff !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  padding: 0 !important;
  line-height: 1;
}
.tt-debugger-btn:hover {
  transform: scale(1.02);
  background: var(--e-global-color-primary, #7f4c15);
  color: #fff;
}

.tt-debugger-panel {
  position: absolute;
  bottom: 65px;
  right: 0;
  width: 340px;
  background: #fdfdfd;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.tt-debugger-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tt-debugger-header {
  background: var(--e-global-color-primary, #7f4c15);
  color: #fff;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tt-debugger-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.tt-debugger-close {
  background: transparent;
  border: none !important;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 !important;
}

.tt-debugger-body {
  max-height: 70vh;
  overflow-y: auto;
  padding: 15px;
}

.tt-debug-block {
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
}
.tt-debug-block.highlight-block {
  border: 1px solid var(--e-global-color-primary, #7f4c15);
  background: rgba(127, 76, 21, 0.03);
}

.tt-debug-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--e-global-color-primary, #7f4c15);
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.tt-debug-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #333;
  margin-bottom: 4px;
}
.tt-debug-row.tt-striked {
  text-decoration: line-through;
  color: #aaa;
}

.tt-debug-rule {
  font-size: 11px;
  color: #888;
  background: #f5f5f5;
  padding: 3px 6px;
  border-radius: 3px;
  margin: 4px 0;
  word-break: break-all;
}

.tt-debug-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #eee;
  font-weight: bold;
  font-size: 13px;
  color: #111;
}
.tt-debug-val {
  color: var(--e-global-color-03899bb, #aa440f);
}

.tt-debug-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  background: var(--e-global-color-primary, #7f4c15);
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
}

/* 移动端适配 */
.tt-drawer-handle {
  display: none;
}

@media (max-width: 900px) {
  /* Artwork */
  .tt-artwork-layout {
    flex-direction: column-reverse;
  }
  .tt-artwork-col {
    width: 100%;
  }
  .tt-artwork-col.blank {
    display: none;
  }

  /* Backing */
  .tt-backing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  /* Size */
  .tt-card-grid {
    gap: 8px;
  }
  /* 其他 */
  .tt-customizer-wrapper {
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden; /* 核心：裁切掉所有超出屏幕 X 轴的隐形元素 */
  }
  .tt-sidebar-sticky {
    z-index: 99;
    width: 100%;
    position: static;
  }

  .tt-sidebar-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 999;
    background: #fff;
    border-top: 1px solid #ddd;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(calc(100% - 100px));

    box-sizing: border-box !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
  }
  .tt-sidebar-container.drawer-open {
    transform: translateY(0);
    max-height: 85vh;
    overflow-y: auto;
  }

  .tt-drawer-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    color: #888;
    font-size: 11px;
    border-bottom: 1px solid #f0f0f0;
  }
  .tt-handle-bar {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin-bottom: 6px;
  }
  .tt-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* 半透明黑底 */
    z-index: 998; /* 核心：必须比 sidebar-container 的 999 小一层 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  /* 当抽屉打开时，遮罩层浮现 */
  .tt-drawer-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .tt-sidebar-artwork {
    display: none;
  } /* 移动端可隐藏图片节省空间 */
  .tt-sidebar-confirmation {
    background: transparent;
    padding: 15px;
    border-radius: 0;
  }
}
