/* ==================== 贺卡制作页面样式 ==================== */

/* 字体定义 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ==================== 悬浮提示弹窗 ==================== */
.floating-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.floating-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.floating-toast .toast-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 80px -20px rgba(96, 165, 250, 0.3);
    min-width: 280px;
}

.toast-loader {
    position: relative;
    width: 60px;
    height: 60px;
}

.toast-loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(96, 165, 250, 0.2);
    border-radius: 50%;
    animation: toastPulse 2s ease-in-out infinite;
}

.toast-loader-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    border-radius: 50%;
    animation: toastCore 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
}

.toast-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.toast-message {
    font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #f1f5f9;
    letter-spacing: 0.05em;
}

.toast-submessage {
    font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
    font-size: 0.85rem;
    color: #94a3b8;
    animation: toastDots 1.5s ease-in-out infinite;
}

@keyframes toastPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.6;
    }
}

@keyframes toastCore {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.85);
    }
}

@keyframes toastDots {
    0%, 20% {
        content: '请稍候';
    }
    40% {
        content: '请稍候.';
    }
    60% {
        content: '请稍候..';
    }
    80%, 100% {
        content: '请稍候...';
    }
}

/* Toast成功样式 */
.floating-toast.success .toast-content {
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.95), rgba(21, 128, 61, 0.98));
    border-color: rgba(74, 222, 128, 0.3);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 80px -20px rgba(74, 222, 128, 0.3);
}

.floating-toast.success .toast-loader-core {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.floating-toast.success .toast-loader-ring {
    border-color: rgba(74, 222, 128, 0.2);
}

/* Toast错误样式 */
.floating-toast.error .toast-content {
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.95), rgba(220, 38, 38, 0.98));
    border-color: rgba(252, 165, 165, 0.3);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 80px -20px rgba(252, 165, 165, 0.3);
}

.floating-toast.error .toast-loader-core {
    background: linear-gradient(135deg, #fca5a5, #ef4444);
    box-shadow: 0 0 20px rgba(252, 165, 165, 0.5);
}

.floating-toast.error .toast-loader-ring {
    border-color: rgba(252, 165, 165, 0.2);
}

/* 页面容器 */
.page-card-maker {
    padding-bottom: 3rem;
    min-height: 100vh;
}

/* 头部区域 */
.card-maker-header {
    text-align: center;
    padding: 1.5rem var(--spacing-md) 1rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.nav-back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s ease-out;
    white-space: nowrap;
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.02);
}

.nav-back-btn svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.card-maker-title {
    font-family: 'Playfair Display', 'Noto Serif SC', serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.title-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    stroke: #fbbf24;
    fill: rgba(251, 191, 36, 0.2);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
    animation: starPulse 3s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 尊重用户的motion偏好 */
@media (prefers-reduced-motion: reduce) {
    .title-icon { animation: none; }
    .card-maker-title { animation: none; }
}

.card-maker-subtitle {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* 主容器 */
.card-maker-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    align-items: start;
}

@media (max-width: 900px) {
    .card-maker-container {
        grid-template-columns: 1fr;
    }
}

/* ==================== 左侧配置区 ==================== */
.card-config-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 配置卡片 - Glassmorphism风格 */
.config-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease-out;
}

.config-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .config-card:hover {
        transform: none;
    }
}

.config-title {
    font-family: 'Playfair Display', 'Noto Serif SC', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.05em;
}

.config-title::before {
    content: '';
    width: 5px;
    height: 22px;
    background: linear-gradient(180deg, #60a5fa, #a78bfa);
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.4);
}

/* ==================== 模板选择 ==================== */
.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

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

.template-item {
    aspect-ratio: 3/4;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.template-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.template-item.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px var(--accent-glow), 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    font-size: 0.7rem;
    color: white;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ==================== 字体模板选择 ==================== */
.font-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

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

.font-item {
    aspect-ratio: 1/1;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.font-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.font-item.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow), 0 4px 15px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(99,102,241,0.08));
}

.font-preview {
    color: var(--text-primary);
    line-height: 1.2;
    transition: color var(--transition-fast);
}

.font-item.active .font-preview {
    color: var(--accent-cyan);
}

.font-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    font-family: var(--font-body);
}

.font-item.active .font-label {
    color: var(--accent-primary);
}

