/* ========== 引流获客页面 - 与项目配色一致 ========== */

/* 统计标签整体下移 */
.result-stats {
    margin-top: 6px;
}

.drainage-page-container {
    min-height: 100vh;
    background: var(--bg-primary, #f5f7fa);
    color: var(--text-primary, #1a1a2e);
}

/* 顶部导航 */
.drainage-header {
    background: var(--bg-secondary, #ffffff);
    border-bottom: 1px solid var(--border-light, #d1d5db);
    padding: 12px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    height: 36px;
    width: auto;
}

.btn-back {
    color: var(--text-primary, #1a1a2e);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-light, #d1d5db);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-back:hover {
    background: var(--bg-tertiary, #eef2f7);
    color: var(--accent-500, #6366f1);
}

/* 主标题 */
.drainage-main {
    padding: 40px 0;
}

.main-title {
    text-align: center;
    margin-bottom: 40px;
}

.main-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-600, #4f46e5) 0%, var(--accent-500, #6366f1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.main-title p {
    color: var(--text-secondary, #3d3d5c);
    font-size: 1.1rem;
    margin: 0;
}

/* 内容布局 */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* 折叠面板 */
.accordion-section {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--card-border, #cbd5e1);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-500, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.step-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
}

.badge-level {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.accordion-toggle {
    color: #888;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.accordion-section:not(.open) .accordion-toggle {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 20px;
    border-top: 1px solid var(--border-light, #d1d5db);
}

.accordion-section:not(.open) .accordion-content {
    display: none !important;
}

/* 登录提示 */
.login-prompt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    margin-bottom: 20px;
}

.prompt-text strong {
    display: block;
    color: var(--accent-600, #4f46e5);
    font-size: 0.9rem;
}

.prompt-text small {
    color: var(--accent-500, #6366f1);
    font-size: 0.8rem;
}

.btn-login {
    padding: 6px 16px;
    background: var(--accent-500, #6366f1);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--accent-600, #4f46e5);
}

/* 模式标签 */
.mode-tabs {
    display: flex;
    background: var(--bg-tertiary, #eef2f7);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-secondary, #3d3d5c);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab.active {
    background: var(--accent-500, #6366f1);
    color: #fff;
}

/* 表单 */
.form-group {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-primary, #1a1a2e);
    font-weight: 500;
}

/* 分数/位次切换按钮 - 与首页保持一致 */
.score-toggle-wrapper {
    display: flex;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    width: fit-content;
    margin-left: auto;
}

.toggle-btn {
    padding: 0 16px;
    height: 36px;
    line-height: 36px;
    border: none;
    background: transparent;
    color: var(--text-tertiary, #6b7280);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: var(--accent-600, #4f46e5);
    color: white;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.15));
}

.toggle-btn:hover:not(.active) {
    color: var(--accent-600, #4f46e5);
}

/* 内容模块切换行 */
.module-toggle-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* 头部中的模块按钮 */
.module-toggle-row.header-module-buttons {
    margin-top: 0;
    margin-left: auto;
    margin-right: 10px;
}

.module-toggle-row.header-module-buttons .toggle-btn {
    height: 28px;
    line-height: 28px;
    padding: 0 10px;
    font-size: 0.8rem;
}

/* 地区 Combobox - 与首页保持一致 */
.region-combobox {
    position: relative;
}

.region-combobox .form-control {
    padding-right: 40px;
    cursor: text;
}

.region-combobox::after {
    content: '▾';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary, #6b7280);
    pointer-events: none;
    font-size: 0.75rem;
}

.region-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    right: 0;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-medium, #9ca3af);
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.15));
}

.region-dropdown.open {
    display: block;
}

.region-dropdown::-webkit-scrollbar {
    width: 6px;
}

.region-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-medium, #9ca3af);
    border-radius: 9999px;
}

.region-option {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-primary, #1a1a2e);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.region-option:hover,
.region-option.highlighted {
    background: var(--accent-50, #eef2ff);
}

.region-option .mode-tag {
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 9999px;
    background: var(--accent-50, #eef2ff);
    color: var(--accent-600, #4f46e5);
    border: 1px solid var(--accent-400, #818cf8);
    flex-shrink: 0;
}

.region-option .mode-tag.gold {
    background: #fef3c7;
    color: #d97706;
    border-color: #fbbf24;
}

.region-option .mode-tag.gray {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

.region-group-label {
    padding: 6px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary, #6b7280);
    background: var(--bg-tertiary, #eef2f7);
}

.region-no-result {
    padding: 16px;
    text-align: center;
    color: var(--text-tertiary, #6b7280);
    font-size: 0.875rem;
}

.match-highlight {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-600, #4f46e5);
    font-weight: 600;
}

/* 选科标签 - 与首页保持一致 */
.subject-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.subject-tag {
    padding: 0 26px;
    height: 48px;
    line-height: 48px;
    font-size: 0.9375rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    font-weight: 500;
    user-select: none;
    color: var(--text-secondary, #3d3d5c);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.subject-tag:hover {
    color: var(--accent-600, #4f46e5);
    background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14), 0 3px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.subject-tag.selected {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #4f46e5 100%);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35), 0 3px 6px rgba(79, 70, 229, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.subject-tag:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.subject-tag.disabled {
    opacity: 1;
    cursor: not-allowed;
    background: var(--bg-card, #ffffff);
    border: 1px dashed var(--border-light, #d1d5db);
    color: var(--text-muted, #9ca3af);
}

.subject-tag.disabled:hover {
    border-color: var(--border-light, #d1d5db);
    color: var(--text-muted, #9ca3af);
    background: var(--bg-card, #ffffff);
}

/* 分数/位次切换按钮 - 行内布局 */
.score-toggle-wrapper-inline {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: #e5e7eb;
    border-radius: 8px;
    align-items: center;
    height: calc(2.25rem + 2px);
}

.score-input-inline {
    flex: 1;
    height: calc(2.25rem + 2px);
}

/* 科类切换按钮 - 类似参考图样式 */
.category-toggle-wrapper {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.category-btn {
    flex: 1;
    height: 48px;
    line-height: 48px;
    border: 2px solid var(--border-light, #d1d5db);
    background: var(--bg-tertiary, #eef2f7);
    color: var(--text-secondary, #3d3d5c);
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    border-color: var(--accent-300, #c7d2fe);
    color: var(--accent-600, #4f46e5);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--accent-600, #4f46e5) 0%, var(--accent-500, #6366f1) 100%);
    border-color: var(--accent-500, #6366f1);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 二维码上传 */
.qrcode-upload-area {
    position: relative;
}

.qrcode-preview {
    position: relative;
    display: inline-block;
    border: 1px solid var(--border-light, #d1d5db);
    border-radius: 8px;
    padding: 8px;
    background: var(--bg-tertiary, #eef2f7);
}

.qrcode-preview img {
    max-width: 128px;
    max-height: 128px;
    display: block;
    border-radius: 4px;
}

.btn-remove-qrcode {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger, #ef4444);
    color: white;
    border: none;
    font-size: 16px;
    line-height: 22px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-remove-qrcode:hover {
    background: #dc2626;
}

.btn-ai-optimize {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    color: var(--accent-600, #4f46e5);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ai-optimize:hover {
    background: rgba(99, 102, 241, 0.2);
}

.prompt-input {
    background: var(--bg-secondary, #ffffff);
    border: 1px solid var(--border-light, #d1d5db);
    color: var(--text-primary, #1a1a2e);
    border-radius: 8px;
    resize: vertical;
    line-height: 1.6;
}

.prompt-input:focus {
    background: var(--bg-secondary, #ffffff);
    border-color: var(--accent-500, #6366f1);
    color: var(--text-primary, #1a1a2e);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.prompt-input::placeholder {
    color: var(--text-muted, #9ca3af);
}

/* 风格选择网格 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.style-item {
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.2s;
    aspect-ratio: 1 / 1;
}

.style-item.active {
    border-color: var(--accent-500, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.style-preview {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.style-preview .style-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 4px;
    text-align: center;
}

.more-item .style-preview {
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-text {
    color: #888;
    font-size: 0.75rem;
}

/* 尺寸选择 */
.size-section {
    margin-bottom: 24px;
}

.size-section-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.size-label,
.shape-label {
    font-size: 0.85rem;
    color: #aaa;
}

.aspect-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.aspect-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    background: var(--bg-tertiary, #eef2f7);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.aspect-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.aspect-item.active {
    border-color: var(--accent-500, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}

.aspect-box {
    background: var(--primary-500, #64748b);
    border-radius: 4px;
}

.aspect-box.square {
    width: 24px;
    height: 24px;
}

.aspect-box.vertical-sm {
    width: 16px;
    height: 24px;
}

.aspect-box.horizontal-sm {
    width: 24px;
    height: 16px;
}

.aspect-box.vertical {
    width: 18px;
    height: 24px;
}

.aspect-box.vertical-lg {
    width: 12px;
    height: 24px;
}

.aspect-box.horizontal-lg {
    width: 24px;
    height: 12px;
}

.aspect-box.vertical-md {
    width: 16px;
    height: 20px;
}

.aspect-box.horizontal-md {
    width: 20px;
    height: 16px;
}

.aspect-box.horizontal-xl {
    width: 28px;
    height: 14px;
}

.aspect-box.horizontal {
    width: 24px;
    height: 18px;
}

.aspect-box.vertical-xl {
    width: 8px;
    height: 28px;
}

.aspect-box.horizontal-xxl {
    width: 32px;
    height: 8px;
}

.aspect-box.vertical-xxl {
    width: 6px;
    height: 32px;
}

.aspect-box.horizontal-xxxl {
    width: 36px;
    height: 4px;
}

.aspect-box.vertical-xxxl {
    width: 4px;
    height: 36px;
}

.aspect-item span {
    font-size: 0.75rem;
    color: var(--text-secondary, #3d3d5c);
}

/* 质量选择 */
.quality-section {
    margin-top: 20px;
}

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quality-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #3d3d5c);
}

.points-info {
    font-size: 0.85rem;
    color: var(--text-secondary, #3d3d5c);
    display: flex;
    align-items: center;
    gap: 4px;
}

.point-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success, #10b981);
}

.quality-tabs {
    display: flex;
    background: var(--bg-tertiary, #eef2f7);
    border-radius: 20px;
    padding: 4px;
}

.quality-tab {
    flex: 1;
    text-align: center;
    padding: 6px 12px;
    border-radius: 16px;
    color: var(--text-secondary, #3d3d5c);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quality-tab.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-600, #4f46e5);
}

.quality-tab.selected {
    background: rgba(99, 102, 241, 0.25);
    color: var(--accent-600, #4f46e5);
}

.quality-badge {
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    margin-left: 4px;
}

.quality-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary, #6b7280);
    margin-top: 8px;
}

/* 生成按钮 */
.generate-section {
    text-align: center;
    margin-top: 30px;
}

.btn-generate {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(90deg, var(--accent-600, #4f46e5) 0%, var(--accent-500, #6366f1) 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-generate:active {
    transform: translateY(0);
}

.points-hint {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-tertiary, #6b7280);
}

/* 右侧预览面板 */
.preview-panel {
    position: sticky;
    top: 100px;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--card-border, #cbd5e1);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.preview-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light, #d1d5db);
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
}

.preview-content {
    background: var(--bg-primary, #f5f7fa);
    margin: 16px;
    border-radius: 12px;
    height: 530px;
    overflow-y: scroll;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-500, #6366f1) var(--bg-tertiary, #eef2f7);
}

.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary, #eef2f7);
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: var(--accent-500, #6366f1);
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-600, #4f46e5);
}

.preview-content canvas {
    display: block;
    max-width: 100%;
    border-radius: 8px;
}

.preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary, #6b7280);
    font-size: 0.9rem;
}

/* 装饰圆点 */
.drainage-page-container::before,
.drainage-page-container::after,
.content-wrapper::before,
.content-wrapper::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.03));
    opacity: 0.5;
    z-index: 0;
}

.drainage-page-container::before {
    width: 60px;
    height: 60px;
    top: 50px;
    left: 20px;
}

.content-wrapper::before {
    width: 40px;
    height: 40px;
    top: 300px;
    right: 40px;
}

.content-wrapper::after {
    width: 50px;
    height: 50px;
    bottom: 200px;
    right: 80px;
}

.drainage-page-container::after {
    width: 45px;
    height: 45px;
    bottom: 80px;
    right: 20px;
}

.preview-panel::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    top: 200px;
    left: 30px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.02));
    opacity: 0.4;
}

.preview-panel::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    bottom: 300px;
    right: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.02));
    opacity: 0.4;
}

.drainage-main {
    position: relative;
    z-index: 1;
}

/* 响应式 */
@media (max-width: 991.98px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
        order: -1;
    }

    .preview-content {
        aspect-ratio: 16 / 9;
    }

    .style-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .aspect-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 575.98px) {
    .main-title h1 {
        font-size: 2rem;
    }

    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .aspect-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .drainage-main {
        padding: 20px 0;
    }
}

/* 模板选择样式 */
.template-selection {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-group {
    margin-bottom: 16px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.template-item {
    border: 2px solid var(--border-light, #d1d5db);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: var(--bg-tertiary, #eef2f7);
}

.template-item:hover {
    border-color: var(--accent-300, #c7d2fe);
    background: rgba(99, 102, 241, 0.05);
}

.template-item.active {
    border-color: var(--accent-500, #6366f1);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.template-preview {
    width: 100%;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-preview img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* 更新预览按钮加载动画 */
@keyframes btn-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes btn-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.btn-updating {
    position: relative;
    pointer-events: none;
    cursor: not-allowed;
    animation: btn-pulse 1.2s ease-in-out infinite;
}

.btn-updating::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
}

/* 添加按钮样式 */
.add-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.05);
    border: 2px dashed rgba(99, 102, 241, 0.3);
    color: var(--accent-500, #6366f1);
}

.add-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
}

.add-btn svg {
    margin-bottom: 4px;
}

.add-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}



/* 响应式适配 */
@media (max-width: 991.98px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .template-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}