/* =========================================================================
   ym_v2 會員頁補充樣式（登入／註冊）

   放在獨立檔案而不是 ym-v2.css：ym-v2.css 是主題主檔，多人／多工同時在改，
   會員頁這一小塊獨立出來衝突面小，也看得出哪些規則屬於哪個修正。
   載入點：catalog/controller/extension/module/form_fix.php（account/* 路由）
   載入順序在 ym-v2.css 之後（header.twig 的 {% for style in styles %} 在後面），
   所以同分特異度的規則由本檔勝出。
   ========================================================================= */

/* ---------- 1. 快速登入／註冊：兩頁都是三顆按鈕 ----------
   註冊頁原本只有 Facebook / Google 兩顆，格線也寫死兩欄。現在兩頁共用
   common/social_access.twig（Facebook / Google / LINE 三顆），格線要跟著回到三欄，
   否則 LINE 會單獨掉到第二列，跟登入頁看起來又是兩種東西。 */
.ym-social-access--register .ym-social-access__providers,
.ym-social-access__providers { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 991px) {
  .ym-social-access--register .ym-social-access__providers,
  .ym-social-access__providers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 手機單欄等寬：三個同位階的動作不該有兩種寬度 */
@media (max-width: 767px) {
  .ym-social-access--register .ym-social-access__providers,
  .ym-social-access__providers { grid-template-columns: 1fr; }
}

/* ---------- 2. 右欄「進行中的活動」 ---------- */
.ym-activity-side {
  padding: 18px 16px;
  border: 1px solid var(--ym-line);
  border-radius: var(--ym-radius-md);
  background: #fff;
  box-shadow: var(--ym-shadow-sm);
}

.ym-activity-side__head { margin-bottom: 12px; }
.ym-activity-side__head strong { display: block; font-size: 16px; line-height: 1.4; }
.ym-activity-side__head small { display: block; margin-top: 2px; color: var(--ym-muted); line-height: 1.5; }

.ym-activity-side__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }

.ym-activity-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--ym-line);
  border-radius: var(--ym-radius-sm);
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.ym-activity-card:hover,
.ym-activity-card:focus {
  border-color: var(--ym-coral-strong);
  box-shadow: var(--ym-shadow-sm);
  color: inherit;
  text-decoration: none;
  transform: translateY(-1px);
}

.ym-activity-card:focus-visible { outline: 2px solid var(--ym-coral-strong); outline-offset: 2px; }

/* 3:1 的 banner：固定比例，圖還沒載入也不會讓卡片跳動 */
.ym-activity-card__media { display: block; aspect-ratio: 3 / 1; background: var(--ym-blush); }
.ym-activity-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ym-activity-card__body { display: block; padding: 10px 12px 11px; }
.ym-activity-card__title { display: block; font-size: 14px; font-weight: 800; line-height: 1.45; }
.ym-activity-card__date { display: block; margin-top: 3px; color: var(--ym-muted); font-size: 12px; }
.ym-activity-card__date i { margin-right: 3px; }

.ym-activity-side__more {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ym-coral-dark);
  font-size: 13px;
  font-weight: 800;
}

/* ---------- 3. 手機也要看得到活動 ----------
   theme/default 的 column_right.twig 把整個 <aside> 標成 .hidden-xs
   （Bootstrap 3：display:none !important）。那支檔在 .gitignore 內、
   dev2 與正式機各自維護，不能改，所以從 CSS 這端把「裝了活動面板的右欄」放行。
   :has() 不支援時由 ym-v2-member.js 補上 .ym-column-right--activities，兩道都在。 */
@media (max-width: 767px) {
  #column-right.hidden-xs:has(.ym-activity-side),
  #column-right.ym-column-right--activities {
    display: block !important;
    float: none;
    width: 100%;
    margin-top: 16px;
    padding-left: 0;
    padding-right: 0;
  }

  #column-right.hidden-xs:has(.ym-activity-side) .ym-activity-side__list,
  #column-right.ym-column-right--activities .ym-activity-side__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  #column-right.hidden-xs:has(.ym-activity-side) .ym-activity-side__list,
  #column-right.ym-column-right--activities .ym-activity-side__list {
    grid-template-columns: 1fr;
  }
}

