/**
 * 下单流程页适配层（v2.1.8）
 * ------------------------------------------------------------
 * 作用域：购物车 /cart/、结算 /checkout/、我的账户 /my-account/ 三页。
 * 入队条件：inc/enqueue.php 里由 cy_woo_is_order_flow_page() 守着（只有这三页）。
 *
 * 为什么是独立文件，不是并进 woo.css：
 *   woo.css 只在 cy_woo_is_product_page()（只认 is_product()）时入队。
 *   购物车 / 结算 / 我的账户都不是 is_product()，写进 woo.css 永远不会加载 ——
 *   不是「难看」，是「一个像素都不生效」，而且零报错。
 *   反过来把 woo.css 的入队条件放宽也不行：那样商品详情那 30 多 KB
 *   会落到商店所有页面上，而且 product-card-buy-test 的 I6/I7 会红。
 *
 * 为什么是独立文件，不是 theme.json：
 *   站点已有大量区块内容，theme.json 会一次性改动**全站**区块的编辑器与前台样式，
 *   范围不可控；本版只想影响这三页，所以用「按页入队的一份普通 CSS」。
 *
 * 本文件只做**配色 / 圆角 / 间距 / 边框**四件事，不重写布局：
 *   禁止出现 display / grid-template / flex-basis / width 百分比这类布局尺寸声明 ——
 *   列数、栅格、侧栏分栏全部交给 WooCommerce 区块自己管，改了会在窄屏塌。
 *   唯一的 display 例外：订单摘要 totals 区的空「折扣」「费用」占位区块
 *   （discount-block / fee-block，:empty 时）整体 display:none —— Woo 会给
 *   完全为空的容器画 白底+边框+20px 内边距 的占位卡片，这是「空占位隐藏」，
 *   不是「布局改写」。测试套件只豁免这两条 :empty 规则，别处出现 display: 照样红。
 *   也不重新声明 font-family / font-size 的级数，字体继承主题；
 *   只声明字重、颜色、行高这类不参与排版骨架的属性。
 *
 * 变量来源：style.css 的 :root（--cy-primary 等）。换配色方案时
 * inc/enqueue.php 的 cy_output_color_css() 会内联覆盖变量值，
 * 本文件不需要跟着改 —— 这是「用变量而不是硬编码色值」的收益。
 */

/* ============================================================
   A. 区块购物车（.wc-block-cart 系列）
   ============================================================ */

/* 整页容器：只加左右呼吸位，不动它自己的栅格。
   区块自带 padding 在窄屏下是 0，宽屏下是 var(--wp--style--root--padding-*)，
   这里统一补一档，避免内容贴屏幕边。 */
.wc-block-cart {
    color: var(--cy-text);
    padding-top: 8px;
    padding-bottom: 8px;
}

/* 购物车表格：去掉区块默认的灰底，改成白卡片 + 主题边框。
   ⚠️ 这里必须 !important：WooCommerce 的 cart.css 里
   `.wc-block-cart-items { border-collapse: separate; }` 与
   `.wc-block-cart-items td { border-top: 0 }` 同时存在，且
   区块用内联 `style="border-color: ..."` 写到每行上 ——
   不加 !important 时边框颜色会跟着它自己的调色板走（WP 默认 #000000）。 */
.wc-block-cart-items {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: var(--cy-radius);
    overflow: hidden;
}

.wc-block-cart-items td {
    border-color: var(--cy-border) !important;   /* 同上，压过区块内联边框色 */
}

/* 单个商品行：只调垂直间距，不动列宽/列数 */
.wc-block-cart-item {
    padding-top: 16px;
    padding-bottom: 16px;
}

.wc-block-cart-item:not(:last-child) {
    border-bottom: 1px solid var(--cy-border);
}

/* 商品名 / 小计：用主题正文色与主色，不用区块默认的 #000000 */
.wc-block-cart-item .wc-block-components-product-name {
    color: var(--cy-text);
    font-weight: 600;
}

.wc-block-cart-item .wc-block-components-product-price,
.wc-block-cart-item .wc-block-components-product-price ins {
    color: var(--cy-primary);
    font-weight: 700;
    text-decoration: none;
}

.wc-block-cart-item .wc-block-components-product-price del {
    color: var(--cy-text-muted);
    font-weight: 400;
}

/* 数量选择器：区块默认是「无边框 + 浅灰底」，和主题输入框不是一个语言。
   改成白底 + 主题细边框 + 小一档圆角（10px，比卡片的 14px 紧一档）。 */
.wc-block-components-quantity-selector {
    border: 1px solid var(--cy-border);
    border-radius: 10px;
    background: #fff;
    padding: 2px 4px;
}

.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
    color: var(--cy-text);
    /* 数字本身不参与排版骨架，但等宽数字能防「1 → 10」时按钮跳动 */
    font-variant-numeric: tabular-nums;
}

.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
    color: var(--cy-text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
}

.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover {
    color: var(--cy-primary);
    background: var(--cy-bg-soft);
}

.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* 总计行：分隔线用主题边框色，金额用主色。
   v2.2.27 竖向收窄（用户截图反馈「竖向收窄！」）：上下 padding 10px → 5px，
   真机实测每行 42px → 32px，小计/统一费率/合计三行连合计区省约 36px，
   仍留 5px 呼吸感、不致拥挤。 */
.wc-block-components-totals-item {
    color: var(--cy-text);
    padding-top: 5px;
    padding-bottom: 5px;
}

.wc-block-components-totals-item__label {
    color: var(--cy-text-muted);
}