/* ==================== 输入框 ==================== */
.input-group {
    margin-bottom: 1.2rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

/* 横版左右并排布局 */
.style-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.input-group-half {
    flex: 1;
    margin-bottom: 0;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.input-field {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s ease-out;
}

.input-field:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.input-field:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.input-field::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

/* 下拉菜单选项样式 */
.input-field option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.6rem 1rem;
}

select.input-field {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
    line-height: 1.7;
}

/* ==================== 贺语推荐 ==================== */
.message-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.suggestion-tag {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
}

.suggestion-tag:hover {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

/* ==================== 日期选择 ==================== */
.date-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.date-select {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ==================== 按钮 ==================== */
.btn-primary {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: 'Playfair Display', 'Noto Serif SC', serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(147, 51, 234, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary:hover:not(:disabled) {
        transform: none;
    }
    .btn-primary::before {
        display: none;
    }
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.85rem 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .btn-secondary:hover {
        transform: none;
    }
}

.btn-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.btn-row .btn-primary,
.btn-row .btn-secondary {
    flex: 1;
}

/* ==================== 右侧预览区 ==================== */
.card-preview-section {
    position: sticky;
    top: 2rem;
}

.preview-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.preview-title {
    font-family: 'Playfair Display', 'Noto Serif SC', serif;
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* ==================== 贺卡预览框 ==================== */
.card-preview-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;  /* 默认8寸尺寸竖版 3:4 */
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ==================== 通用贺卡样式 ==================== */
.card-template-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-text-area {
    flex: 2; /* 占2/9 */
    padding: 6% 5%;
    background: #ffffff;
    position: relative;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-image-area {
    flex: 6; /* 占6/9 */
    overflow: hidden;
    position: relative;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-footer-area {
    flex: 1; /* 占1/9 */
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
}

/* ==================== 模板1: 星光璀璨 ==================== */
.card-template-1 .card-image-area {
    background: #ffffff;
}

.card-template-1 .card-text-area {
    background: #ffffff;
    padding: 6% 5%;
}

.card-template-1 .card-birthday-name {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.6em;
    color: #333333;
    margin-bottom: 0.2em;
    letter-spacing: 0.1em;
}

.card-template-1 .card-birthday-date {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 0.8em;
    color: #666666;
    margin-bottom: 0.6em;
    letter-spacing: 0.15em;
}

.card-template-1 .card-message {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 0.85em;
    color: #444444;
    line-height: 1.6;
    letter-spacing: 0.08em;
}

.card-template-1 .card-footer-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.55em;
    color: #999999;
    letter-spacing: 0.2em;
}

/* ==================== 模板2: 星河浪漫 ==================== */
.card-template-2 .card-image-area {
    background: #ffffff;
}

.card-template-2 .card-text-area {
    background: #ffffff;
    padding: 6% 5%;
}

.card-template-2 .card-birthday-name {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.6em;
    color: #333333;
    margin-bottom: 0.2em;
    letter-spacing: 0.1em;
}

.card-template-2 .card-birthday-date {
    font-family: 'Noto Serif SC', serif;
    font-size: 0.8em;
    color: #666666;
    margin-bottom: 0.6em;
    letter-spacing: 0.2em;
}

.card-template-2 .card-message {
    font-family: 'Noto Serif SC', serif;
    font-size: 0.85em;
    color: #444444;
    line-height: 1.6;
    letter-spacing: 0.1em;
}

.card-template-2 .card-footer-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.55em;
    color: #999999;
    letter-spacing: 0.25em;
}

/* ==================== 模板3: 极夜星空 ==================== */
.card-template-3 .card-image-area {
    background: #ffffff;
}

.card-template-3 .card-text-area {
    background: #ffffff;
    padding: 6% 5%;
}

.card-template-3 .card-birthday-name {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.6em;
    color: #333333;
    margin-bottom: 0.2em;
}

.card-template-3 .card-birthday-date {
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 0.8em;
    color: #666666;
    margin-bottom: 0.6em;
    letter-spacing: 0.15em;
}

.card-template-3 .card-message {
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 0.85em;
    color: #444444;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

.card-template-3 .card-footer-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.55em;
    color: #999999;
    letter-spacing: 0.2em;
}

/* ==================== 模板4: 复古星尘 ==================== */
.card-template-4 .card-image-area {
    background: #ffffff;
}

.card-template-4 .card-text-area {
    background: #ffffff;
    padding: 6% 5%;
}

.card-template-4 .card-birthday-name {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.6em;
    color: #333333;
    margin-bottom: 0.2em;
}

.card-template-4 .card-birthday-date {
    font-family: 'Noto Serif SC', serif;
    font-size: 0.8em;
    color: #666666;
    margin-bottom: 0.6em;
    letter-spacing: 0.15em;
}

.card-template-4 .card-message {
    font-family: 'Noto Serif SC', serif;
    font-size: 0.85em;
    color: #444444;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

.card-template-4 .card-footer-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.55em;
    color: #999999;
    letter-spacing: 0.2em;
}

/* ==================== 字体模板类 ==================== */
/* 宋体 */
.card-font-songti .card-birthday-name,
.card-font-songti .card-birthday-date,
.card-font-songti .card-message {
    font-family: 'SimSun', '宋体', 'Noto Serif SC', serif;
}

/* 楷体 */
.card-font-kaiti .card-birthday-name,
.card-font-kaiti .card-birthday-date,
.card-font-kaiti .card-message {
    font-family: 'KaiTi', '楷体', 'Noto Serif SC', serif;
}

/* 行楷 */
.card-font-xingkai .card-birthday-name,
.card-font-xingkai .card-birthday-date,
.card-font-xingkai .card-message {
    font-family: 'ZCOOL XiaoWei', 'KaiTi', serif;
}

/* 行书 */
.card-font-xingshu .card-birthday-name,
.card-font-xingshu .card-birthday-date,
.card-font-xingshu .card-message {
    font-family: 'Liu Jian Mao Cao', 'KaiTi', cursive;
}

/* 草书 */
.card-font-caoshu .card-birthday-name,
.card-font-caoshu .card-birthday-date,
.card-font-caoshu .card-message {
    font-family: 'Ma Shan Zheng', 'KaiTi', cursive;
}

/* 隶书 */
.card-font-lishu .card-birthday-name,
.card-font-lishu .card-birthday-date,
.card-font-lishu .card-message {
    font-family: 'Long Cang', 'KaiTi', cursive;
}

/* 魏碑 */
.card-font-weibei .card-birthday-name,
.card-font-weibei .card-birthday-date,
.card-font-weibei .card-message {
    font-family: 'Zhi Mang Xing', 'KaiTi', cursive;
}

/* 手写体 */
.card-font-shouxie .card-birthday-name,
.card-font-shouxie .card-birthday-date,
.card-font-shouxie .card-message {
    font-family: 'ZCOOL QingKe HuangYou', 'KaiTi', cursive;
}

/* ==================== 分享区域 ==================== */
.share-section {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.share-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.share-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.share-links {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
}

.share-qr {
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.share-url {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
}

.share-url input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.share-url input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.share-url button {
    padding: 0.75rem 1.2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.share-url button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

/* ==================== 图片预览区域 ==================== */
#imagePreview {
    position: relative !important;
    width: 100% !important;
    height: 120px !important;
    background: #1a1a2e !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden !important;
}

/* ==================== 加载状态 ==================== */
#imagePreview .loading-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-sm) !important;
    z-index: 100 !important;
}

#imagePreview .loading-overlay .loading-spinner {
    width: 40px !important;
    height: 40px !important;
    border: 3px solid #ffffff !important;
    border-top-color: #4a9eff !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

#imagePreview .loading-overlay p {
    color: #ffffff !important;
    margin-top: 12px !important;
    font-size: 0.85rem !important;
    text-align: center !important;
    padding: 0 10px !important;
    line-height: 1.4 !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 空图片提示 ==================== */
.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
    .card-maker-header {
        padding: 2rem var(--spacing-md) 1rem;
    }

    .nav-back-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem 0.4rem 0.6rem;
    }

    .card-maker-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .title-icon {
        font-size: 1.5rem;
    }

    .card-maker-subtitle {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .config-card {
        padding: 1.2rem;
    }

    /* 横版布局在移动端改为垂直 */
    .style-row {
        flex-direction: column;
        gap: 1.2rem;
    }

    .template-grid {
        gap: 0.5rem;
    }

    .btn-row {
        flex-direction: column;
    }

    .share-url {
        flex-direction: column;
    }
}