/* ---------- 4. 地址表單：台灣人的填寫順序 ----------
   欄位順序已在 address_form.twig 直接調整 DOM（那頁是純 Twig，不像結帳頁受 riot 迴圈限制）。
   這裡只處理兩件視覺上的事。 */

/* 只賣台灣：國家欄位留在 DOM（它的 change 事件負責去撈 zone 清單），但不佔版面。
   用 display:none 而不是 visibility，順便退出 tab 順序。
   結帳頁也是同樣處理。 */
.ym-address-country { display: none !important; }

/* 郵遞區號由鄉鎮市區下拉自動帶入，唯讀時給一個「這格是系統填的」的視覺
   （淡底 + 不可編輯游標），但不要做成 disabled 的灰死狀態 —— 它仍會被送出。
   下拉不可用時 JS 會拿掉 readonly，樣式跟著回到一般輸入框。 */
.ym-account-form input[readonly].ym-input-auto {
  background: var(--ym-blush);
  border-color: var(--ym-line);
  color: var(--ym-ink);
  cursor: default;
}

/* tw_address_district.js 插進來的下拉沿用表單既有規格，
   它是 .form-group + .control-label 的組合，但沒有 Bootstrap 的 col- 格線，
   在 .form-horizontal 裡會貼齊左緣，跟上下兩欄差 2 格。 */
.ym-account-form .tw-district-group { margin-left: 0; }

@media (min-width: 768px) {
  .form-horizontal.ym-account-form .tw-district-group > .control-label {
    width: 16.66666667%;
    padding-top: 7px;
    padding-right: 15px;
    float: left;
    text-align: right;
    margin-bottom: 0;
  }

  .form-horizontal.ym-account-form .tw-district-group > select {
    width: 83.33333333%;
    float: left;
  }

  .form-horizontal.ym-account-form .tw-district-group::after {
    content: "";
    display: table;
    clear: both;
  }
}

/* ---------- 6. 手機也要看得到會員選單（2026-08-30） ----------
   缺陷：390px 下 .ym-account-nav 量到 width=0 / top=0。
   根因與上面第 3 節同一個：theme/default 的 column_right.twig 把整個 <aside>
   標成 .hidden-xs（Bootstrap 3: display:none !important），祖先被隱藏，
   所以 getBoundingClientRect() 全 0，但自己的 computed display 仍是 block。
   結果是手機使用者進了會員中心完全無法在頁面之間切換。

   那支 column_right.twig 在 .gitignore 內（dev2 與正式機各自維護、未進版控），
   不能改，只能從 CSS 這端放行。

   這裡不用第 3 節的 :has() + JS 雙保險，因為 ym-v2-member.js 只被 4 個樣板載入
   （address_form / address_list / login / register），order、reward、transaction、
   wishlist、return、account、edit、password 這 8 頁沒有它，等於只剩一道。
   改用 header.twig 的 body class（`route-` + route 把 / 換成 -，見
   controller/extension/module/ym_v2.php:538），不依賴 :has() 也不依賴 JS。
   排除 login/register —— 那兩頁的右欄放的是活動面板，已由第 3 節處理。 */
/* ---------- 6. 手機也要看得到會員選單（支援 column-left 與 column-right） ---------- */
@media (max-width: 767px) {
  body[class*="route-account-"]:not(.route-account-login):not(.route-account-register) #column-left.hidden-xs,
  body[class*="route-account-"]:not(.route-account-login):not(.route-account-register) #column-right.hidden-xs {
    display: block !important;
    float: none;
    width: 100%;
    margin: 0 0 16px;
    padding-left: 0;
    padding-right: 0;
  }

  body[class*="route-account-"]:not(.route-account-login):not(.route-account-register) .ym-account-page > .row {
    display: flex;
    flex-direction: column;
  }
  body[class*="route-account-"]:not(.route-account-login):not(.route-account-register) .ym-account-page > .row > #column-left { order: -1; }
  body[class*="route-account-"]:not(.route-account-login):not(.route-account-register) .ym-account-page > .row > #column-right { order: -1; }

  /* 橫向捲動的 chip 列 */
  .ym-account-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f2e4e7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  }
  .ym-account-nav::-webkit-scrollbar { display: none; }
  .ym-account-nav .list-group-item {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 0;
    border-right: 1px solid #f7eaed;
    white-space: nowrap;
    scroll-snap-align: start;
    font-size: 13px;
  }
  .ym-account-nav .list-group-item .ym-nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .ym-account-nav .list-group-item .ym-nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .ym-account-nav .list-group-item:last-child { border-right: 0; }
  .ym-account-nav .list-group-item > .fa-angle-right { display: none; }
}

