body {
    min-height: 100vh;
}

/* ===== 详情页主容器 ===== */
.detail-wrapper {
    max-width: 1200px;
    margin: 24px auto 48px;
    padding: 0 24px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
    font-size: 14px;
    color: var(--text-light);
    opacity: 0.7;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--primary-dark);
    transition: var(--transition);
}
.breadcrumb a:hover {
    opacity: 0.7;
}
.breadcrumb .sep {
    opacity: 0.4;
}
.breadcrumb .current {
    font-weight: 500;
    color: var(--text);
    opacity: 0.9;
}

/* ===== 详情卡片 ===== */
.detail-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.detail-card:hover {
    box-shadow: var(--shadow-hover);
}

/* 左：图片区 */
.detail-image {
    background: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    min-height: 400px;
}
.detail-image img {
    width: 100%;
    height: auto;
    max-height: 1200px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    cursor: zoom-in;
}

/* 生成视频：入口区（白名单账号由JS显示） */
.video-area {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.video-btn-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.gen-video-btn {
    padding: 10px 26px;
    border: none;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.gen-video-btn:hover { opacity: 0.88; }
.gen-video-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.gen-video {
    width: 100%;
    max-height: 1200px;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 右：内容区 */
.detail-content {
    padding: 32px 32px 32px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-content .photo-source {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--white);
    background: var(--primary);
    padding: 2px 18px;
    border-radius: 30px;
    letter-spacing: 1px;
    margin-bottom: 16px;
    align-self: flex-start;
}

.detail-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 2px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.detail-content .subtitle {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 20px;
    opacity: 0.8;
    border-left: 3px solid var(--primary);
    padding-left: 16px;
}

.detail-content .meta-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 20px;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
    background: var(--primary-pale);
    padding: 16px 20px;
    border-radius: 12px;
}
.meta-grid .label {
    font-weight: 500;
    color: var(--text);
    opacity: 0.7;
}
.meta-grid .value {
    font-weight: 400;
}

.detail-content .description {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.9;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
    padding-right: 8px;
}

.detail-content .full-detail {
    font-size: 15px;
    color: var(--text);
    line-height: 2;
    background: var(--primary-pale);
    padding: 20px 24px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    letter-spacing: 0.3px;
}
.detail-content .full-detail strong {
    color: var(--primary-dark);
    font-weight: 600;
}

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .detail-card {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .detail-content {
        padding: 28px 24px 32px;
    }
    .detail-image {
        min-height: 280px;
        padding: 16px;
    }
    .detail-image img {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .detail-wrapper {
        padding: 0 16px;
        margin-top: 16px;
    }
    .detail-content h1 {
        font-size: 1.8rem;
    }
    .detail-content .meta-grid {
        grid-template-columns: 1fr;
        gap: 2px 0;
        padding: 14px 16px;
    }
    .detail-content .full-detail {
        padding: 16px 18px;
        font-size: 14px;
    }
    .detail-content .description {
        font-size: 14px;
    }
    .breadcrumb {
        font-size: 13px;
        margin-bottom: 14px;
    }
}

@media (max-width: 480px) {
    .detail-image {
        min-height: 200px;
        padding: 10px;
    }
    .detail-image img {
        max-height: 300px;
    }
    .detail-content {
        padding: 20px 16px 24px;
    }
    .detail-content .photo-source {
        font-size: 12px;
        padding: 1px 14px;
    }
}

/* ===== 工具类 ===== */
.fade-in {
    animation: fadeUp 0.6s ease forwards;
}
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
           底部操作区：靠右对齐
           ============================================================ */
.detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;      /* 关键：靠右对齐 */
    gap: 16px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* 做同款按钮（主按钮） */
.make-same-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 38px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(212, 133, 138, 0.32);
    position: relative;
    overflow: hidden;
}
.make-same-btn .btn-icon {
    font-size: 16px;
    line-height: 1;
    transition: transform 0.4s ease;
}
.make-same-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(212, 133, 138, 0.44);
}
.make-same-btn:hover .btn-icon {
    transform: rotate(-15deg) scale(1.15);
}
.make-same-btn:active {
    transform: translateY(0);
}

.make-same-btn .btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.make-same-btn.loading .btn-text,
.make-same-btn.loading .btn-icon { display: none; }
.make-same-btn.loading .btn-loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 返回链接（次按钮） */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    border: 1.5px solid rgba(212, 133, 138, 0.28);
    border-radius: 50px;
    background: transparent;
}
.back-link:hover {
    border-color: var(--primary);
    background: rgba(212, 133, 138, 0.08);
    gap: 12px;
}

