/* ========================================
   Dating with me — 完整样式表
   ======================================== */

/* ===== 1. Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 30%, #e8eaf6 60%, #fff3e0 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    min-height: 100vh;
}

/* ===== 2. 背景花瓣 ===== */
#petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.petal {
    position: absolute;
    top: -30px;
    width: 18px;
    height: 18px;
    background: radial-gradient(ellipse at 30% 30%, #f8bbd0, #ec407a);
    border-radius: 50% 0 50% 0;
    opacity: 0.6;
    animation: petalFall linear infinite;
}

@keyframes petalFall {
    0% {
        transform: translateY(-30px) rotate(0deg) scale(1);
        opacity: 0.7;
    }
    25% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
    }
    75% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.4);
        opacity: 0;
    }
}

/* ===== 3. 爱心爆炸容器 ===== */
#hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.exploding-heart {
    position: absolute;
    font-size: 24px;
    animation: heartExplode 1.2s ease-out forwards;
    pointer-events: none;
}

@keyframes heartExplode {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1.2) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--tx) * 1.5), calc(var(--ty) * 1.5)) scale(0.3) rotate(360deg);
    }
}

/* ===== 4. 毛玻璃卡片 ===== */
.card {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 40px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(233, 30, 99, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* ===== 5. 步骤切换 & 进度条 ===== */
.step {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: block;
}

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

/* 步骤进度条 */
.progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    gap: 0;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.12);
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.progress-dot.active {
    background: #ec407a;
    box-shadow: 0 0 8px rgba(236, 64, 122, 0.4);
    transform: scale(1.3);
}

.progress-dot.done {
    background: #f48fb1;
}

.progress-line {
    width: 28px;
    height: 2px;
    background: rgba(0, 0, 0, 0.08);
    transition: background 0.4s ease;
    flex-shrink: 0;
}

.progress-line.done {
    background: #f48fb1;
}

/* ===== 6. 头像 ===== */
.avatar {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    margin: 0 auto 20px;
    overflow: hidden;
    background: rgba(248, 187, 208, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.15);
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== 7. 排版 ===== */
h1 {
    font-size: 30px;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #666;
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* 打字机光标 */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background: #ec407a;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== 8. 按钮 ===== */
.btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn {
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

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

.btn-primary {
    background: linear-gradient(135deg, #ec407a, #e91e63);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    border: 2px solid rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 5;
    /* 逃跑时用 transform 移动，不影响布局 */
    will-change: transform;
}

.btn-secondary:hover {
    background: white;
    border-color: #ec407a;
    color: #ec407a;
}

.btn-back {
    display: block;
    margin: 12px auto 0;
    padding: 8px 20px;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #999;
    transition: all 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-back:hover {
    color: #ec407a;
    background: rgba(236, 64, 122, 0.06);
}

.restart-btn {
    margin-top: 20px;
    padding: 12px 28px;
    font-size: 15px;
    animation: none !important;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
}

.next-btn {
    width: 100%;
    margin-top: 8px;
    padding: 16px;
    font-size: 18px;
    animation: btnBounce 2s ease-in-out infinite;
}

@keyframes btnBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ===== 9. 表单元素 ===== */
.form-item {
    margin-bottom: 22px;
    text-align: left;
}

.form-item label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
    font-size: 15px;
}

.form-item input,
.form-item select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    font-size: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-item input:focus {
    border-color: #ec407a;
    background: white;
    box-shadow: 0 0 0 4px rgba(236, 64, 122, 0.15);
}

.form-item input[type="date"] {
    min-height: 52px;
    cursor: pointer;
}

/* ===== 10. 时间滚轮 ===== */
.time-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 4px 0;
}

.wheel-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 110px;
}

.wheel-btn {
    width: 100%;
    padding: 8px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #e91e63;
    line-height: 1;
    margin: 6px 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.wheel-btn:active {
    background: #fce4ec;
    transform: scale(0.95);
}

.wheel-wrap {
    position: relative;
    width: 100%;
}

.wheel-viewport {
    height: 266px;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    position: relative;
}

.wheel-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.wheel-item {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.15s ease, font-size 0.15s ease;
}

.wheel-item.active {
    color: #880e4f;
    font-size: 26px;
    font-weight: 800;
}

.wheel-highlight {
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    height: 38px;
    transform: translateY(-50%);
    background: rgba(248, 187, 208, 0.5);
    border-radius: 10px;
    border-top: 2px solid #ec407a;
    border-bottom: 2px solid #ec407a;
    pointer-events: none;
    z-index: 1;
}

.wheel-overlay-top,
.wheel-overlay-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 96px;
    pointer-events: none;
    z-index: 2;
}

.wheel-overlay-top {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, transparent 100%);
    border-radius: 14px 14px 0 0;
}

.wheel-overlay-bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, transparent 100%);
    border-radius: 0 0 14px 14px;
}

.wheel-sep {
    font-size: 30px;
    font-weight: 700;
    color: #333;
    padding: 0 4px;
    margin-top: 74px;
    align-self: flex-start;
}