/* 桌機版側選單 ICON 與排版優化 */
@media (min-width: 768px) {
  #column-left .ym-account-nav,
  #column-right .ym-account-nav {
    border-radius: 14px;
    border: 1px solid #f0e2e5;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
  }

  .ym-account-nav .list-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #3d3236;
    border: 0;
    border-bottom: 1px solid #f8eff0;
    transition: all 0.2s ease;
  }

  .ym-account-nav .list-group-item:last-child {
    border-bottom: 0;
  }

  .ym-account-nav .list-group-item .ym-nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .ym-account-nav .list-group-item .ym-nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .ym-account-nav .list-group-item .ym-nav-text {
    flex-grow: 1;
  }

  .ym-account-nav .list-group-item > .fa-angle-right {
    font-size: 14px;
    color: #ccaeb4;
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .ym-account-nav .list-group-item:hover:not(.active) {
    background: #fff5f7;
    color: #c94a64;
    padding-left: 22px;
  }

  .ym-account-nav .list-group-item:hover:not(.active) > .fa-angle-right {
    color: #c94a64;
    transform: translateX(3px);
  }

  .ym-account-nav .list-group-item.active {
    background: #c94a64;
    color: #fff;
  }

  .ym-account-nav .list-group-item.active .ym-nav-text,
  .ym-account-nav .list-group-item.active > .fa-angle-right {
    color: #fff;
  }

  .ym-account-nav .list-group-item.ym-nav-logout {
    margin-top: 6px;
    border-top: 1px dashed #eedce0;
    color: #8c797e;
  }

  .ym-account-nav .list-group-item.ym-nav-logout:hover {
    color: #c94a64;
    background: #fff5f7;
  }
}

/* =========================================================================
   7. 現代化一體式會員中心儀表板 (Executive Member Dashboard 2026)
   ========================================================================= */

/* --- 7.1 會員問候標頭卡 (Member Hero Card) --- */
.ym-member-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, #fff9fa 0%, #fff 60%, #fff4f6 100%);
  border: 1px solid #f2d9de;
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(201, 74, 100, 0.06);
}

.ym-member-hero__left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ym-member-hero__avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c94a64 0%, #e06d84 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(201, 74, 100, 0.28);
  flex-shrink: 0;
}

.ym-member-hero__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ym-member-hero__greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ym-member-hero__greeting h1 {
  font-size: 22px;
  font-weight: 800;
  color: #2b2225;
  margin: 0;
  line-height: 1.3;
}

.ym-member-badge {
  display: inline-flex;
  align-items: center;
  background: #c94a64;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(201, 74, 100, 0.2);
}

.ym-member-hero__meta {
  margin: 0;
  font-size: 13px;
  color: #6d5b61;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ym-meta-separator {
  color: #d1b8be;
}

.ym-member-hero__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ym-btn--sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ym-btn--outline {
  background: #fff;
  border: 1px solid #e5b9c2;
  color: #c94a64;
}

.ym-btn--outline:hover {
  background: #fff2f4;
  border-color: #c94a64;
  color: #ab344c;
  text-decoration: none;
}

.ym-btn--subtle {
  background: #f7f1f2;
  border: 1px solid transparent;
  color: #7d6b70;
}

.ym-btn--subtle:hover {
  background: #eee5e7;
  color: #332b2d;
  text-decoration: none;
}

