@font-face {
    font-family: 'AlimamaFangYuanTi';
    src: url('../fonts/AlimamaFangYuanTiVF-Thin.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'AlimamaFangYuanTi', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 450;
    font-variation-settings: 'wght' 450;
    background: linear-gradient(135deg, #667eea 0%, #8067ff 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
}

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

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Logo */
.logo {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.logo img {
    display: block;
    width: min(220px, 56vw);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* 主标题 */
.main-title {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.main-title h1 {
    font-size: 28px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 步骤指示器 */
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    opacity: 0.5;
    transition: all 0.3s;
}

.step.active {
    opacity: 1;
}

.step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.3);
    z-index: -1;
}

.step:last-child::after {
    display: none;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step.active .step-number {
    background: white;
    color: #8067ff;
    box-shadow: 0 4px 15px rgba(255,255,255,0.4);
}

.step-text {
    font-size: 12px;
    color: white;
}

/* 内容区域 */
.content-area {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

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

.step-content h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
}

/* 祝福语模版 */
.nickname-area {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.nickname-group {
    flex: 1;
}

.nickname-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.nickname-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.nickname-group input:focus {
    outline: none;
    border-color: #8067ff;
}

.blessing-templates {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.template-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(128,103,255,0.3);
}

.template-card.selected {
    border-color: #8067ff;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

.template-card.diy {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.template-title {
    font-size: 16px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    color: #333;
    margin-bottom: 10px;
}

.template-preview {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    display: block;
    white-space: normal;
}

/* DIY输入区 */
.diy-input-area {
    margin-top: 20px;
    animation: fadeIn 0.5s;
}

.diy-input-area textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
}

.diy-input-area textarea:focus {
    outline: none;
    border-color: #8067ff;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 音乐搜索 */
.music-search {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #8067ff;
}

.btn-search {
    width: 45px;
    height: 45px;
    border: none;
    background: #8067ff;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(128,103,255,0.22);
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(128,103,255,0.28);
}

.btn-search::before {
    content: '';
    position: absolute;
    top: 11px;
    left: 11px;
    width: 14px;
    height: 14px;
    border: 2.5px solid #fff;
    border-radius: 50%;
}

.btn-search::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 25px;
    width: 10px;
    height: 2.5px;
    background: #fff;
    border-radius: 999px;
    transform: rotate(45deg);
    transform-origin: left center;
}

.search-results {
    max-height: 450px;
    overflow-y: auto;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 16px 15px;
    border-radius: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f5f6f8;
}

.song-item:hover {
    background: #edeef2;
    transform: translateX(3px);
}

.song-item.selected {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

.song-cover {
    width: 55px;
    height: 55px;
    border-radius: 10px;
    margin-right: 14px;
    object-fit: cover;
    flex-shrink: 0;
}

.song-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.song-name {
    font-size: 15px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.song-artist {
    font-size: 13px;
    color: #999;
}

/* 试听按钮 */
.btn-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #c084fc 0%, #e879a8 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 12px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(192,132,252,0.35);
    padding: 0;
}

.btn-preview:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(192,132,252,0.5);
}

.btn-preview:active {
    transform: scale(0.95);
}

.btn-preview.playing {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: previewPulse 1.5s ease-in-out infinite;
}

.btn-preview.loading {
    opacity: 0.6;
    pointer-events: none;
}

.preview-icon {
    display: block;
}

@keyframes previewPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(192,132,252,0.4); }
    50% { box-shadow: 0 4px 16px rgba(240,147,251,0.7); }
}

/* 暗号设置 */
.password-area {
    text-align: center;
}

.password-tip {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.password-area input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.password-area input:focus {
    outline: none;
    border-color: #8067ff;
}

/* 按钮 */
.btn-next, .btn-submit, .btn-back {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-next, .btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #8067ff 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(128,103,255,0.3);
}

.btn-next:hover, .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(128,103,255,0.4);
}

.btn-back {
    background: #f0f0f0;
    color: #666;
}

.btn-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.btn-group .btn-back {
    flex: 1;
    margin-bottom: 0;
}

.btn-group .btn-next,
.btn-group .btn-submit {
    flex: 1;
}

/* 成功弹窗 */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 350px;
    width: 90%;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #8067ff 100%);
    color: white;
    font-size: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-content h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
}

.modal-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.link-info {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
}

.btn-close {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #8067ff 100%);
    color: white;
    font-size: 16px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    cursor: pointer;
    margin-top: 10px;
}

.modal-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.modal-btn-group .btn-preview {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #8067ff 100%);
    color: white;
    font-size: 16px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    cursor: pointer;
    height: auto;
    box-shadow: none;
    margin-left: 0;
}

.btn-edit {
    width: 100%;
    padding: 12px;
    border: 2px solid #8067ff;
    border-radius: 25px;
    background: white;
    color: #8067ff;
    font-size: 16px;
    font-weight: 550;
    font-variation-settings: 'wght' 550;
    cursor: pointer;
}

.modal-btn-group .btn-close {
    margin-top: 0;
    background: #e0e0e0;
    color: #666;
}

/* 响应式 */
@media (max-width: 480px) {
    .main-title h1 {
        font-size: 24px;
    }

    .blessing-templates {
        grid-template-columns: 1fr;
    }

    .steps {
        padding: 0 10px;
    }

    .step-text {
        font-size: 10px;
    }
}
