/**
 * components.css — 全局组件样式
 *
 * 这个文件专门放可复用的 UI 组件样式：
 * 按钮、卡片、徽章、弹窗、表单控件等。
 * 页面级/布局级样式请放到 style.css 或对应的区块 CSS。
 *
 * 约定：
 * - 组件类名用 yyj- 前缀，避免和 WP/插件冲突
 * - 每个组件用 /* === 组件名 === 注释分隔
 */

/* ============================================================
   示例模板（复制这段来写新组件）
   ============================================================
.yyj-你的组件 {
  // 你的样式
}
*/

/* === 按钮 === */

/* === 卡片 === */

/* === 徽章 === */

/* === 表单 === */

/* ── 登录 / 注册弹窗 ──────────────────────────── */
.auth-popup {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -50%) translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    max-height: 85vh;
    overflow-y: auto;
}
.auth-popup.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) translateY(0);
}

/* 选项卡 */
.yyj-auth-tabs {
    display: flex;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 20px;
}
.yyj-auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: var(--option-size);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #999;
    transition: color 0.2s, border-color 0.2s;
}
.yyj-auth-tab.is-active {
    color: var(--brandmaincolor);
    border-bottom-color: var(--brandmaincolor);
}

/* 面板 */
.yyj-auth-panel {
    display: none;
}
.yyj-auth-panel.is-active {
    display: block;
}

/* 表单字段 */
.yyj-auth-form .form-group {
    margin-bottom: 16px;
}
.yyj-auth-form label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--option-size);
    font-weight: 500;
    color: var(--headingfontcolorprimary, #333);
}
.yyj-auth-form input[type="email"],
.yyj-auth-form input[type="password"],
.yyj-auth-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: var(--option-size);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.yyj-auth-form input:focus {
    border-color: var(--brandmaincolor);
}
/* 隐藏 WC 自动注入的密码切换按钮（用我们自己的 .yyj-pw-toggle） */
.yyj-auth-form .show-password-input { display: none; }
.yyj-auth-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: var(--option-size);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
    cursor: pointer;
}
.yyj-auth-form select:focus {
    border-color: var(--brandmaincolor);
}

/* 提交按钮 */
.yyj-auth-submit {
    width: 100%;
    padding: 14px;
    background: var(--brandmaincolor);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: var(--option-size);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.yyj-auth-submit:hover {
    opacity: 0.9;
}
.yyj-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 消息提示 */
.yyj-auth-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: var(--option-size);
    display: none;
}
.yyj-auth-message.is-error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.yyj-auth-message.is-success {
    display: block;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* My Account 登录/注册页（对齐弹窗样式） */
.yyj-myaccount-auth .woocommerce-form-login,
.yyj-myaccount-auth .woocommerce-form-register {
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
}
.yyj-myaccount-auth .woocommerce-form-login .form-row,
.yyj-myaccount-auth .woocommerce-form-register .form-row {
    margin: 0;
}

/* 账户按钮 — 已改用 Tailwind（flex align-center justify-center pointer）+ 行内 */

/* === Drawer === */
.drawer.drawer--left{
left: 0;
    inset-inline-end: unset;
    transform: translate(-100%);
}
.drawer.is-active {
    visibility: visible;
    transform: translate(0) !important;
}
.drawer {
    position: fixed;
    top: 0;
    inset-inline-end: 0;
    z-index: 122;
    display: flex;
    visibility: hidden;
    max-width: 420px;
    height: 100%;
    margin: 0;
    width: 100%;
    background-color: var(--color-background-popup-drawer, #fff);
    transform: translate(100%);
    transition-property: transform, visibility, max-width;
    transition-duration: var(--timing-long);
    transition-timing-function: cubic-bezier(.165, .84, .44, 1);
    flex-direction: column;
    will-change: transform;
}
.drawer__body {
    overflow: auto;
    flex: 1;
    padding: 0 24px 24px;
}
.drawer__header {
    width: 100%;
}
#wpadminbar{
z-index: 80;}

/* ── 自定义选择器 — 仅状态样式（JS 用 data-* 找元素）── */
.selector-dropdown { display: none; flex-direction: column; }
.selector-dropdown.is-open { display: flex; }
.selector-option:hover { background: #f5f5f5; }
.selector-option.is-selected { color: var(--brandmaincolor); font-weight: 600; }
[data-selector-toggle].is-open { border-color: var(--brandmaincolor); }
[data-selector-toggle].is-open > span:last-child { transform: rotate(90deg); }
.zindex-drop { z-index: 210; }

/* ── Flatpickr 日历主题适配 ────────────────────── */
.flatpickr-calendar {
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
    font-size: var(--option-size) !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--brandmaincolor) !important;
    border-color: var(--brandmaincolor) !important;
}
.flatpickr-day:hover {
    background: #f5f5f5 !important;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-size: var(--option-size) !important;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    stroke: var(--brandmaincolor) !important;
}
.flatpickr-monthDropdown-months {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    padding: 4px 24px 4px 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    flex: 1 !important;
    width: auto !important;
}
.flatpickr-current-month {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}
.flatpickr-current-month input.cur-year {
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-weight: 600 !important;
    flex: 1 !important;
    width: auto !important;
}
.flatpickr-current-month .numInputWrapper span {
    display: none !important;
}
.flatpickr-current-month .numInputWrapper {
    flex: 1 !important;
}

/* ============================================================
   Popup 弹窗系统 + 购物车弹窗
   ============================================================ */

/* ── Popup overlay ── */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.popup-overlay.is-active {
    display: block;
    opacity: 1;
}

/* ── GDPR Cookie 偏好弹窗 ── */
#yoloGdprModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
}
#yoloGdprModal.is-active { display: flex; align-items: center; }

/* ── 购物车弹窗 ── */
.yolo-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    width: 480px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
}
.yolo-cart-drawer.is-active {
    transform: translateX(0);
}
.yolo-cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.yolo-cart-drawer-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.yolo-cart-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.yolo-cart-item:first-child { padding-top: 0; }
.yolo-cart-item-img {
    width: 72px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--imgmainbackground);
}
.yolo-cart-item-name {
    font-size: var(--14-16);
    font-weight: 600;
    line-height: 1.3;
}
.yolo-cart-item-meta {
    font-size: var(--12-14);
    color: #999;
}
.yolo-cart-item-price {
    font-size: var(--14-16);
    font-weight: 700;
    white-space: nowrap;
}
.yolo-cart-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.yolo-cart-tax-notice {
    padding: 8px 20px;
    margin: 0;
    font-size: var(--12-14);
    color: #999;
    text-align: center;
}
.yolo-cart-subtotal { padding-bottom: 12px; }
.yolo-cart-loading,
.yolo-cart-empty {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

/* ── 快捷购物弹窗（popup.js 驱动开关，quick-shop.js 驱动内容） ── */
.yolo-quick-shop-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(480px, 100vw);
    height: 100dvh;
    background: var(--backgroundcolor);
    z-index: 200;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.yolo-quick-shop-drawer.is-active {
    transform: translateX(0);
}
.yolo-quick-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: var(--backgroundcolor);
    z-index: 1;
    flex-shrink: 0;
}
.yolo-quick-shop-header .popup-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.yolo-quick-shop-body {
    padding: 16px 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-gutter: stable;
}
.yolo-quick-shop-footer {
    padding: 0 20px 20px;
    flex-shrink: 0;
}