/* ===== 11. 选择网格（地点/美食） ===== */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.selection-item {
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 18px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.selection-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(236, 64, 122, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.selection-item:active::after {
    width: 300px;
    height: 300px;
}

.selection-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.12);
    border-color: #ec407a;
}

.selection-item.selected {
    background: rgba(236, 64, 122, 0.12);
    border-color: #ec407a;
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.18);
}

.selection-icon {
    font-size: 32px;
    margin-bottom: 6px;
    transition: transform 0.3s ease;
}

.selection-item:hover .selection-icon {
    transform: scale(1.15);
}

.selection-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.selection-desc {
    font-size: 11px;
    color: #999;
}

/* ===== 12. 电影票邀请函 ===== */
.ticket {
    background: linear-gradient(145deg, #fff5f7, #fff);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(233, 30, 99, 0.15);
    border: 2px solid rgba(236, 64, 122, 0.2);
    animation: ticketFloat 3s ease-in-out infinite;
    position: relative;
}

.ticket::before,
.ticket::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%);
    transform: translateX(-50%);
    z-index: 2;
}

.ticket::before {
    top: -14px;
}

.ticket::after {
    bottom: -14px;
}

@keyframes ticketFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.ticket-header {
    background: linear-gradient(135deg, #ec407a, #e91e63);
    color: white;
    padding: 24px 20px 18px;
    text-align: center;
    position: relative;
}

.ticket-stars {
    font-size: 12px;
    letter-spacing: 6px;
    opacity: 0.7;
    margin-bottom: 6px;
}

.ticket-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 4px;
}

.ticket-body {
    padding: 24px 24px 20px;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.ticket-label {
    font-size: 15px;
    color: #999;
    font-weight: 500;
}

.ticket-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.ticket-divider {
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        #e0e0e0 0px,
        #e0e0e0 4px,
        transparent 4px,
        transparent 8px
    );
}

.ticket-footer {
    padding: 16px 24px 24px;
    text-align: center;
    border-top: 2px dashed rgba(236, 64, 122, 0.2);
}

.ticket-qr {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    animation: heartPulse 1.5s ease-in-out infinite;
}

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

.ticket-message {
    font-size: 16px;
    font-weight: 700;
    color: #e91e63;
    letter-spacing: 2px;
}

.hearts-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    font-size: 20px;
    animation: heartsRowFloat 2s ease-in-out infinite;
}

@keyframes heartsRowFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.hearts-row span {
    animation: heartPop 1s ease-in-out infinite alternate;
}

.hearts-row span:nth-child(2) { animation-delay: 0.2s; }
.hearts-row span:nth-child(3) { animation-delay: 0.4s; }
.hearts-row span:nth-child(4) { animation-delay: 0.6s; }
.hearts-row span:nth-child(5) { animation-delay: 0.8s; }

@keyframes heartPop {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

/* ===== 13. 额外动画工具 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 14. 响应式 - 平板 ===== */
@media (max-width: 768px) {
    .card {
        padding: 32px 22px;
        max-width: 400px;
    }

    h1 {
        font-size: 26px;
    }

    .avatar {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .btn {
        padding: 12px 28px;
        font-size: 15px;
    }

    .selection-grid {
        gap: 10px;
    }

    .selection-item {
        padding: 14px 6px;
    }

    .selection-icon {
        font-size: 26px;
    }

    .ticket-body {
        padding: 20px 18px 16px;
    }

    .ticket-value {
        font-size: 16px;
    }
}

/* ===== 15. 响应式 - 手机 ===== */
@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .card {
        padding: 28px 18px;
        border-radius: 22px;
        max-width: 100%;
    }

    h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 22px;
    }

    .avatar {
        width: 72px;
        height: 72px;
        font-size: 36px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .btn-group {
        gap: 12px;
    }

    .next-btn {
        padding: 14px;
        font-size: 16px;
    }

    .progress-line {
        width: 18px;
    }

    .progress-dot {
        width: 8px;
        height: 8px;
    }

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

    .selection-item {
        padding: 12px 4px;
        border-radius: 14px;
    }

    .selection-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .selection-name {
        font-size: 12px;
    }

    .selection-desc {
        font-size: 10px;
    }

    .wheel-viewport {
        height: 266px;
    }

    .wheel-col {
        max-width: 90px;
    }

    .wheel-sep {
        margin-top: 62px;
        font-size: 26px;
    }

    .ticket-title {
        font-size: 18px;
    }

    .ticket-value {
        font-size: 15px;
    }

    .ticket-label {
        font-size: 13px;
    }

    .ticket-body {
        padding: 16px 14px 14px;
    }

    .form-item input,
    .form-item select {
        padding: 12px 14px;
        font-size: 15px;
    }
}

/* ===== 16. 针对小屏手机微调 ===== */
@media (max-width: 360px) {
    .card {
        padding: 20px 14px;
    }

    h1 {
        font-size: 20px;
    }

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

    .selection-item {
        padding: 10px 2px;
    }

    .wheel-col {
        max-width: 76px;
    }

    .wheel-viewport {
        height: 200px;
    }
}