/* --- 7.2 四大核心指標卡 (Stats Overview) --- */
.ym-member-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.ym-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #f0e2e5;
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.ym-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(201, 74, 100, 0.12);
  border-color: #e5a4b1;
  text-decoration: none;
  color: inherit;
}

.ym-stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff5f7;
}

.ym-stat-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ym-stat-card__content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.ym-stat-card__label {
  font-size: 13px;
  color: #7d6b70;
  font-weight: 600;
}

.ym-stat-card__value {
  font-size: 20px;
  font-weight: 800;
  color: #2b2225;
  line-height: 1.2;
  margin-top: 2px;
}

.ym-stat-card__value small {
  font-size: 13px;
  font-weight: 600;
  color: #8c797e;
}

.ym-stat-card__arrow {
  color: #d1b8be;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.ym-stat-card:hover .ym-stat-card__arrow {
  transform: translateX(3px);
  color: #c94a64;
}

/* --- 7.3 最近訂單追蹤區塊 (Recent Orders Widget) --- */
.ym-member-section {
  background: #fff;
  border: 1px solid #f0e2e5;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 28px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.ym-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f5eaec;
  flex-wrap: wrap;
  gap: 10px;
}

.ym-section-header__title h2 {
  font-size: 18px;
  font-weight: 800;
  color: #2b2225;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ym-section-icon {
  vertical-align: middle;
}

.ym-section-header__title p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #8c797e;
}

.ym-section-header__more {
  font-size: 13px;
  font-weight: 700;
  color: #c94a64;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.ym-section-header__more:hover {
  color: #9e2a42;
  text-decoration: none;
}

.ym-orders-table {
  margin-bottom: 0;
}

.ym-orders-table th {
  background: #fdf8f9;
  color: #5c494f;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid #f2e1e4;
  padding: 12px 14px;
}

.ym-orders-table td {
  padding: 14px;
  vertical-align: middle;
  font-size: 14px;
  border-top: 1px solid #f7eff0;
}

.ym-order-col-id strong {
  color: #2b2225;
  font-weight: 800;
}

.ym-order-col-total strong {
  color: #c94a64;
  font-size: 15px;
  font-weight: 800;
}

.ym-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.ym-badge--pending {
  background: #fef5e6;
  color: #b56c00;
  border: 1px solid #fbe3b7;
}

.ym-badge--shipping {
  background: #e8f4fe;
  color: #0b72b9;
  border: 1px solid #cce5fd;
}

.ym-badge--completed {
  background: #eafaf1;
  color: #1e824c;
  border: 1px solid #c7eed8;
}

.ym-badge--canceled {
  background: #f2f3f5;
  color: #68717a;
  border: 1px solid #e1e4e8;
}

.ym-btn--secondary {
  background: #fdf2f4;
  border: 1px solid #f5cfd7;
  color: #c94a64;
  font-weight: 700;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.ym-btn--secondary:hover {
  background: #c94a64;
  color: #fff;
  border-color: #c94a64;
  text-decoration: none;
}

/* 手機版訂單列表（預設隱藏，手機螢幕下顯示） */
.ym-orders-mobile-list {
  display: none;
}

.ym-order-m-card {
  border: 1px solid #f0e2e5;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.ym-order-m-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #f7eff0;
  margin-bottom: 10px;
}

.ym-order-m-card__id span {
  font-size: 11px;
  color: #8c797e;
  display: block;
}

.ym-order-m-card__id strong {
  font-size: 15px;
  color: #2b2225;
  font-weight: 800;
}

.ym-order-m-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ym-order-m-card__row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6d5b61;
}

.ym-order-m-card__row--total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #f5eaec;
  font-weight: 700;
}

.ym-order-m-card__price {
  color: #c94a64;
  font-size: 16px;
  font-weight: 800;
}

.ym-btn--block {
  display: block;
  width: 100%;
  text-align: center;
}

/* 空狀態 */
.ym-empty-state {
  text-align: center;
  padding: 40px 20px;
}

.ym-empty-state__icon {
  margin-bottom: 16px;
  opacity: 0.85;
}

