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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #FFE5E5 0%, #FFF9E5 50%, #FFE5F5 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 页面容器 */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.8s ease;
}

/* 可滚动页面 */
.page-scrollable {
    justify-content: flex-start !important;
    padding-top: 40px !important;
    padding-bottom: 40px !important;
    overflow-y: auto !important;
}

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

/* 欢迎页面 */
.welcome-section {
    text-align: center;
    max-width: 800px;
}

.capsule-icon {
    font-size: 120px;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

h1 {
    font-size: 48px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 20px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 300;
}

.date-info {
    font-size: 16px;
    color: #999;
    margin-bottom: 60px;
}

.highlight {
    color: #FFB6C1;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, #FFB6C1 0%, #FFC0CB 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.3);
    font-weight: 500;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 56px;
    line-height: 1.2;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 182, 193, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

/* 表单页面 */
.form-section {
    max-width: 600px;
    width: 100%;
}

.form-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.form-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.form-description {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 35px;
}

.form-group {
    margin-bottom: 25px;
}

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

label .required {
    color: #FFB6C1;
}

input, textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #FFB6C1;
    box-shadow: 0 0 0 4px rgba(255, 182, 193, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

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

.error-message {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.btn-submit {
    width: 100%;
    margin-top: 20px;
}

/* 展示页面 */
.display-section {
    width: 100%;
    max-width: 1400px;
}

.bottles-header {
    text-align: center;
    margin-bottom: 50px;
}

.bottles-title {
    font-size: 36px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.bottles-subtitle {
    font-size: 16px;
    color: #999;
}

.bottles-container {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.bottle {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 350px;
    animation: float-bottle 20s linear infinite;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    will-change: transform, left, opacity;
}

.bottle:hover {
    transform: scale(1.05);
    border-color: #FFB6C1;
    box-shadow: 0 15px 40px rgba(255, 182, 193, 0.3);
}

@keyframes float-bottle {
    0% {
        left: 100%;
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    95% {
        opacity: 0.3;
    }
    100% {
        left: -400px;
        opacity: 0;
    }
}

.bottle-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.bottle-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB6C1, #FFC0CB);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 12px;
    font-size: 18px;
}

.bottle-info {
    flex: 1;
}

.bottle-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.bottle-school {
    font-size: 13px;
    color: #999;
}

.bottle-content {
    margin-bottom: 12px;
}

.bottle-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.bottle-message {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottle-dream {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    font-style: italic;
}

.bottle-time {
    font-size: 11px;
    color: #ccc;
    text-align: right;
    margin-top: 10px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-text {
    font-size: 18px;
    color: #999;
    margin-bottom: 30px;
}

/* 感谢页面 */
.thank-section {
    text-align: center;
    max-width: 700px;
}

.thank-icon {
    font-size: 100px;
    margin-bottom: 30px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
        opacity: 0.8;
    }
}

.thank-title {
    font-size: 42px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.thank-message {
    font-size: 18px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 40px;
}

.thank-stats {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 600;
    color: #FFB6C1;
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.stat-unit {
    font-size: 18px;
    font-weight: 400;
    color: #999;
}

.stat-label {
    font-size: 14px;
    color: #999;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* 响应式设计 */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    h1 {
        font-size: 42px;
    }

    .form-container {
        padding: 45px 35px;
    }

    .bottles-container {
        height: 450px;
    }
}

/* 手机横屏和小平板 (481px - 768px) */
@media (max-width: 768px) {
    .page-container {
        padding: 15px;
    }

    h1 {
        font-size: 36px;
        letter-spacing: 1px;
    }

    .capsule-icon {
        font-size: 90px;
        margin-bottom: 20px;
    }

    .subtitle {
        font-size: 18px;
    }

    .date-info {
        font-size: 14px;
        margin-bottom: 40px;
    }

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

    .form-container {
        padding: 35px 25px;
        border-radius: 25px;
    }

    .form-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    input, textarea {
        padding: 14px 18px;
        font-size: 16px;
    }

    .bottles-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .bottles-container {
        height: 400px;
    }

    .bottle {
        min-width: 250px;
        max-width: 280px;
        padding: 20px;
    }

    .bottle-name {
        font-size: 16px;
    }

    .bottle-school {
        font-size: 12px;
    }

    .bottle-message, .bottle-dream {
        font-size: 13px;
    }

    .thank-icon {
        font-size: 80px;
        margin-bottom: 20px;
    }

    .thank-title {
        font-size: 32px;
    }

    .thank-message {
        font-size: 16px;
        padding: 0 10px;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .button-group .btn {
        width: 100%;
    }
}

/* 手机竖屏 (最大 480px) */
@media (max-width: 480px) {
    .page-container {
        padding: 15px 10px;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .capsule-icon {
        font-size: 70px;
        margin-bottom: 15px;
    }

    .subtitle {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .date-info {
        font-size: 13px;
        margin-bottom: 30px;
    }

    .btn {
        padding: 14px 35px;
        font-size: 15px;
        min-height: 50px;
    }

    .form-container {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .form-title {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    input, textarea {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 12px;
    }

    textarea {
        min-height: 80px;
    }

    .bottles-title {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .bottles-container {
        height: 350px;
    }

    .bottle {
        min-width: 220px;
        max-width: 260px;
        padding: 18px;
        border-radius: 15px;
    }

    .bottle-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .bottle-name {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .bottle-school {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .bottle-message, .bottle-dream {
        font-size: 12px;
        max-height: 70px;
    }

    .thank-icon {
        font-size: 70px;
        margin-bottom: 15px;
    }

    .thank-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .thank-message {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 30px;
        padding: 0 5px;
    }

    .thank-stats {
        padding: 20px;
    }

    .stat-number {
        font-size: 28px;
    }
}

/* 超小屏幕 (最大 360px) */
@media (max-width: 360px) {
    h1 {
        font-size: 24px;
    }

    .capsule-icon {
        font-size: 60px;
    }

    .form-container {
        padding: 25px 15px;
    }

    .form-title {
        font-size: 22px;
    }

    .bottle {
        min-width: 200px;
        max-width: 240px;
    }

    .bottles-container {
        height: 300px;
    }
}

/* 大屏幕优化 (1440px+) */
@media (min-width: 1440px) {
    h1 {
        font-size: 56px;
    }

    .capsule-icon {
        font-size: 140px;
    }

    .subtitle {
        font-size: 22px;
    }

    .date-info {
        font-size: 18px;
    }

    .btn {
        padding: 20px 60px;
        font-size: 20px;
    }

    .form-container {
        padding: 60px 50px;
        max-width: 700px;
    }

    .form-title {
        font-size: 36px;
    }

    .bottles-container {
        height: 600px;
    }

    .bottle {
        min-width: 350px;
        max-width: 400px;
    }

    .thank-title {
        font-size: 48px;
    }

    .thank-message {
        font-size: 20px;
        max-width: 700px;
    }
}

/* 漂流瓶展开状态 */
.bottle.expanded {
    z-index: 100;
}

.bottle.expanded .bottle-message,
.bottle.expanded .bottle-dream {
    max-height: none;
    overflow: visible;
}

/* 页面切换动画优化 */
@media (prefers-reduced-motion: reduce) {
    .page {
        transition: opacity 0.3s ease;
        transform: none !important;
    }
    
    .bottle {
        animation: none !important;
    }
}

/* 性能优化 */
.bottles-container {
    transform: translateZ(0);
    backface-visibility: hidden;
}