@media (max-width: 768px) {
    /* 移动端：取消靠右，改为纵向占满整行 */
    .detail-actions {
        flex-direction: column;
        justify-content: stretch;
        gap: 12px;
    }
    .make-same-btn { width: 100%; padding: 15px 28px; }
    .back-link { width: 100%; justify-content: center; padding: 12px 24px; }
}
@media (max-width: 768px) {
    .make-same-btn { font-size: 14px; letter-spacing: 1.5px; padding: 14px 24px; }
}

/* ============================================================
   做同款内嵌区（由 samePhoto 页合并而来）
   ============================================================ */
/* ===== 卡片通用 ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.card-title h2 {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-title h2 .icon {
    font-size: 18px;
    color: var(--primary);
}
.card-title .title-hint {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.6;
    letter-spacing: 0.5px;
}

/* ===== 模板选择区 ===== */
.template-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.template-block {
    background: var(--primary-pale);
    border-radius: 14px;
    padding: 14px 14px 16px;
    border: 1.5px solid rgba(212, 133, 138, 0.10);
    transition: var(--transition);
}
.template-block:hover {
    border-color: rgba(212, 133, 138, 0.25);
}
.template-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.template-head .tpl-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}
.template-head .tpl-label .gender-icon {
    font-size: 16px;
}

/* 新增模板按钮 */
.add-template-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--primary-dark);
    background: var(--white);
    border: 1.5px solid rgba(212, 133, 138, 0.35);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.add-template-btn:hover {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 133, 138, 0.28);
}
.add-template-btn .plus {
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
}

/* 下拉框 */
.select-wrap {
    position: relative;
    margin-bottom: 10px;
}
.select-wrap select {
    width: 100%;
    padding: 8px 34px 8px 12px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    border: 1.5px solid rgba(212, 133, 138, 0.20);
    border-radius: 10px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}
.select-wrap select:hover {
    border-color: rgba(212, 133, 138, 0.45);
}
.select-wrap select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(212, 133, 138, 0.10);
}
.select-wrap select:disabled {
    background: rgba(107, 79, 76, 0.04);
    color: var(--text-light);
    opacity: 0.7;
    cursor: not-allowed;
}
.select-wrap .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-light);
    opacity: 0.6;
    pointer-events: none;
}

/* 模板图片区：缩略图多列小网格，避免弹窗被单列大图撑高 */
.template-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    min-height: 60px;
}
.tpl-img-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
    aspect-ratio: 1 / 1;
    cursor: pointer;
    border: 2.5px solid transparent;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(44, 24, 23, 0.06);
}
.tpl-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.tpl-img-item:hover img { transform: scale(1.05); }
.tpl-img-item.selected {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(212, 133, 138, 0.30);
}
.tpl-img-item .check-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(212, 133, 138, 0.40);
}
.tpl-img-item.selected .check-badge { display: flex; }

/* 空状态 */
.template-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: var(--white);
    border-radius: 10px;
    border: 1.5px dashed rgba(212, 133, 138, 0.28);
    text-align: center;
}
.template-empty .empty-icon {
    font-size: 26px;
    opacity: 0.35;
    margin-bottom: 8px;
}
.template-empty .empty-text {
    font-size: 13px;
    color: var(--text-light);
    opacity: 0.75;
    letter-spacing: 0.3px;
    line-height: 1.7;
}
.template-empty .empty-text .link {
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

/* ===== 提交按钮（弹窗底部） ===== */
.size-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.size-select-wrap .size-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 1px;
}
.size-select-wrap select {
    padding: 12px 36px 12px 14px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    border: 1.5px solid rgba(212, 133, 138, 0.20);
    border-radius: 10px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}