.ym-empty-state h3 {
  font-size: 17px;
  font-weight: 800;
  color: #2b2225;
  margin: 0 0 6px;
}

.ym-empty-state p {
  font-size: 13px;
  color: #8c797e;
  margin: 0 0 18px;
}

.ym-btn--primary {
  background: #c94a64;
  border: 1px solid #c94a64;
  color: #fff;
  padding: 9px 22px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(201, 74, 100, 0.24);
  transition: background 0.2s ease;
}

.ym-btn--primary:hover {
  background: #ab344c;
  color: #fff;
  text-decoration: none;
}

/* --- 7.4 核心功能服務專區 (Executive Services Grid) --- */
.ym-service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.ym-service-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #f2e4e7;
  border-radius: 14px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.ym-service-item:hover {
  border-color: #e5a4b1;
  background: #fffafb;
  box-shadow: 0 6px 18px rgba(201, 74, 100, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.ym-service-item__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(201, 74, 100, 0.06);
}

.ym-service-item__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ym-service-item__text {
  flex-grow: 1;
}

.ym-service-item__text h3 {
  font-size: 16px;
  font-weight: 800;
  color: #2b2225;
  margin: 0 0 4px;
}

.ym-service-item__text p {
  margin: 0;
  font-size: 12px;
  color: #8c797e;
  line-height: 1.45;
}

.ym-service-item__arrow {
  color: #d1b8be;
  font-size: 18px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.ym-service-item:hover .ym-service-item__arrow {
  transform: translateX(4px);
  color: #c94a64;
}

/* --- 7.5 響應式斷點與手機適配 --- */
@media (max-width: 991px) {
  .ym-member-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .ym-member-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 16px;
  }
  
  .ym-member-hero__actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .ym-member-hero__actions .ym-btn {
    flex: 1;
    justify-content: center;
  }

  .ym-member-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .ym-stat-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .ym-stat-card__icon {
    width: 40px;
    height: 40px;
  }

  .ym-stat-card__value {
    font-size: 17px;
  }

  /* 手機版隱藏桌面表格，顯示卡片列表 */
  .ym-orders-table-wrapper {
    display: none;
  }

  .ym-orders-mobile-list {
    display: block;
  }

  .ym-service-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ym-service-item {
    padding: 14px 16px;
  }
}

/* =========================================================================
   8. 會員子頁面標題列精簡、詢價單與訂單明細頁現代化重構 (2026)
   ========================================================================= */

/* --- 8.1 覆寫各子頁面臃腫的粉紅大看板標題列 --- */
.ym-account-content > h1.ym-account-title,
.ym-account-title {
  margin: 0 0 16px 0 !important;
  padding: 0 0 12px 0 !important;
  background: none !important;
  border: none !important;
  border-bottom: 2px solid #f2e3e6 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #322529 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  line-height: 1.3 !important;
}

.ym-account-content > h1.ym-account-title:after,
.ym-account-title:after {
  display: none !important;
}

.ym-account-dashboard-title {
  display: none !important;
}

/* 現代化子頁面精簡頂部導航列 (全會員中心統一規範) */
.ym-order-header-bar,
.ym-account-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 16px 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #f2e3e6;
}

.ym-order-header-bar__main,
.ym-account-header-bar__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ym-order-header-title,
.ym-account-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #2c2326;
  line-height: 1.25;
}

.ym-order-header-title img,
.ym-account-header-title img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.ym-order-header-id,
.ym-account-header-id {
  color: #c94a64;
  font-weight: 900;
}

.ym-order-header-meta,
.ym-account-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #7d6b71;
}

.ym-order-header-bar__actions,
.ym-account-header-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- 8.2 空狀態精緻卡片 (Empty State Card) --- */
.ym-account-empty-card {
  background: #fff;
  border: 1px solid #f2e3e6;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
}

.ym-empty-icon {
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(201, 74, 100, 0.15));
}

.ym-empty-title {
  font-size: 18px;
  font-weight: 800;
  color: #382d31;
  margin: 0 0 8px;
}