/* popup.js 动态创建的遮罩层 */
.window-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.window-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ── 全站订阅弹窗 ─────────────────────────────── */
.yyj-subscribe-popup {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1001;
    width: 400px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    padding: 28px 24px 24px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.4,0,0.2,1);
    box-sizing: border-box;
}
.yyj-subscribe-popup.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.yyj-subscribe-popup--mobile {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
}
.yyj-subscribe-popup--mobile.is-active {
    transform: translateY(0);
}

.yyj-subscribe-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
    z-index: 2;
}
.yyj-subscribe-popup-close:hover { background: #e0e0e0; }

.yyj-subscribe-popup-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.yyj-subscribe-popup-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.yyj-subscribe-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
}

.yyj-subscribe-popup-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.yyj-subscribe-popup-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yyj-subscribe-popup-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.yyj-subscribe-popup-input:focus { border-color: var(--brandmaincolor, #1a56db); }

.yyj-subscribe-popup-btn {
    width: 100%;
    padding: 12px;
    background: var(--brandmaincolor, #1a56db);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.yyj-subscribe-popup-btn:hover { opacity: 0.9; }
.yyj-subscribe-popup-btn:disabled { opacity: 0.6; cursor: default; }

.yyj-subscribe-popup-decline {
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px;
}
.yyj-subscribe-popup-decline:hover { color: #666; }

.yyj-subscribe-popup-msg {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

/* ── 左下角触发器 ─────────────────────────────── */
.yyj-subscribe-trigger {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0;
}
.yyj-subscribe-trigger-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--brandmaincolor, #1a56db);
    color: #fff;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}
.yyj-subscribe-trigger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.yyj-subscribe-trigger-icon {
    font-size: 18px;
    line-height: 1;
}
.yyj-subscribe-trigger-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: color 0.2s;
}
.yyj-subscribe-trigger-close:hover { color: #333; }

/* 尺码对照表弹窗（产品页 + 快捷购物共用） */
.size-guide-popup {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.size-guide-popup.is-active {
    opacity: 1;
    pointer-events: auto;
}
.sp-size-chart-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--14-16);
}
.sp-size-chart-content th,
.sp-size-chart-content td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.sp-size-chart-content th {
    font-weight: 600;
    background: #f5f5f5;
}

/* ── 臂章选择器（与产品页 product-template.css 一致，全局可用）── */
.sp-badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    text-align: center;
}
.sp-badge-card:hover { border-color: #bbb; }
.sp-badge-card.is-active {
    border-color: var(--brandmaincolor);
    box-shadow: 0 0 0 1px var(--brandmaincolor);
}
.sp-badge-card-img-wrap {
    align-self: stretch;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--imgmainbackground);
    border-radius: 6px;
    overflow: hidden;
}
.sp-badge-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.sp-badge-card-empty {
    font-size: var(--12-14);
    color: #999;
}
.sp-badge-card-label {
    font-size: var(--12-14);
    color: var(--mainfont);
    line-height: 1.3;
}
.sp-badge-card-price {
    font-size: var(--12-14);
    color: var(--brandmaincolor);
    font-weight: 600;
}

/* iOS Safari：grid 直接父级是 flex 容器时，行轨道会被 align-content:stretch 拉满剩余高度，
   1-2 行臂章卡片会被拉到数量区/弹窗底部。移除 flex + 行轨道按内容收缩。 */
.sp-badge-section {
    display: block !important;
}
.sp-badge-section > .sp-size-label { margin-bottom: 8px; }  /* 补偿原 flex gap */
[data-js-badge-grid] {
    align-content: start;
    grid-auto-rows: min-content;
}

/* ── 球员选择器（与产品页 product-template.css 一致，全局可用）── */
.sp-player-trigger { border: 1px solid #ddd; background: #fff; font-size: var(--labelfont); color: var(--mainfont); transition: border-color .15s; }
.sp-player-list { background: #fff; }
.sp-player-trigger:hover { border-color: #bbb; }
.sp-player-trigger-chevron { transition: transform .2s; color: #999; }
.sp-player-picker.is-open .sp-player-trigger { border-color: var(--brandmaincolor); }
.sp-player-picker.is-open .sp-player-trigger-chevron { transform: rotate(90deg); }
.sp-player-dropdown { background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.sp-player-search { border: 1px solid #000; font-size: var(--labelfont); background: #fafafa; }
.sp-player-custom-btn { border: 1px solid #000; background: #eee; color: var(--mainfont); transition: background .15s, color .15s; }
.sp-player-custom-btn:hover { background: var(--brandmaincolor); color: #fff; }
.sp-player-custom-btn.is-custom { background: #eee; color: var(--mainfont); }
.sp-player-list-item { font-size: var(--labelfont); transition: background .1s; }
.sp-player-list-item:hover { background: #f5f5f5; }
.sp-player-list-item.is-active { background: var(--brandmaincolor); color: #fff; }
.sp-player-price-badge { margin-left: auto; font-size: var(--12-14); opacity: 0.7; white-space: nowrap; flex-shrink: 0; }
.sp-player-list-item.is-active .sp-player-price-badge { opacity: 1; }
.sp-player-trigger-text .sp-player-price-badge { opacity: 1; color: var(--brandmaincolor); }
.sp-player-list-item.is-hidden { display: none; }
/* my-team 花名册尺码选择器：字号与同列字段一致（仅 my-team 网格内生效，产品页 picker 不受影响） */
#yyj-roster-rows .sp-player-trigger,
#yyj-roster-rows .sp-player-list-item {
    font-size: var(--text-sm);
}
/* 箭头与缩小后的文字同步（yyj_icon SVG 固定 24px，用 CSS 覆盖尺寸） */
#yyj-roster-rows .sp-player-trigger-chevron svg {
    width: 14px;
    height: 14px;
}
.sp-player-num { font-weight: 700; }
/* my-games 记分板事件区：球员选择器字号收紧到 text-sm（与同列 input 一致）；产品页/花名册 picker 不受影响 */
#yyj-games-rows .sp-player-trigger,
#yyj-games-rows .sp-player-list-item,
#yyj-games-rows .sp-player-num {
    font-size: var(--text-sm);
}
/* 乌龙行标识 OG（国际惯例）：比 🥅 图直白；行内小号加粗品牌色，激活开关同样强化 */
#yyj-games-rows .sk-ev-icon.is-og {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--brandmaincolor);
}
#yyj-games-rows [data-own-toggle].is-own {
    font-weight: 700;
    color: var(--brandmaincolor);
}
/* my-games 计分板事件区镜像对齐：标签与添加按钮都朝中轴线相向（我方居右、对手居左）；手机单列全居中
   用 scoped CSS 而非编译的 sm:* 响应式工具类（构建未跑时它们是死类 → align-self 回退 stretch = 全宽按键） */
#yyj-games-rows .games-ev-col .games-ev-label { justify-content: flex-end; }
#yyj-games-rows .games-ev-col-opp .games-ev-label { justify-content: flex-start; }
#yyj-games-rows .games-ev-col .games-ev-hint { text-align: right; }
#yyj-games-rows .games-ev-col [data-add-ev] { align-self: flex-end; }
#yyj-games-rows .games-ev-col-opp [data-add-opp-ev] { align-self: flex-start; }
/* 中轴双线：桌面两列在中间拉两条竖线（我方列右缘 + 对手列左缘，框出中轴通道）；内容离线 12px；手机单列去掉 */
#yyj-games-rows .games-ev-col { border-right: 1px solid var(--color-line, #ddd); padding-right: 0.75rem; }
#yyj-games-rows .games-ev-col-opp { border-left: 1px solid var(--color-line, #ddd); padding-left: 0.75rem; }
@media (max-width: 639px) {
    #yyj-games-rows .games-ev-col .games-ev-label,
    #yyj-games-rows .games-ev-col-opp .games-ev-label { justify-content: center; }
    #yyj-games-rows .games-ev-col .games-ev-hint { text-align: center; }
    #yyj-games-rows .games-ev-col [data-add-ev],
    #yyj-games-rows .games-ev-col-opp [data-add-opp-ev] { align-self: center; }
    #yyj-games-rows .games-ev-col,
    #yyj-games-rows .games-ev-col-opp { border-right: 0; border-left: 0; padding-right: 0; padding-left: 0; }
}
/* 队徽头像加大：我方 crest + 对手 logo 圆 44px → 80px，首字母跟随放大（用 scoped CSS 避免依赖 w-20 等未编译工具类） */
#yyj-games-rows .games-crest { width: 5rem; height: 5rem; }
#yyj-games-rows .games-crest .games-crest-letter { font-size: 2.5rem; }
/* 比分输入：隐藏数字上下箭头，纯手动输入（保留 type=number 的手机数字键盘与 min=0 校验） */
#yyj-games-rows .games-score::-webkit-outer-spin-button,
#yyj-games-rows .games-score::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#yyj-games-rows .games-score {
    -moz-appearance: textfield;
    appearance: textfield;
}
/* 主客/中立 切换：胶囊按钮组替代下拉 select（active 品牌色高亮；hidden 值随表单提交） */
#yyj-games-rows .games-haway-opt {
    font-size: var(--text-sm);
    border: 1px solid var(--color-line, #ddd);
    border-radius: 0.5rem;
    background: #fff;
    color: var(--color-maintext, #000);
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
#yyj-games-rows .games-haway-opt:hover { border-color: var(--brandmaincolor); }
#yyj-games-rows .games-haway-opt.is-active {
    border-color: var(--brandmaincolor);
    background: var(--brandmaincolor);
    color: #fff;
}
/* 主客/中立 切换：手机单列时按钮组居中（flex-col 下容器全宽，内部按钮居中排） */
@media (max-width: 639px) {
    #yyj-games-rows .games-haway { justify-content: center; }
}
/* 箭头与缩小后的文字同步（yyj_icon SVG 固定 24px，用 CSS 覆盖尺寸） */
#yyj-games-rows .sp-player-trigger-chevron svg {
    width: 14px;
    height: 14px;
}
.sp-sku { font-size: var(--12-14); }
.sp-size-chip { border: 1px solid #ddd; background: #fff; font-size: var(--12-14); transition: all .15s; }
.sp-size-chip.is-active { border-color: var(--brandmaincolor); background: var(--brandmaincolor); color: #fff; }
.sp-custom-error { color: #e53e3e; font-size: var(--12-14); margin: 4px 0 0; }

/* ── 产品卡片加购按钮 hover ── */
.yolo-quick-add-btn:hover { background: var(--brandmaincolor); color: #fff; }
.yolo-quick-add-btn:hover .icon { color: #fff; }

/* ── 翻页器（分类页 / 订单列表 / 其他列表页共用）── */
.tax-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 6px;
    border-radius: 6px; font-size: 14px; font-weight: 500;
    color: var(--mainfont); text-decoration: none;
    transition: background .15s;
}
.tax-pagination .page-numbers:hover:not(.current):not(.dots) { background: #f1f3f5; }
.tax-pagination .page-numbers.current { background: var(--brandmaincolor); color: #fff; font-weight: 600; }
.tax-pagination .page-numbers.dots { color: #999; background: transparent; cursor: default; }

/* ── 按钮加载旋转动画 ── */
.sp-add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.yolo-btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: yolo-spin 0.8s linear infinite;
    flex-shrink: 0;
}
.yolo-btn-spinner .icon {
    display: block;
    width: 20px;
    height: 20px;
}
@keyframes yolo-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── 404 skip-link 高度 ── */
body.error404 #wp--skip-link--target { min-height: auto !important; }

/* ── 块结账：产品定制元数据竖排 ── */
.wc-block-components-product-metadata .wc-block-components-product-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--12-14);
    color: #999;
}
.wc-block-components-product-metadata .wc-block-components-product-details__name {
    font-weight: 500;
    color: #666;
}
/* 去掉块结账默认的 " / " 分隔符 */
.wc-block-components-product-metadata .wc-block-components-product-details > span > span[aria-hidden="true"] {
    display: none;
}

/* ── 块结账：桌面端侧边栏加宽 + 图片放大 ── */
@media (min-width: 1025px) {
    .wc-block-checkout.is-large {
        grid-template-columns: 1fr 440px !important;
    }
    .wc-block-components-sidebar-layout {
        grid-template-columns: 1fr 440px !important;
    }
    .wc-block-components-order-summary-item__image {
        width: 80px !important;
        min-width: 80px !important;
        flex-shrink: 0 !important;
    }
    .wc-block-components-order-summary-item__image img {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
        min-height: 80px !important;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 6px;
    }
}
/* 数量角标 → 主色 */
.wc-block-components-order-summary-item__quantity {
    background: var(--brandmaincolor) !important;
    color: #fff !important;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* ── 块结账：优惠券按钮主色 ── */
.wc-block-components-totals-coupon__button {
    background: var(--brandmaincolor) !important;
}

/* ── 块结账：按钮主色 ── */
.wc-block-components-checkout-place-order-button {
    background: var(--brandmaincolor) !important;
}
.wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:hover {
    opacity: 0.9;
}

/* ── 感谢页订单 6 列表格 ── */
/* 宽度约束同 main-content（覆盖 WP .is-layout-constrained > .alignwide） */
.is-layout-constrained > .wc-block-order-confirmation-totals-wrapper,
.is-layout-constrained > .wc-block-order-confirmation-totals {
    width: 1320px;
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
}
/* 隐藏默认样式，等 JS 加上 .yolo-order-table-6col 后再显示，防止 FOUC */
.wc-block-order-confirmation-totals__table:not(.yolo-order-table-6col) {
    visibility: hidden;
}

/* 滚动容器 — 手机端横向滑动表头+表体 */
.yolo-order-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* tfoot 空列宽度对应主表（Tailwind 无法按 nth-child 设 w-[xx%]） */
.yolo-order-tfoot-table .yolo-tfoot-spacer:nth-child(2) { width: 13%; }
.yolo-order-tfoot-table .yolo-tfoot-spacer:nth-child(3) { width: 13%; }
.yolo-order-tfoot-table .yolo-tfoot-spacer:nth-child(4) { width: 13%; }
.yolo-order-tfoot-table .yolo-tfoot-spacer:nth-child(5) { width: 8%; }
@media (max-width: 767px) {
    .yolo-tfoot-spacer {
        display: none;
    }
    .is-layout-constrained > .wc-block-order-confirmation-totals-wrapper,
    .is-layout-constrained > .wc-block-order-confirmation-totals {
        max-width: calc(100vw - 20px);
    }
}

/* ── 打印：自动适配 A4，隐藏页眉/页脚/下载按钮 ── */
@media print {
    .yolo-header, .yolo-footer, header, footer, .wp-block-template-part,
    .wc-block-order-confirmation-totals > div[style*="flex-end"] {
        display: none !important;
    }
    body, main, .main-content, .wp-block-group, * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    body, main, .main-content, .wp-block-group {
        width: auto !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }
    .yolo-order-scroll { overflow-x: visible !important; }
    .yolo-order-table-6col { font-size: 12px; }
    @page { size: A4 portrait; margin: 1cm; }
}

/* ── 感谢页「创建账户」区块 ── */
/* 外层：去掉默认灰底，改白底卡片 + 细边框 + 圆角 */
.wc-block-order-confirmation-create-account {
    width: 1320px;
    max-width: 90vw;
    margin-left: auto !important;
    margin-right: auto !important;
    background: var(--backgroundcolor) !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 32px 36px !important;
    gap: 24px;
    margin-top: 24px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
/* 标题：主字体色 + 加粗 + 标题字号 */
.wc-block-order-confirmation-create-account-content .wp-block-heading {
    font-size: var(--labelfont) !important;
    font-weight: 700 !important;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--mainfont);
    margin: 0 0 14px !important;
    text-wrap: balance;
}
/* 勾选列表：去默认项目符号，加品牌色对勾 */
.wc-block-order-confirmation-create-account-content ul.is-style-checkmark-list {
    list-style: none;
    padding-left: 0 !important;
    margin: 0;
}
.wc-block-order-confirmation-create-account-content ul.is-style-checkmark-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px !important;
    font-size: var(--14-16);
    line-height: 1.5;
    color: #333;
}
.wc-block-order-confirmation-create-account-content ul.is-style-checkmark-list li:last-child {
    margin-bottom: 0 !important;
}
.wc-block-order-confirmation-create-account-content ul.is-style-checkmark-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--brandmaincolor);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}
/* 按钮：主色 */
.wc-block-order-confirmation-create-account-button {
    background: var(--brandmaincolor) !important;
}
.wc-block-order-confirmation-create-account-button:hover {
    opacity: 0.9;
}
@media (max-width: 782px) {
    .wc-block-order-confirmation-create-account {
        max-width: calc(100vw - 24px);
        padding: 24px 20px !important;
        gap: 16px;
    }
}

/* === My Account 覆写 === */
.woocommerce-MyAccount { --wp--style--global--content-size: 100% !important; }
.yyj-myaccount-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}
.yyj-myaccount-nav a:hover {
    opacity: 0.85;
}
/* 用户横幅：16:6 比例，手机端改 16:9（更高一些） */
.yyj-profile-banner,
.yyj-cover-upload {
    aspect-ratio: 16 / 6;
}
@media (max-width: 767px) {
    .yyj-profile-banner,
    .yyj-cover-upload {
        aspect-ratio: 16 / 9;
    }
}
/* 移动端：隐藏侧边栏，显示横向滚动导航 */
@media (max-width: 767px) {
    .yyj-myaccount-nav {
        display: none !important;
    }
    .yyj-myaccount-mobilenav {
        display: block !important;
    }
    .yyj-myaccount-content {
        padding: 0 8px;
    }
}
/* 平板+：显示侧边栏，隐藏移动导航 */
@media (min-width: 768px) {
    .yyj-myaccount-mobilenav {
        display: none !important;
    }
}
/* 订单表格响应式 */
@media (max-width: 600px) {
    .yyj-myaccount-content table {
        font-size: 12px;
    }
    .yyj-myaccount-content table th,
    .yyj-myaccount-content table td {
        padding: 8px 4px !important;
    }
}

/* 「我的回复」未读小红点。
   两个导航循环（移动端横向滚动条 + 桌面侧边栏）共用同一个 .yyj-myaccount-badge，
   但两处 <a> 的布局不是一回事，所以「靠右」的手法分开写：
   桌面的 <a> 自带 flex（内联样式里的 class="flex align-center"），红点作尾项
   margin-left:auto 靠右；移动端的 <a> 是行内盒，用 margin-left 让它紧跟文字。
   两处都不改 PHP 内联样式，也不动 <a> 自己的 display。 */
.yyj-myaccount-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e53e3e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;   /* 别挡住菜单项的点击 */
}
.yyj-myaccount-mobilenav .yyj-myaccount-badge {
    /* 不绝对定位：外层滚动条是 overflow-x:auto，纵向会连带裁切，
       贴角的小红点容易被切掉一半。行内紧跟文字更稳。 */
    margin-left: 6px;
}
.yyj-myaccount-nav .yyj-myaccount-badge {
    margin-left: auto;   /* flex 尾项靠右，不用绝对定位（否则压住菜单文字） */
}

/* ── 「谁回复了你」列表 ──────────────────────────────────
   模板 woocommerce/myaccount/replies.php，取数 inc/comment-replies.php。
   一条一张扁平卡片：头像 | 名字·时间 / 正文 / 在《文章》·查看。 */
.yyj-replies-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.yyj-replies-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 12px;
    padding: 16px;
    border: 1px solid var(--color-line, #e5e7eb);
    border-radius: 12px;
    background: #fff;
}
.yyj-replies-avatar img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.yyj-replies-main { min-width: 0; }

.yyj-replies-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin-bottom: 6px;
}
.yyj-replies-name { font-weight: 700; color: var(--mainfont, #111); }
.yyj-replies-when { font-size: var(--12-14, 13px); color: #999; }

/* 正文走 comment_text()，wpautop 已经包好 <p>，这里只管行距和长 URL 换行 */
.yyj-replies-text {
    font-size: var(--14-16, 15px);
    line-height: 1.7;
    color: #333;
    overflow-wrap: anywhere;
}
.yyj-replies-text p { margin: 0; }
.yyj-replies-text p + p { margin-top: 10px; }
.yyj-replies-text a {
    color: var(--brandmaincolor, #0071e3);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.yyj-replies-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-top: 10px;
    font-size: var(--12-14, 13px);
    color: #999;
}
.yyj-replies-on a { color: #666; text-decoration: none; }
.yyj-replies-on a:hover { color: var(--brandmaincolor, #0071e3); }
.yyj-replies-view {
    margin-left: auto;
    color: var(--brandmaincolor, #0071e3);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.yyj-replies-view:hover { text-decoration: underline; }

/* ========== 生日滚轮选择器 ========== */
.yyj-bd-popup { display: none; }
.yyj-bd-popup.is-active { display: block; }
.yyj-bd-col { position: relative; overflow: hidden; border-radius: 8px; }
.yyj-bd-col::before,
.yyj-bd-col::after {
    content: ''; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
}
@keyframes yyj-spin { to { transform: rotate(360deg); } }
.yyj-bd-col::before {
    top: 0; height: 90px;
    background: linear-gradient(to bottom, var(--imgmainbackground, #f5f5f5) 0%, transparent 100%);
}
.yyj-bd-col::after {
    bottom: 0; height: 90px;
    background: linear-gradient(to top, var(--imgmainbackground, #f5f5f5) 0%, transparent 100%);
}
.yyj-bd-highlight {
    position: absolute; left: 4px; right: 4px; top: 50%; transform: translateY(-50%);
    height: 44px; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;
    pointer-events: none; z-index: 1; border-radius: 4px;
}
.yyj-bd-list::-webkit-scrollbar { display: none; }
.yyj-bd-list { scroll-snap-type: y mandatory; }
.yyj-bd-item {
    height: 44px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 500; color: #bbb; scroll-snap-align: center;
    user-select: none; cursor: pointer;
}
.yyj-bd-item.is-active {
    color: var(--mainfont, #222); font-size: 24px; font-weight: 700;
}


/* ══════════════════════════════════════════════════════════
   博客文章详情页（single-post.php）
   布局/长相走 Tailwind 工具类，这里只放三件 Tailwind 表达不了的事：
   1) 正文排版 —— 作者在古腾堡「自定义 HTML」区块粘贴原生 HTML，
      没有任何 class 可挂，只能用后代选择器；
   2) 锚点偏移 —— 必须靠 scroll-margin-top + JS 测出的头部高度变量；
   3) is-* 状态类与 1026px 断点的展开/收起 —— 状态长相归 CSS。
   ══════════════════════════════════════════════════════════ */

/* ── 面包屑 ──────────────────────────────────────────── */
@media (max-width: 767px) {
    [data-article-breadcrumb] ol {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }
    [data-article-breadcrumb] li {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* ── 特色图 ────────────────────────────────────────────
   特色图是编辑随手传的原图，宽高比完全不可控 —— 竖构图配 w-full 时
   高度会顶到 1100px 以上，把标题、目录、正文全推到首屏之外。
   故设高度上限 + object-fit:cover：横图根本够不到上限、原样显示，
   只有超高图被裁成横幅（默认 object-position 居中，主体通常落在中间）。 */
[data-article-hero] img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}
@media (min-width: 1027px) {
    [data-article-hero] img { max-height: 560px; }
}

/* ── 目录 ────────────────────────────────────────────── */

/* 目录栏「有 / 无」由 PHP 判定（yyj_article_has_h2）：没有 H2 时整个
   <aside> 根本不渲染，grid 直接输出两列模板 —— 首屏即正确，不闪不跳。
   下面两条纯属兜底，防「短码动态吐 H2」让 PHP 误判成没有：
   格子被隐藏时 grid 会自动重排（正文被挤进 240px 列），
   所以必须同时把模板换成两列，不能只 display:none。 */
[data-article-toc].is-empty { display: none; }
@media (min-width: 1027px) {
    [data-article-grid].is-no-toc { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* 目录是桌面专属：窄屏正文本来就窄，再顶一个 240px 的目录栏只会把正文往下推，
   折叠按钮在「面板已被隐藏」的前提下更是死按钮 —— 索性整块不出场。 */
@media (max-width: 1026px) {
    [data-article-toc] { display: none; }
}

/* 标题做成品牌色药丸：浅蓝底 + 全圆角，和下面的链接列表拉开层级。
   颜色取自运行时变量 --brandmaincolor，后台改主色这里跟着变；
   先给一条纯色兜底，再让支持 color-mix 的浏览器叠上品牌色调。 */
[data-toc-panel] [data-toc-title] {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eef4ff;
    background: color-mix(in srgb, var(--brandmaincolor, #0071e3) 7%, #fff);
    color: var(--brandmaincolor, #0071e3);
}

[data-toc-list] { display: flex; flex-direction: column; gap: 2px; }
[data-toc-list] a {
    display: block; padding: 6px 10px;
    border-left: 2px solid transparent;
    font-size: var(--14-16, 15px); line-height: 1.5;
    color: #666; text-decoration: none;
    transition: color .15s, border-color .15s;
}
[data-toc-list] a:hover { color: var(--brandmaincolor, #0071e3); }
[data-toc-list] a.is-active {
    color: var(--brandmaincolor, #0071e3);
    border-left-color: var(--brandmaincolor, #0071e3);
    font-weight: 700;
}

/* ── 锚点偏移 ────────────────────────────────────────────
   头部 .yolo-header 是 sticky top:0；公告栏不 sticky 会正常滚走，
   所以只需减去头部高度（JS 测一次写进 --yyj-article-header-h）。 */
[data-article-body] h2,
[data-article-body] h3,
[data-article-body] h4 {
    scroll-margin-top: calc(var(--yyj-article-header-h, 80px) + 20px);
}

/* ── 正文排版（作者粘贴的原生 HTML，无 class 可挂）──────── */
[data-article-body] {
    font-size: 17px; line-height: 1.8; color: #333;
    overflow-wrap: break-word;
}
[data-article-body] > * + * { margin-top: 20px; }

[data-article-body] h2 {
    margin: 44px 0 16px; font-size: clamp(22px, 1.9vw, 28px);
    font-weight: 700; line-height: 1.35; color: var(--mainfont, #111);
}
[data-article-body] h3 {
    margin: 32px 0 12px; font-size: clamp(19px, 1.6vw, 22px);
    font-weight: 700; line-height: 1.4; color: var(--mainfont, #111);
}
[data-article-body] h4 {
    margin: 24px 0 10px; font-size: 18px;
    font-weight: 700; color: var(--mainfont, #111);
}
[data-article-body] p { margin: 0; }
[data-article-body] a {
    color: var(--brandmaincolor, #0071e3);
    text-decoration: underline; text-underline-offset: 2px;
}
[data-article-body] strong, [data-article-body] b { font-weight: 700; color: var(--mainfont, #111); }

[data-article-body] ul, [data-article-body] ol { margin: 0; padding-left: 24px; }
[data-article-body] ul { list-style: disc; }
[data-article-body] ol { list-style: decimal; }
[data-article-body] li + li { margin-top: 8px; }

[data-article-body] img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
[data-article-body] figure { margin: 0; }
[data-article-body] figcaption {
    margin-top: 8px; font-size: var(--12-14, 13px);
    color: #888; text-align: center;
}

[data-article-body] blockquote {
    margin: 0; padding: 4px 0 4px 18px;
    border-left: 3px solid var(--brandmaincolor, #0071e3);
    color: #555; font-style: italic;
}

[data-article-body] hr {
    margin: 32px 0; border: 0;
    border-top: 1px solid var(--color-line, #ddd);
}

[data-article-body] code {
    padding: 2px 6px; border-radius: 4px;
    background: #f1f2f2; font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-article-body] pre {
    margin: 0; padding: 16px; border-radius: 10px;
    background: #1e1e1e; color: #eaeaea;
    overflow-x: auto; font-size: 14px; line-height: 1.6;
}
[data-article-body] pre code { padding: 0; background: none; color: inherit; font-size: inherit; }

/* 宽表/宽图/嵌入内容各自横向滚动，不撑破网格 */
[data-article-body] table {
    display: block; width: 100%; overflow-x: auto;
    border-collapse: collapse; font-size: 15px;
}
[data-article-body] th, [data-article-body] td {
    padding: 10px 12px; border: 1px solid var(--color-line, #ddd); text-align: left;
}
[data-article-body] th { background: #f7f7f7; font-weight: 700; }
[data-article-body] iframe, [data-article-body] video { max-width: 100%; }

/* ── 侧栏订阅卡片：状态长相 ───────────────────────────── */
[data-sub-msg] { margin: 0; font-size: var(--14-16, 15px); line-height: 1.5; }
[data-sub-msg].is-success { color: var(--brandmaincolor, #0071e3); }
[data-sub-msg].is-info    { color: #666; }
[data-sub-msg].is-error   { color: #e53e3e; }

[data-sub-btn]:disabled { opacity: .7; cursor: default; }
[data-sub-email]:disabled, [data-sub-consent]:disabled { opacity: .7; }
[data-sub-turnstile] { margin-bottom: 4px; }

/* ══ 评论区 ══════════════════════════════════════════════
   结构在主题根目录 comments.php，字段/反垃圾在 inc/article.php。
   这里只写长相，全部收在 [data-comments] 之下 —— 该选择器只出现在文章详情页，
   产品页的 WooCommerce 评论模板（.commentlist / #reviews）不受影响。

   class 名取自 core 的 Walker_Comment::html5_comment()，一个都不能改名：
   .comment-body / .comment-meta / .comment-author.vcard / .fn / .says /
   .comment-metadata / .comment-awaiting-moderation / .comment-content / .reply
   ══════════════════════════════════════════════════════════ */

/* 外层 <ol> 由 comments.php 给出（wp_list_comments 只回显 walker 的 <li>），
   子评论是同构的嵌套 <ol class="children">，li 上带 depth-N（core 的
   comment_class() 给的，comment-template.php:577）。

   层级用**左侧竖线轨道**画，不用卡片：红迪/贴吧的读法就是「缩进 + 一道线」
   表示从属关系，卡片反而把层级糊平。轨道挂在 .children 自己的左边框上 ——
   start_lvl() 输出的就是裸的 <ol class="children">（:62），没有别的 class，
   所以这里可以直接选中它。 */
[data-comments] .comment-list { list-style: none; margin: 0; padding: 0; }
[data-comments] .comment-list .children {
    list-style: none;
    margin: 8px 0 0 14px;
    padding-left: 20px;
    border-left: 2px solid var(--yyj-rail, #d8dbe0);
}
/* 逐层配色：越深越淡，一眼看出第几层。--yyj-rail 就设在同一元素上，
   所以边框那条 var() 直接吃到自己的值。深过 5 层（thread_comments_depth
   若被调大）没有专门配色，落到上面的默认灰。 */
[data-comments] .depth-1 > .children { --yyj-rail: var(--brandmaincolor, #0071e3); }
[data-comments] .depth-2 > .children { --yyj-rail: #7aa7d8; }
[data-comments] .depth-3 > .children { --yyj-rail: #a8c0dc; }
[data-comments] .depth-4 > .children { --yyj-rail: #c6d2e0; }
[data-comments] .depth-5 > .children { --yyj-rail: #d8dbe0; }
[data-comments] .comment-list li + li { margin-top: 14px; }

/* ── 单条评论：扁平块 + 头部行 ────────────────────────── */
/* 去卡片（border/radius/background 全撤），改用 grid 把「回复」按钮拎到
   头部那一行的右端 —— 用户选中的样式里，回复按钮和时间戳同一行。
   .reply 是 .comment-body 的直接子元素（html5_comment 里 comment_reply_link
   的 before 参数就是 <div class="reply">），所以**纯 CSS 就能完成这个搬家，
   PHP 结构一行都不用动**。

   minmax(0, 1fr) 而不是 1fr：正文里贴长 URL 时，1fr 的默认 min-width:auto
   会把列撑宽、顶破外层容器。 */
[data-comments] .comment-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "meta reply"
        "content content";
    column-gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}

[data-comments] .comment-meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-bottom: 12px;
}

[data-comments] .comment-author.vcard {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
[data-comments] .comment-author .avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}
[data-comments] .comment-author .fn {
    font-weight: 700;
    font-style: normal;
    color: var(--mainfont, #111);
}
[data-comments] .comment-author a { color: inherit; text-decoration: none; }
/* core 会在作者名后输出「says:」，中文页面即「说：」—— 头像 + 名字够了，去掉更干净 */
[data-comments] .comment-author .says { display: none; }

/* 时间戳**紧跟在名字右边**（原来是 margin-left:auto 推到最右端）。
   红迪/贴吧的头部行读法是「名字 · 时间 …… 回复」，时间和名字是一组，
   右端留给回复按钮。4px 是叠在 .comment-meta 的 12px gap 上的微调。 */
[data-comments] .comment-metadata {
    margin-left: 4px;
    font-size: var(--12-14, 13px);
    color: #999;
}
[data-comments] .comment-metadata a { color: inherit; text-decoration: none; }
[data-comments] .comment-metadata a:hover { color: var(--brandmaincolor, #0071e3); }
[data-comments] .comment-metadata .edit-link { margin-left: 8px; }

/* 「等待审核」横条：flex-basis 100% 强制独占一行（父级是 wrap 的 flex） */
[data-comments] .comment-awaiting-moderation {
    flex: 1 0 100%;
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fdf3d8;
    color: #8a6100;
    font-size: var(--12-14, 13px);
    font-style: normal;
    line-height: 1.5;
}

/* ── 「谁回复谁」署名前缀 ─────────────────────────────── */
/* 标记由 inc/article.php 的 yyj_comment_reply_to_label() 挂在 comment_text 上，
   形如：<span class="yyj-reply-to">回复 <a href="#comment-162">@逸豪 袁</a>：</span>
   它是**回复正文自己的行首前缀**，跟正文同一段，所以这里只做行内着色，
   不设 display —— 一设成块级就变成单独一行标题，跟样式稿不符。 */
[data-comments] .yyj-reply-to { color: #8a8f98; }
[data-comments] .yyj-reply-to a {
    color: var(--brandmaincolor, #0071e3);
    text-decoration: none;
    font-weight: 600;
}
[data-comments] .yyj-reply-to a:hover { text-decoration: underline; }

/* ── 正文 ────────────────────────────────────────────── */
[data-comments] .comment-content {
    grid-area: content;
    font-size: var(--14-16, 15px);
    line-height: 1.7;
    color: #333;
    overflow-wrap: anywhere;   /* 评论里贴长 URL 不撑破容器 */
}
[data-comments] .comment-content > * + * { margin-top: 12px; }
[data-comments] .comment-content p { margin: 0; }
[data-comments] .comment-content a {
    color: var(--brandmaincolor, #0071e3);
    text-decoration: underline;
    text-underline-offset: 2px;
}
[data-comments] .comment-content img { max-width: 100%; height: auto; }
[data-comments] .yyj-comment-attachment {
    width: min(100%, 640px);
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--color-line, #e5e7eb);
    border-radius: 12px;
    background: #f3f4f6;
}
[data-comments] .yyj-comment-attachment a { display: block; }
[data-comments] .yyj-comment-attachment img,
[data-comments] .yyj-comment-attachment video {
    display: block;
    width: 100%;
    max-height: 520px;
    margin: 0;
    object-fit: contain;
    background: #111;
}
[data-comments] .comment-content blockquote {
    margin: 0;
    padding: 4px 0 4px 14px;
    border-left: 3px solid var(--color-line, #ddd);
    color: #555;
}

/* ── 回复按钮 ────────────────────────────────────────── */
/* grid-area 把它放进头部行（见 .comment-body 的 grid-template-areas），
   不再是正文下面那个灰胶囊。align-self:start 让它和头部行顶对齐，
   不被旁边更高的 .comment-meta 拉长。 */
[data-comments] .reply {
    grid-area: reply;
    align-self: start;
    margin: 0;
}
[data-comments] .comment-reply-link {
    display: inline-block;
    padding: 0;
    border-radius: 0;
    background: none;
    color: #8a8f98;
    font-size: var(--12-14, 13px);
    line-height: 1.6;
    white-space: nowrap;   /* 「回复」别在窄屏被拆成两行 */
    text-decoration: none;
    transition: color .15s;
}
[data-comments] .comment-reply-link:hover {
    background: none;
    color: var(--brandmaincolor, #0071e3);
}

/* ── 分页（本站 page_comments=0，通常不出现）──────────── */
[data-comments] .comment-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}
[data-comments] .comment-navigation a,
[data-comments] .comment-navigation span {
    padding: 6px 12px;
    border: 1px solid var(--color-line, #ddd);
    border-radius: 999px;
    font-size: var(--12-14, 13px);
    color: #666;
    text-decoration: none;
}
[data-comments] .comment-navigation a:hover {
    border-color: var(--brandmaincolor, #0071e3);
    color: var(--brandmaincolor, #0071e3);
}
[data-comments] .comment-navigation .current {
    border-color: transparent;
    background: var(--brandmaincolor, #0071e3);
    color: #fff;
}

/* ── 表单 ────────────────────────────────────────────── */
[data-comments] .comment-respond {
    margin-top: 32px;
    padding: 24px;
    border: 1px solid var(--color-line, #ddd);
    border-radius: 16px;
    background: var(--color-secondary, #f7f7f7);
}

[data-comments] .comment-reply-title {
    margin: 0 0 16px;
    font-size: clamp(19px, 1.6vw, 22px);
    font-weight: 700;
    line-height: 1.4;
    color: var(--mainfont, #111);
}
[data-comments] .comment-reply-title small {
    display: block;
    margin-top: 4px;
    font-size: var(--12-14, 13px);
    font-weight: 400;
}
/* 不设 display —— core 靠内联 style="display:none" 藏它，comment-reply.js 再放开；
   在样式表里写 display 会跟那套机制打架（内联样式优先级更高，反而让「取消回复」失灵）。 */
[data-comments] #cancel-comment-reply-link {
    color: #999;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 姓名 / 邮箱 / 正文 / 同意勾选的 <p> 都是 grid 子项。
   两个 <p> 没法包一层共同父级，所以姓名与邮箱的并排只能靠显式定位 ——
   先让所有子项跨满整行，再用 p.comment-form-author / p.comment-form-email
   （多一个元素选择器，权重高于 > * 那条）各自占一半。
   input[type=hidden] 在 UA 样式里是 display:none，不会变成 grid 子项。 */
[data-comments] .comment-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
[data-comments] .comment-form > * { grid-column: 1 / -1; }
[data-comments] .comment-form p { margin: 0; }

[data-comments] .comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--14-16, 15px);
    font-weight: 700;
    color: var(--mainfont, #111);
}
[data-comments] .required { color: #e53e3e; }

[data-comments] .comment-form input[type="text"],
[data-comments] .comment-form input[type="email"],
[data-comments] .comment-form input[type="url"],
[data-comments] .comment-form textarea {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-line, #ddd);
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-family: inherit;
    font-size: var(--option-sizeyo, 15px);
    line-height: 1.5;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s;
}
[data-comments] .comment-form input[type="text"]:focus,
[data-comments] .comment-form input[type="email"]:focus,
[data-comments] .comment-form input[type="url"]:focus,
[data-comments] .comment-form textarea:focus {
    border-color: var(--brandmaincolor, #0071e3);
}
[data-comments] .comment-form textarea {
    min-height: 140px;
    resize: vertical;
}

/* Reddit 式媒体工具栏：真实 file input 保持视觉隐藏，由三个类型按钮唤起。 */
[data-comments] .yyj-comment-media { min-width: 0; }
[data-comments] .yyj-comment-media-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
[data-comments] .yyj-comment-media-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
[data-comments] .yyj-comment-media-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--color-line, #d7d9dc);
    border-radius: 999px;
    background: #fff;
    color: #444;
    font-family: inherit;
    font-size: var(--12-14, 13px);
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
[data-comments] .yyj-comment-media-button:hover,
[data-comments] .yyj-comment-media-button:focus-visible {
    border-color: var(--brandmaincolor, #0071e3);
    background: #f5f9ff;
    color: var(--brandmaincolor, #0071e3);
    outline: none;
}
[data-comments] .yyj-comment-media-button svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}
[data-comments] .yyj-comment-media-gif {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: -.02em;
}
[data-comments] .yyj-comment-media-limits {
    margin-top: 7px !important;
    font-size: 12px;
    line-height: 1.45;
    color: #888;
}
[data-comments] .yyj-comment-media-preview {
    width: min(100%, 520px);
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--color-line, #ddd);
    border-radius: 12px;
    background: #fff;
}
[data-comments] .yyj-comment-media-preview[hidden] { display: none; }
[data-comments] .yyj-comment-media-visual {
    display: grid;
    place-items: center;
    min-height: 120px;
    max-height: 360px;
    overflow: hidden;
    background: #111;
}
[data-comments] .yyj-comment-media-visual img,
[data-comments] .yyj-comment-media-visual video {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}
[data-comments] .yyj-comment-media-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: var(--12-14, 13px);
}
[data-comments] .yyj-comment-media-meta > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-comments] .yyj-comment-media-remove {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: #c53030;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}
[data-comments] .yyj-comment-media-remove:hover { text-decoration: underline; }
[data-comments] .yyj-comment-media-error {
    margin-top: 8px !important;
    font-size: var(--12-14, 13px);
    line-height: 1.5;
    color: #c53030;
}
[data-comments] .yyj-comment-media-error[hidden] { display: none; }

[data-comments] .comment-notes,
[data-comments] .logged-in-as {
    font-size: var(--12-14, 13px);
    line-height: 1.6;
    color: #888;
}
[data-comments] .comment-notes a,
[data-comments] .logged-in-as a { color: var(--brandmaincolor, #0071e3); }

/* 同意勾选：整行、复选框与文案顶对齐。
   请勿在此处改 label 的 display/font-weight —— 上面的通用 label 规则已经
   用 p.comment-form-cookies-consent 加权重压过（通用规则是块级粗体，
   那是给「姓名/邮箱」这种字段标签用的）。 */
[data-comments] .comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
[data-comments] .comment-form-cookies-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--brandmaincolor, #0071e3);
}
[data-comments] p.comment-form-cookies-consent label {
    display: inline;
    margin: 0;
    font-size: var(--14-16, 15px);
    font-weight: 400;
    line-height: 1.55;
    color: #666;
    cursor: pointer;
}
[data-comments] p.comment-form-cookies-consent label a { color: var(--brandmaincolor, #0071e3); }

/* 蜜罐：移出视口但仍在渲染树里。
   刻意不用 display:none / visibility:hidden / hidden —— 相当一部分爬虫会跳过
   这三类元素，填都不填，蜜罐就失去了意义；移出视口才骗得到它们。

   ⚠ 这两条是本节唯一**不带 [data-comments] 作用域**的规则，故意的，别"顺手统一"。
   字段由 inc/article.php 的 yyj_comment_trap_fields() 经 comment_form_after_fields /
   comment_form_logged_in_after 注入，那两个钩子对**任何**调 comment_form() 的表单
   都触发；藏身样式若挂在 [data-comments] 上，换一个不带这个包裹层的模板调用
   comment_form()（产品页现在是自己手写 <form>，所以还没事）蜜罐就会明晃晃地露出来，
   而且是「有个叫 Website 的输入框」这种一眼假的样子。
   把字段和藏身样式绑定在同一个类名上，注入到哪就藏到哪，不依赖外层容器。
   类名带 yyj- 前缀，全站只此一处产出，放开作用域不会误伤别处。 */
.yyj-comment-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
/* 蜜罐里的 input 在文章页还命中 [data-comments] input[type="text"] 那条（权重 0,3,1），
   会被撑成 52px 高。用 ID 把权重提到 (1,0,0) 以上的确定值压回去 —— 光靠源码顺序
   是靠不住的，免得以后有人调换两段的位置就把它放出来。 */
#yyj-comment-website {
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
}

/* 未登录时的登录引导面板 —— 模板 comments.php 按登录态二选一，未登录时
   根本不渲染 <form>，所以这里不是「盖住表单」而是「本来就没有表单」。
   按钮长相刻意和下面的 .yyj-comment-submit 对齐：同一处位置，登录前登录后
   看起来是同一个动作。
   margin-top 同理要对齐 .comment-respond 的 32px —— 两者占的是同一个位置，
   一个有一个没有，表现就是「游客进来时引导面板贴着上一条评论」。 */
[data-comments] .yyj-comment-login {
    margin-top: 32px;
    padding: 28px 24px;
    border: 1px solid var(--color-line, #e5e7eb);
    border-radius: 12px;
    background: #fafafa;
    text-align: center;
}
[data-comments] .yyj-comment-login-text {
    margin: 0 0 16px;
    font-size: var(--14-16, 15px);
    line-height: 1.6;
    color: #666;
}
[data-comments] .yyj-comment-login-btn {
    display: inline-block;
    padding: 13px 28px;
    border: 0;
    border-radius: 8px;
    background: #1a56db;   /* 与下面的提交按钮同色 */
    color: #fff;
    font-family: inherit;
    font-size: var(--option-sizeyo, 15px);
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
[data-comments] .yyj-comment-login-btn:hover { opacity: .88; }

[data-comments] .yyj-comment-submit {
    display: inline-block;
    padding: 13px 28px;
    border: 0;
    border-radius: 8px;
    background: #1a56db;   /* 与侧栏订阅按钮同色 */
    color: #fff;
    font-family: inherit;
    font-size: var(--option-sizeyo, 15px);
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
[data-comments] .yyj-comment-submit:hover { opacity: .88; }

/* ── 断点 ────────────────────────────────────────────── */
@media (min-width: 768px) {
    [data-comments] .comment-form { grid-template-columns: 1fr 1fr; }
    [data-comments] .comment-form p.comment-form-author { grid-column: 1 / 2; }
    [data-comments] .comment-form p.comment-form-email  { grid-column: 2 / 3; }
}

@media (max-width: 767px) {
    /* 窄屏每层缩进收窄（原 14+20 → 8+12）：第 5 层也不会挤成一条线。
       注意 .comment-body 的 padding 已随卡片一起去掉，这里不再需要覆盖。 */
    [data-comments] .comment-list .children {
        margin-left: 8px;
        padding-left: 12px;
    }
    [data-comments] .comment-author .avatar {
        width: 32px;
        height: 32px;
    }
    [data-comments] .comment-respond { padding: 18px; }
    /* 时间戳换行到名字下面时别再留缩进 */
    [data-comments] .comment-metadata { margin-left: 0; }
}

/* === 博客归档卡片 === */
/* 只放 Tailwind 表达不了的三件事：宽幅比、hover 变色、媒体查询。
   布局 / 颜色 / 字号 / 间距全部在 inc/blog-archive.php 里用已编译的类或行内 style
   —— 本机无法重新编译 Tailwind，新写的类会静默失效，所以这里不碰那部分。 */

/* 宽幅比：编译过的只有 aspect-[16/10]，头条卡要更宽的视频比例，只能写在这。
   无图时容器仍在（卡片兜底靠它撑高度，与有图卡同高）。 */
.yyj-post-lead__media {
    aspect-ratio: 2.2 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--imgmainbackground);
}
.yyj-post-lead__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* hover 是变色不是位移：全站约定，无抬升、无图片缩放 */
.yyj-post-card__title { transition: color 0.15s ease; }
.yyj-post-card:hover .yyj-post-card__title { color: var(--brandmaincolor, #0071e3); }

@media (max-width: 767px) {
    /* 窄屏头条回到与网格卡一致的 16/10，避免一条太扁的细带 */
    .yyj-post-lead__media { aspect-ratio: 16 / 10; }
}