.size-select-wrap select:hover {
    border-color: rgba(212, 133, 138, 0.45);
}
.size-select-wrap select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(212, 133, 138, 0.10);
}
.size-select-wrap .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-light);
    opacity: 0.6;
    pointer-events: none;
}
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 280px;
    padding: 10px 48px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 28px rgba(212, 133, 138, 0.34);
    position: relative;
    overflow: hidden;
}
.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(212, 133, 138, 0.46);
}
.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}
.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: linear-gradient(135deg, #c9b8b9 0%, #b5a3a4 100%);
}
.submit-btn .btn-icon {
    font-size: 18px;
    transition: transform 0.4s ease;
}
.submit-btn:hover:not(:disabled) .btn-icon {
    transform: rotate(-12deg) scale(1.15);
}
.submit-btn .btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
/* 用户协议 / 隐私政策勾选（未勾选则禁用提交按钮） */
.agree-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}
.agree-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    user-select: none;
}
.agree-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0 2px 0 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.agree-label a {
    color: var(--primary);
    text-decoration: none;
}
.agree-label a:hover {
    text-decoration: underline;
}
.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon { display: none; }
.submit-btn.loading .btn-loader { display: block; }

/* ===== 弹窗：选择模板（做同款浮层） ===== */
.tpl-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(44, 24, 23, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tpl-modal.show { display: flex; opacity: 1; }
.tpl-modal-panel {
    width: 100%;
    max-width: 560px;
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.30);
    transform: scale(0.94);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
}
.tpl-modal.show .tpl-modal-panel { transform: scale(1); }
.tpl-modal-header {
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(212, 133, 138, 0.10);
    flex-shrink: 0;
}
.tpl-modal-header h3 {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1.5px;
}
.tpl-modal-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tpl-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-light);
    transition: var(--transition);
}
.tpl-close:hover {
    background: var(--primary-pale);
    color: var(--primary-dark);
}
.tpl-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}
.tpl-modal-footer {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(212, 133, 138, 0.10);
    flex-shrink: 0;
}

/* ===== 作品图片放大浮层（lightbox） ===== */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(20, 10, 10, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.img-lightbox.show { display: flex; opacity: 1; }
.img-lightbox img {
    max-width: 88vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}
.lb-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.28); color: var(--white); }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 18px; right: 22px; }
.lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(0, 0, 0, 0.35);
    padding: 5px 14px;
    border-radius: 20px;
}
@media (max-width: 768px) {
    .lb-btn { width: 36px; height: 36px; font-size: 15px; }
    .lb-prev { left: 10px; }
    .lb-next { right: 10px; }
    .lb-close { top: 12px; right: 12px; }
    .img-lightbox img { max-width: 94vw; }
}

/* ===== 我的作品 ===== */
.works-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
}
.works-more:hover { text-decoration: underline; }
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.work-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--primary-pale);
    aspect-ratio: 3 / 4;
    border: 1.5px solid rgba(212, 133, 138, 0.10);
    box-shadow: 0 2px 8px rgba(44, 24, 23, 0.06);
}
.work-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}
.work-item img:hover { transform: scale(1.04); }
/* 生成中占位：骨架屏 + 提示，比例随所选尺寸 */
.work-item.pending {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-style: dashed;
    background: linear-gradient(100deg, var(--primary-pale) 40%, var(--white) 50%, var(--primary-pale) 60%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(212, 133, 138, 0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.work-pending-tip {
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 0.5px;
    text-align: center;
    padding: 0 8px;
}
/* 生成失败 */
.work-item.failed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--white);
    border-color: rgba(196, 74, 74, 0.35);
}
.work-fail-icon { font-size: 26px; }
.work-retry-btn {
    padding: 7px 18px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--primary-dark);
    background: var(--primary-pale);
    border: 1.5px solid rgba(212, 133, 138, 0.35);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}
.work-retry-btn:hover {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
}
.works-empty {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    opacity: 0.75;
    letter-spacing: 0.3px;
    padding: 24px 0;
}

/* ===== 弹窗 / 作品区响应式 ===== */
@media (max-width: 768px) {
    .card { padding: 22px 20px; }
    .template-block { padding: 12px 12px 14px; }
    .template-row { grid-template-columns: 1fr; gap: 12px; }
    .template-images { grid-template-columns: repeat(4, 1fr); gap: 6px; }

    .tpl-modal { padding: 12px; }
    .tpl-modal-header { padding: 12px 14px; }
    .tpl-modal-body { padding: 14px 12px; }
    .tpl-modal-footer { padding: 12px 14px; }
    .submit-btn { min-width: 0; padding: 12px 32px; font-size: 15px; letter-spacing: 2px; }

    .works-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
}
@media (max-width: 480px) {
    .card-title h2 { font-size: 17px; }
    .template-images { gap: 6px; }
    .tpl-img-item .check-badge { width: 20px; height: 20px; font-size: 11px; }
    .add-template-btn { padding: 5px 12px; font-size: 11px; }
}