.ym-empty-desc {
  font-size: 14px;
  color: #8c7a80;
  max-width: 440px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.ym-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* --- 8.3 待付款/重新付款醒目提示區 (Repay Banner) --- */
.ym-order-repay-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, #fff3f5 0%, #ffe9ee 100%);
  border: 1.5px solid #f7b5c3;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(201, 74, 100, 0.1);
}

.ym-order-repay-banner__content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 260px;
}

.ym-order-repay-banner__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ym-order-repay-banner__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ym-order-repay-banner__text h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #a32b45;
}

.ym-order-repay-banner__text p {
  margin: 0;
  font-size: 13px;
  color: #63474f;
  line-height: 1.5;
}

.ym-order-repay-banner__btn .ym-btn--lg {
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 800;
  color: #fff !important;
  background: #c94a64 !important;
  border-color: #c94a64 !important;
  box-shadow: 0 4px 14px rgba(201, 74, 100, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ym-order-repay-banner__btn .ym-btn--lg:hover {
  background: #b33953 !important;
  border-color: #b33953 !important;
  color: #fff !important;
}

/* --- 8.4 訂單配送與付款雙欄資訊卡 (Cards Grid) --- */
.ym-order-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.ym-order-info-box {
  background: #fff;
  border: 1px solid #f2e3e6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.ym-order-info-box__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #faf2f4;
  border-bottom: 1px solid #f2e1e4;
  font-size: 14px;
  font-weight: 800;
  color: #4a363c;
}

.ym-order-info-box__header i {
  color: #c94a64;
}

.ym-order-info-box__header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.ym-order-info-box__body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ym-info-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.ym-info-label {
  width: 72px;
  flex-shrink: 0;
  color: #8c797e;
  font-weight: 600;
}

.ym-info-val {
  color: #2b2225;
  font-weight: 700;
  flex: 1;
}

/* --- 8.5 訂購商品明細卡 (Order Products Card) --- */
.ym-order-products-card {
  background: #fff;
  border: 1px solid #f2e3e6;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.ym-order-products-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: #faf2f4;
  border-bottom: 1px solid #f2e1e4;
}

.ym-order-products-card__header i {
  color: #c94a64;
}

.ym-order-products-card__header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #4a363c;
}

.ym-order-table-desktop {
  display: block;
}

.ym-detail-table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

.ym-detail-table thead th {
  background: #fdf8f9;
  border-bottom: 1px solid #f2e3e6 !important;
  color: #7a6369;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 16px;
}

.ym-detail-table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f9f0f2;
}

.ym-prod-img-cell {
  width: 74px;
  padding-right: 0 !important;
}

.ym-prod-thumb {
  border-radius: 8px;
  border: 1px solid #f0e2e5;
  object-fit: cover;
}

.ym-prod-name-cell {
  padding-left: 12px !important;
}

.ym-prod-title-link,
.ym-prod-title {
  font-size: 14px;
  font-weight: 700;
  color: #33262a;
  text-decoration: none;
  line-height: 1.4;
  display: block;
}

.ym-prod-title-link:hover {
  color: #c94a64;
}

.ym-prod-model {
  font-size: 12px;
  color: #8c7b80;
  margin-top: 3px;
}

.ym-qty-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #f7eef0;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #4d3a3f;
}

.ym-prod-price-cell {
  font-size: 14px;
  color: #634f55;
}

.ym-prod-total-cell {
  font-size: 15px;
  font-weight: 800;
  color: #c94a64;
}

.ym-order-products-mobile {
  display: none;
}

/* 費用結算卡片 */
.ym-order-totals-wrapper {
  display: flex;
  justify-content: flex-end;
  padding: 18px;
  background: #fdf8f9;
  border-top: 1px solid #f4e7e9;
}

.ym-order-totals-card {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ym-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #69565b;
}

.ym-total-row--final {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1.5px solid #ebd5d9;
  font-size: 18px;
  font-weight: 900;
  color: #c94a64;
}

.ym-total-row--final .ym-total-val {
  font-size: 20px;
}