.wc-block-components-totals-item__value {
    color: var(--cy-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 页脚总计（合计）：整页最强的那个数字，用主题主色 + 加粗。
   v2.2.27 竖向收窄：padding-top 16px → 10px，与上面 totals 行同步收紧。 */
.wc-block-components-totals-footer-item {
    border-top: 1px solid var(--cy-border);
    padding-top: 10px;
    margin-top: 4px;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    color: var(--cy-text);
    font-weight: 700;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    color: var(--cy-primary);
    font-variant-numeric: tabular-nums;
}

/* 侧栏布局（购物车里是「商品列表 + 结算摘要」两栏）：
   只给两栏之间的间隙，不碰 grid-template —— 分栏比是区块算的，
   写死会在「摘要被折叠到下面」的窄屏断点上塌掉。 */
.wc-block-components-sidebar-layout {
    margin-top: 8px;
}

/* 摘要侧栏：做成主题卡片，白底 + 边框 + 14px 圆角 + 主题投影 */
.wc-block-components-sidebar-layout .wc-block-components-totals-wrapper,
.wc-block-components-sidebar-layout .wc-block-cart__submit-container {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: var(--cy-radius);
    padding: 20px;
    box-shadow: var(--cy-shadow);
}

/* 提示条（「已加入购物车」「优惠券已应用」等）：
   ⚠️ !important 是必须的：WooCommerce 的 notice-banner 样式表用
   `.wc-block-components-notice-banner.is-info { background-color: #f7f7f7 !important }`
   把底色写死了，且优先级带 is-info 类，不加 !important 改不动。 */
.wc-block-components-notice-banner {
    border-radius: 10px;
    font-size: inherit;
}

.wc-block-components-notice-banner.is-info {
    background-color: var(--cy-bg-soft) !important;   /* 压过区块写死的 #f7f7f7 */
    border-color: var(--cy-border) !important;
    color: var(--cy-text) !important;
}

.wc-block-components-notice-banner.is-success {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #14532d !important;
}

.wc-block-components-notice-banner.is-error {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

/* ============================================================
   B. 区块结账（.wc-block-checkout 系列）
   ============================================================ */

.wc-block-checkout {
    color: var(--cy-text);
}

/* 分区标题（「配送地址」「付款方式」） */
.wc-block-checkout .wc-block-components-title {
    color: var(--cy-text);
    font-weight: 700;
}

.wc-block-checkout .wc-block-components-checkout-step__description {
    color: var(--cy-text-muted);
}

/* 文本输入框：主题统一的输入框语言 —— 1px 主题边框 + 10px 圆角，
   focus 时主色描边 + 3px 淡主色光环。区块默认只有一条下划线或方块边框。 */
.wc-block-components-text-input input,
.wc-block-components-text-input textarea,
.wc-block-components-text-input select {
    border: 1px solid var(--cy-border);
    border-radius: 10px;
    background: #fff;
    color: var(--cy-text);
    padding: 10px 12px;
}

.wc-block-components-text-input input:focus,
.wc-block-components-text-input textarea:focus,
.wc-block-components-text-input select:focus {
    border-color: var(--cy-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: 0;
}

.wc-block-components-text-input label {
    color: var(--cy-text-muted);
}

/* 校验失败态：边框转红，光环同色系，和主题其它表单错误一致 */
.wc-block-components-text-input.has-error input,
.wc-block-components-text-input.has-error textarea,
.wc-block-components-text-input.has-error select {
    border-color: #dc2626;
}

.wc-block-components-text-input.has-error input:focus,
.wc-block-components-text-input.has-error textarea:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

/* 地址表单：只给字段之间的垂直节奏，不碰它的两列栅格 */
.wc-block-components-address-form {
    margin-top: 4px;
}

.wc-block-components-address-form .wc-block-components-text-input {
    margin-bottom: 14px;
}

/* 单选（配送方式 / 支付方式）：卡片化，选中态用主色描边 */
.wc-block-components-radio-control .wc-block-components-radio-control__option {
    border: 1px solid var(--cy-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
}

.wc-block-components-radio-control .wc-block-components-radio-control__option-checked {
    border-color: var(--cy-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.wc-block-components-radio-control .wc-block-components-radio-control__label {
    color: var(--cy-text);
    font-weight: 600;
    /* radio 圆圈 absolute 定位在 left:16px（宽 20px，占 16~36px），
       而 option 的 padding-left 只有 14px，文字会与圆圈重叠被遮挡。
       加 30px 左边距把文字推到圆圈右侧（14+30=44px > 36px）。 */
    padding-left: 30px;
}

.wc-block-components-radio-control .wc-block-components-radio-control__description {
    color: var(--cy-text-muted);
    padding-left: 30px;
}

/* 复选框（条款同意 / 新闻订阅）：勾选色跟主题主色走 */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
    border: 1px solid var(--cy-border);
    border-radius: 4px;
    background: #fff;
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
    background: var(--cy-primary);
    border-color: var(--cy-primary);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.wc-block-components-checkbox .wc-block-components-checkbox__label {
    color: var(--cy-text-muted);
}

/* 订单摘要（右侧那一栏）：主题卡片 */
.wc-block-components-order-summary {
    border: 1px solid var(--cy-border);
    border-radius: var(--cy-radius);
    background: #fff;
    padding: 16px;
    box-shadow: var(--cy-shadow);
}

.wc-block-components-order-summary-item {
    padding-top: 12px;
    padding-bottom: 12px;
}

.wc-block-components-order-summary-item:not(:last-child) {
    border-bottom: 1px solid var(--cy-border);
}

.wc-block-components-order-summary-item__total-price {
    color: var(--cy-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wc-block-components-order-summary .wc-block-components-product-name {
    color: var(--cy-text);
    font-weight: 600;
}

/* 订单摘要 totals 区：空的「折扣」「费用」区块不渲染占位卡片
   Woo Blocks 的 checkout-order-summary-totals 区块把「折扣」「费用」固定渲染为
   两个占位容器；购物车没有折扣/费用时容器**完全为空**（真机实测 kids=0、
   innerHTML=''），但 Woo 自带样式给了它们 白底 + 1px 边框 + 20px 内边距 ——
   于是「小计」和「统一费率」之间多出两张 42px 的空白卡片。
   容器一旦有真内容（用了优惠券/有手续费），:empty 自然不匹配，正常显示。
   特异度：.class:empty = 0,2,0 > Woo 自带的 .class = 0,1,0，无需 !important。
   ⚠️ 别改成给这两个容器减 padding 或减高度 —— 空容器问题要整体隐藏，
   留一个没边框的矮条同样难看。 */
.wp-block-woocommerce-checkout-order-summary-discount-block:empty,
.wp-block-woocommerce-checkout-order-summary-fee-block:empty {
    display: none;
}

/* 结账「下单」主按钮与购物车「去结算」主按钮共用一套：
   这是本文件里唯一动按钮的地方，所以单独写一组，避免两处各写一份走偏。
   .wc-block-components-button 是区块自己的按钮基类。 */
.wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button) {
    background: var(--cy-primary);
    color: #fff;
    border: 1px solid var(--cy-primary);
    border-radius: var(--cy-radius);
    font-weight: 600;
    padding: 12px 22px;
}

.wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button):hover {
    background: var(--cy-primary-dark);
    border-color: var(--cy-primary-dark);
    color: #fff;
}

.wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button):focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

/* 次要动作（「继续购物」「使用优惠码」这类 link 样式按钮）：
   不给底色，只给主色文字 + hover 下划线，拉开与主按钮的层级 */
.wc-block-components-button.is-link {
    color: var(--cy-primary);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 10px;
}

.wc-block-components-button.is-link:hover {
    color: var(--cy-primary-dark);
    background: var(--cy-bg-soft);
}

/* 框内链接（条款、隐私政策）统一主题主色，避免出现 WP 默认蓝 #3858e9 */
.wc-block-checkout a:not(.wc-block-components-button):not(.components-button),
.wc-block-cart a:not(.wc-block-components-button):not(.components-button) {
    color: var(--cy-primary);
}

.wc-block-checkout a:not(.wc-block-components-button):not(.components-button):hover,
.wc-block-cart a:not(.wc-block-components-button):not(.components-button):hover {
    color: var(--cy-primary-dark);
}

/* ============================================================
   C. 经典账户页（.woocommerce-account 系列）
   ------------------------------------------------------------
   我的账户 /my-account/ 用的是 WooCommerce 经典模板，不是区块：
   登录/注册表单是 .woocommerce-form-login / .woocommerce-form-register，
   登录后左侧是 .woocommerce-MyAccount-navigation（竖排菜单），
   右侧是 .woocommerce-MyAccount-content。
   ============================================================ */

/* 登录前的两栏（登录 / 注册）：区块是 50% + 50%，只给两栏之间的间隙。
   不写 grid-template-columns —— 窄屏断点由 WooCommerce 自己切成单栏。 */
.woocommerce-account .u-columns {
    margin-top: 8px;
}

.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
    padding: 0 12px;
}

/* 登录 / 注册表单：白卡片 */
.woocommerce-form-login,
.woocommerce-form-register {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: var(--cy-radius);
    padding: 24px;
    box-shadow: var(--cy-shadow);
}

.woocommerce-form-login .form-row,
.woocommerce-form-register .form-row {
    padding: 0;
    margin-bottom: 16px;
}

/* 经典模板的字段行 */
.woocommerce-form-row {
    margin-bottom: 16px;
}

.woocommerce-form-row label {
    color: var(--cy-text);
    font-weight: 600;
    margin-bottom: 6px;
}

/* 经典模板的输入框：与区块结账的输入框保持同一套语言
   （1px 主题边框、10px 圆角、focus 主色描边 + 3px 光环） */
.woocommerce-Input,
.woocommerce-account input[type="text"],
.woocommerce-account input[type="email"],
.woocommerce-account input[type="password"],
.woocommerce-account input[type="tel"],
.woocommerce-account input[type="number"],
.woocommerce-account textarea,
.woocommerce-account select {
    border: 1px solid var(--cy-border);
    border-radius: 10px;
    background: #fff;
    color: var(--cy-text);
    padding: 10px 12px;
}

.woocommerce-Input:focus,
.woocommerce-account input[type="text"]:focus,
.woocommerce-account input[type="email"]:focus,
.woocommerce-account input[type="password"]:focus,
.woocommerce-account input[type="tel"]:focus,
.woocommerce-account input[type="number"]:focus,
.woocommerce-account textarea:focus,
.woocommerce-account select:focus {
    border-color: var(--cy-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: 0;
}

/* 经典模板按钮（登录 / 注册 / 保存地址 / 提交）
   与区块主按钮同一套：主色底 + 14px 圆角 + 深色 hover */
.woocommerce-account .woocommerce-button,
.woocommerce-account button.button,
.woocommerce-account .button {
    background: var(--cy-primary);
    color: #fff;
    border: 1px solid var(--cy-primary);
    border-radius: var(--cy-radius);
    font-weight: 600;
    padding: 12px 22px;
}

.woocommerce-account .woocommerce-button:hover,
.woocommerce-account button.button:hover,
.woocommerce-account .button:hover {
    background: var(--cy-primary-dark);
    border-color: var(--cy-primary-dark);
    color: #fff;
}

.woocommerce-account .woocommerce-button:focus-visible,
.woocommerce-account button.button:focus-visible,
.woocommerce-account .button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

/* 左侧「我的账户」菜单：垂直导航卡片（圆角 + 阴影 + 悬停态 + 激活高亮）。
   前缀 .woocommerce-account 是为了和 WooCommerce general 里同名的账户菜单
   规则对齐权重；woo-pages.css 排在其后，同权重时靠层叠顺序覆盖它的
   ul 顶边线 / li 底边线 / 窄 padding。 */
.woocommerce-account .woocommerce-MyAccount-navigation {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
    margin-bottom: 6px;
    border-bottom: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li:last-child {
    margin-bottom: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
    color: var(--cy-text);
    border-radius: 12px;
    padding: 12px 14px;
    border-left: 3px solid transparent;
    font-weight: 500;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

/* 菜单图标：统一菱形标记（呼应工业精密制造调性），颜色随状态走 */
.woocommerce-account .woocommerce-MyAccount-navigation li a::before {
    content: "◆";
    margin-right: 10px;
    font-size: .8em;
    color: var(--cy-text-muted);
}

.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
    color: var(--cy-primary);
    background: var(--cy-bg-soft);
    border-left-color: var(--cy-primary);
}

.woocommerce-account .woocommerce-MyAccount-navigation li a:hover::before {
    color: var(--cy-primary);
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
    color: #fff;
    background: var(--cy-primary);
    border-left-color: var(--cy-primary);
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a::before {
    color: #fff;
}

/* 右侧内容区：白卡片，与左侧菜单同一套圆角 / 阴影语言 */
.woocommerce-account .woocommerce-MyAccount-content {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
    color: var(--cy-text);
}

.woocommerce-account .woocommerce-MyAccount-content p {
    color: var(--cy-text);
}

.woocommerce-account .woocommerce-MyAccount-content a {
    color: var(--cy-primary);
    text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-content a:hover {
    color: var(--cy-primary-dark);
}

/* 仪表盘问候头：WooCommerce 经典模板里「您好 X」问候语是
   .woocommerce-MyAccount-content 的**第一个直接子 <p>**，说明段是第二个，
   其后才是 do_action 注入的订单 / 下载摘要（没有独立 wrapper）。
   但「首 p」这个位置在订单 / 地址 / 下载 / 支付方式等端点都可能被插件注入
   一个 <p>，裸用 > p:first-child 会被误套成大号问候块，所以这里用
   :has(.woocommerce-MyAccount-navigation-link--dashboard.is-active)
   锚定「左侧导航里 dashboard 处于激活态」这一仪表盘独有状态，只在这时才放大。
   :has() 不被支持的旧浏览器会整条丢弃，问候头退化成普通正文（安全，不误伤）。 */
.woocommerce-account:has(.woocommerce-MyAccount-navigation-link--dashboard.is-active) .woocommerce-MyAccount-content > p:first-child {
    background: rgba(37, 99, 235, .04);
    border-left: 4px solid var(--cy-primary);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 14px;
    color: var(--cy-text);
    font-size: 1.45em;
    font-weight: 800;
    line-height: 1.4;
}

.woocommerce-account:has(.woocommerce-MyAccount-navigation-link--dashboard.is-active) .woocommerce-MyAccount-content > p:first-child strong {
    color: var(--cy-primary);
}

.woocommerce-account:has(.woocommerce-MyAccount-navigation-link--dashboard.is-active) .woocommerce-MyAccount-content > p:nth-child(2) {
    color: var(--cy-text-muted);
    max-width: 620px;
    margin-bottom: 16px;
}

/* 窄屏（≤768px）：WooCommerce 的 smallscreen 样式被主题摘掉，浮动分栏
   不会自动折行，这里手动取消浮动、改全宽，让菜单与内容区竖排。 */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce-MyAccount-navigation,
    .woocommerce-account .woocommerce-MyAccount-content {
        float: none;
        width: 100%;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        margin-bottom: 16px;
    }

    .woocommerce-account:has(.woocommerce-MyAccount-navigation-link--dashboard.is-active) .woocommerce-MyAccount-content > p:first-child {
        font-size: 1.25em;
        padding: 12px 14px;
    }
}

/* 账户表格（订单列表）：表头浅底、行分隔用主题边框色 */
.woocommerce-MyAccount-content .woocommerce-orders-table th {
    background: var(--cy-bg-soft);
    color: var(--cy-text-muted);
    font-weight: 600;
}

.woocommerce-MyAccount-content .woocommerce-orders-table td,
.woocommerce-MyAccount-content .woocommerce-orders-table th {
    border-color: var(--cy-border);
    padding: 12px 10px;
}

/* ============================================================
   订单列表表格美化（/my-account/orders/）
   ------------------------------------------------------------
   把 WooCommerce 默认「后台报表式」订单表改成科技感卡片表格：
   - 铺满内容区、去默认外框、表头浅底、行分隔用主题边框色
   - 状态列彩色胶囊（已完成绿 / 处理中蓝 / 保留橙 / 待付款黄）
   - 查看按钮主色胶囊
   - 订单号品牌色加粗、日期次要灰、合计右对齐加粗
   ============================================================ */

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table {
    width: 100%;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table thead th {
    background: var(--cy-bg-soft);
    color: var(--cy-text-muted);
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--cy-border);
}

/* 普通单元格：加大内边距 + 行分隔 + 垂直居中（不写 color，继承内容区深色） */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table tbody td {
    padding: 15px 14px;
    border: 0;
    border-bottom: 1px solid var(--cy-border);
    vertical-align: middle;
}

/* 订单号那格模板里是 <th scope=row>，要覆盖上面「th 表头」的浅底/灰字样式 */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table tbody th {
    padding: 15px 14px;
    border: 0;
    border-bottom: 1px solid var(--cy-border);
    vertical-align: middle;
    background: transparent;
    color: var(--cy-text);
    font-weight: 400;
}

/* 订单号：品牌色加粗 */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-number a {
    color: var(--cy-primary);
    font-weight: 700;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-number a:hover {
    color: var(--cy-primary-dark);
}

/* 日期：次要灰、不换行 */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-date {
    color: var(--cy-text-muted);
    white-space: nowrap;
}

/* 合计：表头与单元格右对齐、加粗、等宽数字 */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-total {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table thead th.woocommerce-orders-table__header-order-total,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table thead th.woocommerce-orders-table__header-order-actions {
    text-align: right;
}

/* 状态徽章：彩色胶囊（按行上的状态类名着色，白字） */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-status {
    width: 1%;
    text-align: center;
    white-space: nowrap;
    border-radius: 999px;
    font-size: .8em;
    font-weight: 700;
    color: #fff;
    background: #94a3b8;
}

/* 胶囊形态：额外横向 padding + 去掉行分隔线（覆盖 tbody td 的 padding/border） */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table tbody td.woocommerce-orders-table__cell-order-status {
    padding: 8px 20px;
    border-bottom: 0;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table thead th.woocommerce-orders-table__header-order-status {
    text-align: center;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status {
    background: #16a34a;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__row--status-processing .woocommerce-orders-table__cell-order-status {
    background: #2563eb;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__row--status-on-hold .woocommerce-orders-table__cell-order-status {
    background: #f59e0b;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__row--status-pending .woocommerce-orders-table__cell-order-status {
    background: #d97706;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status {
    background: #dc2626;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__row--status-refunded .woocommerce-orders-table__cell-order-status {
    background: #64748b;
}

/* 查看按钮：主色胶囊，去掉 Woo 默认朴素样式 */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-actions {
    text-align: right;
    white-space: nowrap;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-actions .button {
    background: var(--cy-primary);
    color: #fff;
    border: 1px solid var(--cy-primary);
    border-radius: 999px;
    padding: 7px 18px;
    font-size: .88em;
    font-weight: 600;
    line-height: 1.4;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-actions .button:hover {
    background: var(--cy-primary-dark);
    border-color: var(--cy-primary-dark);
    color: #fff;
}

/* 窄屏（≤768px）：收内边距、日期允许换行、按钮收窄，防表格溢出 */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table thead th,
    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table tbody th,
    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table tbody td {
        padding: 10px 8px;
    }

    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-date {
        white-space: normal;
    }

    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-actions .button {
        padding: 6px 12px;
        font-size: .82em;
    }
}

/* 「忘记密码？」：弱化成次要链接，不要和主按钮抢注意力 */
.woocommerce-LostPassword {
    margin-top: 8px;
}

.woocommerce-LostPassword a {
    color: var(--cy-text-muted);
    font-weight: 400;
}

.woocommerce-LostPassword a:hover {
    color: var(--cy-primary);
}

/* 所有金额（经典模板用 .amount 包一层）：等宽数字 + 主色 */
.woocommerce-account .amount,
.woocommerce-account .woocommerce-Price-amount {
    color: var(--cy-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* 提示条（「用户名或密码错误」等）：走 WooCommerce 自己的 is-error / is-success
   语义类，只换配色，不改它的图标与排版 */
.woocommerce-account .woocommerce-error,
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info,
.wc-block-cart .woocommerce-error,
.wc-block-cart .woocommerce-message,
.wc-block-checkout .woocommerce-error,
.wc-block-checkout .woocommerce-message {
    border-radius: 10px;
    border-top: 0;
    border-left: 3px solid currentColor;
    background: var(--cy-bg-soft);
    color: var(--cy-text);
}

.woocommerce-account .woocommerce-error,
.wc-block-cart .woocommerce-error,
.wc-block-checkout .woocommerce-error {
    color: #991b1b;
    background: #fef2f2;
}

.woocommerce-account .woocommerce-message,
.wc-block-cart .woocommerce-message,
.wc-block-checkout .woocommerce-message {
    color: #14532d;
    background: #f0fdf4;
}

/* ============================================================
   科技感登录 / 注册卡片（未登录态，v2.2.x）
   ------------------------------------------------------------
   只圈定未登录的双栏容器 .u-columns 与其内部的
   .woocommerce-form-login / .woocommerce-form-register，把这块做成
   深蓝渐变 + 青蓝光斑的「科技感」卡片，呼应工业精密制造调性。
   ⚠️ 作用域刻意不放宽到 .woocommerce-account 全局：已登录的
   .woocommerce-MyAccount-navigation / 订单表 / 地址表仍走上面的浅色样式，
   避免把仪表盘也染成深色。
   ⚠️ 光斑不额外用伪元素绝对定位：本文件受测试约束不得出现 position /
   display 声明（不改区块层叠关系），改为在容器背景里叠加一层
   radial-gradient，视觉等效于右上角一块青蓝光晕。
   ============================================================ */
.woocommerce-account .u-columns {
    background:
        radial-gradient(circle at 86% 6%, rgba(56, 189, 248, .20) 0%, rgba(56, 189, 248, 0) 58%),
        linear-gradient(160deg, #0b1220 0%, #14264b 55%, #1e3a8a 100%);
    border-radius: 20px;
    padding: 32px 24px;
}

/* 双栏内部的登录 / 注册表单不再用白卡片：透明，让容器的渐变透出来 */
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* 标题「登录 / 注册」：亮白 + 渐变色下划线强调 */
.woocommerce-account .woocommerce-form-login h2,
.woocommerce-account .woocommerce-form-register h2 {
    color: #e2e8f0;
    font-size: 1.45em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%) left bottom / 56px 3px no-repeat;
}

/* 字段标签：浅灰蓝，清晰又不抢标题 */
.woocommerce-account .woocommerce-form-login label,
.woocommerce-account .woocommerce-form-register label {
    color: #cbd5e1;
    font-weight: 600;
}

/* 输入框：半透明白底 + 淡描边，深色底上清晰可见 */
.woocommerce-account .woocommerce-form-login input[type="text"],
.woocommerce-account .woocommerce-form-login input[type="email"],
.woocommerce-account .woocommerce-form-login input[type="password"],
.woocommerce-account .woocommerce-form-login input[type="tel"],
.woocommerce-account .woocommerce-form-register input[type="text"],
.woocommerce-account .woocommerce-form-register input[type="email"],
.woocommerce-account .woocommerce-form-register input[type="password"],
.woocommerce-account .woocommerce-form-register input[type="tel"] {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    color: #e2e8f0;
    padding: 10px 12px;
}

.woocommerce-account .woocommerce-form-login input::placeholder,
.woocommerce-account .woocommerce-form-register input::placeholder {
    color: #64748b;
    opacity: 1;
}

.woocommerce-account .woocommerce-form-login input[type="text"]:focus,
.woocommerce-account .woocommerce-form-login input[type="email"]:focus,
.woocommerce-account .woocommerce-form-login input[type="password"]:focus,
.woocommerce-account .woocommerce-form-login input[type="tel"]:focus,
.woocommerce-account .woocommerce-form-register input[type="text"]:focus,
.woocommerce-account .woocommerce-form-register input[type="email"]:focus,
.woocommerce-account .woocommerce-form-register input[type="password"]:focus,
.woocommerce-account .woocommerce-form-register input[type="tel"]:focus {
    border-color: #38bdf8;
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
    outline: 0;
}

/* 浏览器自动填充会把深色输入框刷成黄 / 白，这里把填充底色压回深色 */
.woocommerce-account .woocommerce-form-login input:-webkit-autofill,
.woocommerce-account .woocommerce-form-register input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #14264b inset;
    -webkit-text-fill-color: #e2e8f0;
    caret-color: #e2e8f0;
}

/* 勾选框：主色对勾 */
.woocommerce-account .woocommerce-form-login input[type="checkbox"],
.woocommerce-account .woocommerce-form-register input[type="checkbox"] {
    accent-color: #38bdf8;
}

/* 提交按钮：蓝色渐变，hover 上浮 + 光晕 */
.woocommerce-account .woocommerce-form-login .woocommerce-button,
.woocommerce-account .woocommerce-form-login button.button,
.woocommerce-account .woocommerce-form-register .woocommerce-button,
.woocommerce-account .woocommerce-form-register button.button {
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-weight: 600;
    padding: 12px 24px;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}

.woocommerce-account .woocommerce-form-login .woocommerce-button:hover,
.woocommerce-account .woocommerce-form-login button.button:hover,
.woocommerce-account .woocommerce-form-register .woocommerce-button:hover,
.woocommerce-account .woocommerce-form-register button.button:hover {
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
    color: #fff;
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, .35);
}

.woocommerce-account .woocommerce-form-login .woocommerce-button:focus-visible,
.woocommerce-account .woocommerce-form-login button.button:focus-visible,
.woocommerce-account .woocommerce-form-register .woocommerce-button:focus-visible,
.woocommerce-account .woocommerce-form-register button.button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .35);
}

/* 表单内链接（忘记密码、隐私政策等）：亮青 + hover 下划线 */
.woocommerce-account .woocommerce-form-login a,
.woocommerce-account .woocommerce-form-register a {
    color: #38bdf8;
}

.woocommerce-account .woocommerce-form-login a:hover,
.woocommerce-account .woocommerce-form-register a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* 说明文字与勾选标签：柔和灰蓝 */
.woocommerce-account .woocommerce-form-login .woocommerce-form__label-for-checkbox,
.woocommerce-account .woocommerce-form-register .woocommerce-form__label-for-checkbox,
.woocommerce-account .woocommerce-form-register .woocommerce-privacy-policy-text {
    color: #94a3b8;
}

/* 窄屏（≤768px）：双栏由 WooCommerce 自己切成单栏，这里只收内边距 */
@media (max-width: 768px) {
    .woocommerce-account .u-columns {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .woocommerce-account .u-columns .u-column1,
    .woocommerce-account .u-columns .u-column2 {
        padding: 0;
    }

    .woocommerce-account .woocommerce-form-login h2,
    .woocommerce-account .woocommerce-form-register h2 {
        font-size: 1.3em;
    }
}

/* ============================================================
   D. 跨三页的收尾
   ============================================================ */

/* 空购物车 / 空订单摘要的说明文字，别用默认纯黑 */
.wc-block-cart__empty-cart-wrapper p,
.wc-block-components-order-summary__empty {
    color: var(--cy-text-muted);
}

/* 数量框与金额一律等宽数字：防止「1 件 → 10 件」时整行左右跳 */
.wc-block-cart .wc-block-components-product-price,
.wc-block-components-totals-item__value,
.wc-block-components-order-summary-item__total-price {
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   E. 窄屏（≤640px）
   ------------------------------------------------------------
   只收紧间距。
   不动列数、不动 grid-template、不动 flex-basis —— 窄屏要不要把
   摘要折到商品列表下面，是 WooCommerce 区块自己按容器宽度算的，
   这里插手必然在某个断点上塌成一条竖线。
   ============================================================ */
@media (max-width: 640px) {
    .wc-block-cart {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .wc-block-cart-item {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .wc-block-components-sidebar-layout .wc-block-components-totals-wrapper,
    .wc-block-components-sidebar-layout .wc-block-cart__submit-container {
        padding: 14px;
    }

    .wc-block-components-order-summary {
        padding: 12px;
    }

    /* 主按钮在窄屏占满一行更好点（区块本身也是这么做的，这里只是把
       padding 收紧，避免 12px+22px 的padding 在 320px 宽屏上把文字挤两行） */
    .wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button) {
        padding: 11px 16px;
    }

    .wc-block-checkout .wc-block-components-checkout-step {
        padding-bottom: 12px;
    }

    .wc-block-components-address-form .wc-block-components-text-input {
        margin-bottom: 10px;
    }

    .wc-block-components-radio-control .wc-block-components-radio-control__option {
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .woocommerce-form-login,
    .woocommerce-form-register,
    .woocommerce-MyAccount-content {
        padding: 16px;
    }

    .woocommerce-account .u-column1,
    .woocommerce-account .u-column2 {
        padding: 0 8px;
    }

    .woocommerce-MyAccount-navigation {
        padding: 6px;
        margin-bottom: 12px;
    }

    .woocommerce-MyAccount-navigation li a {
        padding: 9px 10px;
    }

    .woocommerce-MyAccount-content .woocommerce-orders-table td,
    .woocommerce-MyAccount-content .woocommerce-orders-table th {
        padding: 10px 6px;
    }
}

/* ============================================================
   F. 订单接收页（order-received / thank you）
   ------------------------------------------------------------
   下单成功后的 /checkout/order-received/{id}/ 页，把 WooCommerce
   默认「一张平铺大表」拆成三块卡片，延续登录/注册的科技感调性：
   ① 订单概览（订单号/日期/邮箱/金额/付款方式）→ 深蓝品牌色卡片
   ② 商品明细（含小计/配送/总计）→ 白卡片
   ③ 客户地址（账单/配送）→ 白卡片
   「展开」用「分块卡片 + 清晰分区」的视觉语言达成，不引入折叠逻辑。
   ============================================================ */

/* 内容区铺满整行：page.php 的 .cy-article 为文章可读性限宽 860px，
   所有 WooCommerce「页面型」页面（账户/结账/购物车/订单接收）内容也被套在里面，
   导致订单详情表格、账户表单只占内容区约一半（宽屏下更像 1/3 + 右侧留白）。
   用 :has(.woocommerce) 放宽所有含 WooCommerce wrapper 的页面（.woocommerce 是
   WooCommerce 的统一内容 wrapper，.woocommerce-order / .woocommerce-account 都在它内部），
   不影响普通文章页的窄栏排版。 */
.cy-article:has(.woocommerce) {
    max-width: none;
}

/* 多列对齐：数量列居中、单价/小计列右对齐，与 tfoot 金额对齐、拉开标签间距。
   四列布局（商品/数量/单价/小计）由 woocommerce/order/order-details*.php 模板覆盖实现。 */
table.woocommerce-table--order-details thead th.product-quantity,
table.woocommerce-table--order-details tbody td.product-quantity {
    text-align: center;
}

table.woocommerce-table--order-details thead th.product-price,
table.woocommerce-table--order-details tbody td.product-price,
table.woocommerce-table--order-details thead th.product-total,
table.woocommerce-table--order-details tbody td.product-total {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 数量/单价/小计列不折行，保持金额一行显示（商品名列允许换行） */
table.woocommerce-table--order-details tbody td.product-quantity,
table.woocommerce-table--order-details tbody td.product-price,
table.woocommerce-table--order-details tbody td.product-total {
    white-space: nowrap;
}

/* 下单成功提示：默认是 Woo 的绿色 notice，这里换成品牌蓝横幅 */
.woocommerce-order p.woocommerce-thankyou-order-received {
    background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(6, 182, 212, .08));
    border: 1px solid rgba(37, 99, 235, .16);
    border-left: 4px solid var(--cy-primary);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 20px;
    color: var(--cy-text);
    font-size: 1.1em;
    font-weight: 700;
}

/* ① 订单概览：深蓝渐变卡片，标签浅灰、数值亮青、总计放大 */
ul.woocommerce-order-overview {
    background: linear-gradient(160deg, #0b1220 0%, #14264b 55%, #1e3a8a 100%);
    border: 0;
    border-radius: 16px;
    padding: 22px 8px;
    margin: 0 0 24px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);

    /* v2.2.26：经典回执页（本站点实际走的就是这套 DOM）同样不许静默裁剪 ——
       横排放不下时横向滚动，而不是把溢出的项切掉。 */
    overflow-x: auto;
}

ul.woocommerce-order-overview li {
    color: #94a3b8;
    font-size: .8em;
    text-transform: none;
    border-right: 1px solid rgba(255, 255, 255, .14);
    padding: 4px 16px;
    text-align: center;
    box-sizing: border-box;

    /* v2.2.26：长邮箱/长订单号不撑破格子 —— 允许在任意位置断行，
       这样容器 scrollWidth 不会超过 clientWidth（不需要横向滚动就能看全）。 */
    overflow-wrap: anywhere;
}

ul.woocommerce-order-overview li:last-child {
    border-right: 0;
}

/* v2.2.26：窄屏两列换行 / 极窄一列铺满（与上面 Block 确认条同一套判据，
   两套 DOM 只会出现其中一套，但两边都不能裁）。Woo 的 li 是 float + margin-right，
   这里把 margin 归零，否则 50% + margin 又溢出。 */
@media (max-width: 900px) {
    /* ⚠️ width / margin-right 必须 !important：WooCommerce 自己的
       `.woocommerce ul.order_details li`（特异度 0,2,2）带着 margin-right: 2em，
       比 `ul.woocommerce-order-overview li`（0,1,2）高一级。留着那个外边距时
       50% + 22.88px 塞不进一行，结果还是「一项一行」，等于没换行。 */
    ul.woocommerce-order-overview li {
        float: left;
        width: 50% !important;
        margin-right: 0 !important;
        padding: 10px 12px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .14);
    }
}
@media (max-width: 480px) {
    ul.woocommerce-order-overview li {
        float: none;
        width: 100% !important;
        margin-right: 0 !important;
        text-align: left;
    }
    ul.woocommerce-order-overview li:last-child {
        border-bottom: 0;
    }
}

ul.woocommerce-order-overview li strong {
    color: #38bdf8;
    font-size: 1.5em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

ul.woocommerce-order-overview li.woocommerce-order-overview__total strong {
    color: #7dd3fc;
    font-size: 1.7em;
    font-weight: 800;
}

/* ② 商品明细：白卡片 + 圆角 + 柔和阴影 */
section.woocommerce-order-details {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}

section.woocommerce-order-details .woocommerce-order-details__title {
    color: var(--cy-text);
    font-size: 1.25em;
    font-weight: 800;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cy-bg-soft);
}

/* v2.2.26：明细表的横向滚动容器（由 woocommerce/order/order-details.php 输出）。
   四列在窄屏必然超出，靠这层容器滑，而不是把表格压成不可读的两行一列。
   桌面端装得下 → 无滚动条、零变化。 */
.cy-order-details-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.woocommerce-table--order-details {
    /* v2.2.27：必须显式还原成真正的表格布局。
       main.css 的 .cy-prose table 设了 display:block（本意是让多列表格在窄屏内部滚动），
       但 <table> 一旦变成 block：外框仍跟着 width:100% 撑满，**内部的列却收缩到内容宽度**，
       桌面端就出现「表格右边一大片空白」——实测订单 2029：表格宽 1090px、
       列内容最右只到 477px、右侧空白 708px（用户截图反馈的那个现象）。
       改回 display:table 后列自动铺满：同一订单空白 708px → 1px。
       窄屏横向滚动由外层 .cy-order-details-scroll 负责，不依赖这条规则，
       所以这里改回 table 不会丢 scroll 能力。
       特异性与 .cy-prose table 相同（0,1,1），靠本文件晚于 main.css 加载取胜，勿删。 */
    display: table;
    width: 100%;
    border: 0;
    border-collapse: collapse;
}

table.woocommerce-table--order-details thead th {
    background: var(--cy-bg-soft);
    color: var(--cy-text-muted);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border: 0;
}

table.woocommerce-table--order-details tbody td {
    padding: 12px;
    border: 0;
    border-top: 1px solid var(--cy-border);
    color: var(--cy-text);
    vertical-align: top;
}

table.woocommerce-table--order-details tbody td.product-name a {
    color: var(--cy-primary);
    font-weight: 600;
}

table.woocommerce-table--order-details tbody td.product-name a:hover {
    color: var(--cy-primary-dark);
}

table.woocommerce-table--order-details tfoot th,
table.woocommerce-table--order-details tfoot td {
    padding: 12px;
    border: 0;
    border-top: 1px solid var(--cy-border);
    color: var(--cy-text);
}

table.woocommerce-table--order-details tfoot th {
    text-align: left;
    color: var(--cy-text-muted);
    font-weight: 600;
}

table.woocommerce-table--order-details tfoot td {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 总计行：品牌蓝强调。注意 tfoot 最后一行是「付款方式」（payment_method），
   「总计」（order_total）是倒数第二行，用 :nth-last-child(2) 精确定位，避免把
   蓝色强调误套到「付款方式」行导致边框/底色错乱。 */
table.woocommerce-table--order-details tfoot tr:nth-last-child(2) th,
table.woocommerce-table--order-details tfoot tr:nth-last-child(2) td {
    background: rgba(37, 99, 235, .05);
    border-top: 2px solid var(--cy-primary);
    color: var(--cy-primary);
    font-size: 1.15em;
    font-weight: 800;
}

/* ③ 客户地址：白卡片，地址块用浅底 */
section.woocommerce-customer-details {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}

section.woocommerce-customer-details .woocommerce-column__title {
    color: var(--cy-text);
    font-size: 1.05em;
    font-weight: 700;
    margin: 0 0 10px;
}

section.woocommerce-customer-details address {
    background: var(--cy-bg-soft);
    border: 1px solid var(--cy-border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--cy-text-muted);
    font-style: normal;
    line-height: 1.8;
    margin-bottom: 14px;
}

section.woocommerce-customer-details address p {
    color: var(--cy-text-muted);
    margin: 2px 0;
}

/* 窄屏（≤768px）：概览折两列、地址双栏改单列、卡片收内边距 */
@media (max-width: 768px) {
    ul.woocommerce-order-overview {
        flex-wrap: wrap;
        padding: 14px 6px;
    }

    ul.woocommerce-order-overview li {
        flex: 1 1 45%;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .14);
        padding: 10px 12px;
    }

    ul.woocommerce-order-overview li:last-child {
        border-bottom: 0;
    }

    section.woocommerce-order-details,
    section.woocommerce-customer-details {
        padding: 16px;
    }

    section.woocommerce-customer-details .woocommerce-column {
        float: none;
        width: 100%;
    }

    table.woocommerce-table--order-details thead th,
    table.woocommerce-table--order-details tbody td,
    table.woocommerce-table--order-details tfoot th,
    table.woocommerce-table--order-details tfoot td {
        padding: 10px 8px;
    }

    /* 四列布局窄屏：商品名列允许折行，金额/数量列仍不折行（避免挤爆一行） */
    table.woocommerce-table--order-details tbody td.product-name {
        word-break: break-word;
    }
}

/* ============================================================
   G. 订单接收页 Block 版（order-confirmation）
   ------------------------------------------------------------
   站点实际用 WooCommerce Block Checkout，下单成功页是 Block 的
   order-confirmation 渲染（不是经典 thankyou.php，F 段选择器落空）。
   本段按 Block 真实类名（wc-block-order-confirmation-*）做「平铺」美化，
   延续深蓝科技感调性。
   ============================================================ */

/* 容器铺满内容区宽度（别被 alignwide / 窄列挤成一条） */
.wp-block-woocommerce-order-confirmation {
    max-width: 100%;
    width: 100%;
}

/* 下单成功状态：品牌蓝横幅 */
.wc-block-order-confirmation-status {
    background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(6, 182, 212, .08));
    border: 1px solid rgba(37, 99, 235, .16);
    border-left: 4px solid var(--cy-primary);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 20px;
}
.wc-block-order-confirmation-status p {
    color: var(--cy-text);
    font-weight: 700;
    margin: 0 0 4px;
}

/* 订单概览：深蓝渐变卡片，横排平铺，青色数值，总计放大 */
.wc-block-order-confirmation-summary {
    background: linear-gradient(160deg, #0b1220 0%, #14264b 55%, #1e3a8a 100%);
    border-radius: 16px;
    padding: 22px 8px;
    margin: 0 0 24px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);

    /* v2.2.26：原来是 overflow: hidden —— 它只为了把浮动的 5 项圈进圆角里，
       副作用是「放不下的第 5 项被一刀切掉，且不可滚动」（用户反馈的
       「账单明细一直存在没法展开」）。圆角由 border-radius 自己管，不需要裁剪；
       这里改成横向可滚动：装得下就没有滚动条，装不下时手指能滑出来看，
       不再静默吞内容。⚠️ 别改回 hidden —— 那等于把内容藏起来还说页面没问题。 */
    overflow-x: auto;
}
.wc-block-order-confirmation-summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
    flex-direction: row;
}
.wc-block-order-confirmation-summary-list-item {
    float: left;
    width: 20%;
    text-align: center;
    padding: 4px 16px;
    border-right: 1px solid rgba(255, 255, 255, .14);

    /* v2.2.26：width:20% + 左右各 16px padding 在 content-box 下会撑出容器
       （5 × (20% + 32px) > 100%），多出来的那部分正是被裁掉的第 5 项。
       border-box 让 padding 算进 20% 里，五项正好铺满一行。 */
    box-sizing: border-box;

    /* 长邮箱 / 长订单号允许任意位置断行，容器就不会横向溢出（无需滚动即看全） */
    overflow-wrap: anywhere;
}
.wc-block-order-confirmation-summary-list-item:last-child {
    border-right: 0;
}

/* v2.2.26：窄屏不再五等分 —— 20% 在 500px 宽下每项只有 ~90px，
   「电子邮件：xxx@yyy.com」这类长值会被挤断、换行，配合原来的裁剪就是
   「明细一直展开不了」。≤900px 两列换行，≤480px 一列铺满，内容完整可见。
   （本文件原则上不写布局尺寸，这里不写就退不出 Woo 自己那套 20% 浮动等分。） */
@media (max-width: 900px) {
    .wc-block-order-confirmation-summary-list-item {
        width: 50%;
        padding: 10px 12px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .14);
    }
}
@media (max-width: 480px) {
    .wc-block-order-confirmation-summary-list-item {
        float: none;
        width: 100%;
        text-align: left;
    }
    .wc-block-order-confirmation-summary-list-item:last-child {
        border-bottom: 0;
    }
}
.wc-block-order-confirmation-summary-list-item__key {
    color: #94a3b8;
    font-size: .8em;
}
.wc-block-order-confirmation-summary-list-item__value {
    color: #38bdf8;
    font-size: 1.2em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
/* 标签在上、数值在下（纯 CSS 换行，不用 display:block） */
.wc-block-order-confirmation-summary-list-item__value::before {
    content: "\A";
    white-space: pre;
}
/* 第 3 项固定是总计（Order# / Date / Total 恒为前三），放大 */
.wc-block-order-confirmation-summary-list-item:nth-child(3) .wc-block-order-confirmation-summary-list-item__value {
    color: #7dd3fc;
    font-size: 1.4em;
    font-weight: 800;
}

/* 商品明细：白卡片铺满 */
.wc-block-order-confirmation-totals-wrapper {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}
.wc-block-order-confirmation-totals-wrapper h2 {
    color: var(--cy-text);
    font-size: 1.25em;
    font-weight: 800;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cy-bg-soft);
}
.wc-block-order-confirmation-totals__table {
    width: 100%;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
}
.wc-block-order-confirmation-totals__table thead th {
    background: var(--cy-bg-soft);
    color: var(--cy-text-muted);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--cy-border);
}
.wc-block-order-confirmation-totals__table tbody td {
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--cy-border);
    color: var(--cy-text);
    vertical-align: top;
}
.wc-block-order-confirmation-totals__table tbody td.wc-block-order-confirmation-totals__product a {
    color: var(--cy-primary);
    font-weight: 600;
}
.wc-block-order-confirmation-totals__table tfoot th,
.wc-block-order-confirmation-totals__table tfoot td {
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--cy-border);
    color: var(--cy-text);
}
.wc-block-order-confirmation-totals__table tfoot th {
    text-align: left;
    color: var(--cy-text-muted);
    font-weight: 600;
}
.wc-block-order-confirmation-totals__table tfoot td {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
/* 总计行（tfoot 最后一行）品牌蓝高亮 */
.wc-block-order-confirmation-totals__table tfoot tr:last-child th,
.wc-block-order-confirmation-totals__table tfoot tr:last-child td {
    background: rgba(37, 99, 235, .05);
    border-top: 2px solid var(--cy-primary);
    border-bottom: 0;
    color: var(--cy-primary);
    font-size: 1.15em;
    font-weight: 800;
}

/* 订单备注 */
.wc-block-order-confirmation-order-note {
    background: var(--cy-bg-soft);
    border: 1px solid var(--cy-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 14px;
}
.wc-block-order-confirmation-order-note__label {
    color: var(--cy-text);
    font-weight: 700;
    margin: 0 0 4px;
}
.wc-block-order-confirmation-order-note p {
    color: var(--cy-text-muted);
    margin: 2px 0;
}

/* 客户地址：白卡片平铺 */
.wc-block-order-confirmation-billing-wrapper,
.wc-block-order-confirmation-shipping-wrapper {
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}
.wc-block-order-confirmation-billing-wrapper h2,
.wc-block-order-confirmation-shipping-wrapper h2 {
    color: var(--cy-text);
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cy-bg-soft);
}
.wc-block-order-confirmation-billing-address address,
.wc-block-order-confirmation-shipping-address address {
    background: var(--cy-bg-soft);
    border: 1px solid var(--cy-border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--cy-text-muted);
    font-style: normal;
    line-height: 1.8;
}
.wc-block-order-confirmation-billing-address p,
.wc-block-order-confirmation-shipping-address p {
    color: var(--cy-text-muted);
    margin: 2px 0;
}

/* 窄屏（≤768px）：概览折两列、卡片收内边距 */
@media (max-width: 768px) {
    .wc-block-order-confirmation-summary-list {
        flex-wrap: wrap;
    }
    .wc-block-order-confirmation-summary-list-item {
        width: 50%;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .14);
        padding: 10px 12px;
    }
    .wc-block-order-confirmation-summary-list-item:last-child {
        border-bottom: 0;
    }

    .wc-block-order-confirmation-totals-wrapper,
    .wc-block-order-confirmation-billing-wrapper,
    .wc-block-order-confirmation-shipping-wrapper {
        padding: 16px;
    }

    .wc-block-order-confirmation-totals__table thead th,
    .wc-block-order-confirmation-totals__table tbody td,
    .wc-block-order-confirmation-totals__table tfoot th,
    .wc-block-order-confirmation-totals__table tfoot td {
        padding: 10px 8px;
    }
}