/* --- 8.6 訂單進度歷程 (Timeline) --- */
.ym-order-history-card {
  background: #fff;
  border: 1px solid #f2e3e6;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.ym-order-history-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #faf2f4;
  border-bottom: 1px solid #f2e1e4;
  font-size: 14px;
  font-weight: 800;
  color: #4a363c;
}

.ym-order-history-card__header i {
  color: #c94a64;
}

.ym-order-history-card__header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.ym-order-history-card__body {
  padding: 18px 22px;
}

.ym-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 20px;
}

.ym-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 5px;
  width: 2px;
  background: #f0dfe2;
}

.ym-timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
}

.ym-timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c94a64;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #f2d2d8;
}

.ym-timeline-content {
  flex: 1;
}

.ym-timeline-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ym-timeline-status {
  font-size: 14px;
  font-weight: 800;
  color: #38282d;
}

.ym-timeline-date {
  font-size: 12px;
  color: #9c898f;
}

.ym-timeline-comment {
  margin-top: 4px;
  font-size: 13px;
  color: #69565b;
}

/* 底部操作按鈕列 */
.ym-order-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

/* --- 手機版自適應優化 --- */
@media (max-width: 767px) {
  .ym-order-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ym-order-table-desktop {
    display: none;
  }

  .ym-order-products-mobile {
    display: flex;
    flex-direction: column;
    divide-y: 1px solid #f9f0f2;
  }

  .ym-prod-m-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f9eff1;
  }

  .ym-prod-m-item:last-child {
    border-bottom: 0;
  }

  .ym-prod-m-item__thumb img {
    border-radius: 8px;
    border: 1px solid #f0e2e5;
    object-fit: cover;
  }

  .ym-prod-m-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .ym-prod-m-title {
    font-size: 13px;
    font-weight: 700;
    color: #33262a;
    line-height: 1.4;
    text-decoration: none;
  }

  .ym-prod-m-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #7a6369;
    margin-top: 4px;
  }

  .ym-prod-m-total {
    font-size: 15px;
    font-weight: 800;
    color: #c94a64;
  }

  .ym-order-totals-card {
    width: 100%;
  }

  .ym-order-repay-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .ym-order-repay-banner__btn .ym-btn {
    width: 100%;
    justify-content: center;
    background: #c94a64 !important;
    color: #fff !important;
  }

  .ym-order-footer-actions {
    flex-direction: column-reverse;
  }

  .ym-order-footer-actions .ym-btn {
    width: 100%;
    justify-content: center;
  }

  .ym-order-footer-actions .ym-btn--primary {
    background: #c94a64 !important;
    color: #fff !important;
  }
}

/* 歷史訂單與首頁訂單列表操作按鈕群組 */
.ym-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ym-tracking-code {
  font-family: Consolas, Monaco, "Courier New", monospace;
  background: #fdf0f3;
  border: 1px solid #f2cfd6;
  color: #a32b45;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.ym-info-row--tracking {
  align-items: center;
}

.ym-account-actions .ym-btn {
  white-space: nowrap;
}

/* 浮動 Toast 提示通知 */
.ym-toast-notification {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(-25px);
  z-index: 999999;
  background: rgba(43, 35, 38, 0.96);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 14px 26px;
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 92vw;
}

.ym-toast-notification.ym-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ym-toast-notification code {
  background: rgba(255, 255, 255, 0.22);
  color: #ffb8c7;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 14px;
  margin: 0 3px;
  font-family: Consolas, Monaco, monospace;
}

/* 複製單號按鈕 */
.ym-tracking-val-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ym-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #c94a64;
  background: #fff;
  border: 1px solid #f2cfd6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.ym-btn-copy:hover {
  background: #fdf0f3;
  border-color: #c94a64;
}

.ym-btn-copy--done {
  background: #2e7d32 !important;
  color: #fff !important;
  border-color: #2e7d32 !important;
}

/* 17TRACK 快捷直接帶入單號連結 */
.ym-tracking-actions-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.ym-link-direct-track {
  font-size: 12px;
  font-weight: 700;
  color: #0288d1;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  transition: color 0.2s ease;
}

.ym-link-direct-track:hover {
  color: #01579b;
}



