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

:root {
    --primary-color: #ea580c;
    --primary-light: #fb923c;
    --primary-dark: #c2410c;
    --accent-color: #f59e0b;
    --bg-color: #fff7ed;
    --bg-secondary: #ffedd5;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #78716c;
    --border-color: #fed7aa;
    --shadow: 0 8px 30px rgba(234, 88, 12, 0.1);
    --shadow-lg: 0 20px 60px rgba(234, 88, 12, 0.15);
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(251, 146, 60, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(254, 215, 170, 0.5);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
}

.logo {
    font-family: 'Noto Serif SC', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '✉️';
    font-size: 28px;
    animation: float 3s ease-in-out infinite;
}

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

.logo:hover {
    transform: scale(1.05);
    text-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hero {
    padding: 120px 0;
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 50%, #ffedd5 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

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

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 64px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    animation: fadeInUp 0.8s ease;
}

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

.hero-subtitle {
    font-size: 22px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.btn {
    display: inline-block;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(234, 88, 12, 0.3);
    animation: fadeInUp 0.8s ease 0.4s both;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(234, 88, 12, 0.4);
}

.btn-large {
    padding: 20px 56px;
    font-size: 18px;
}

.features,
.how-it-works,
.write-section,
.letters-section,
.about-section {
    padding: 100px 0;
}

.section-title,
.page-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 40px;
    text-align: center;
    margin-bottom: 70px;
    color: var(--text-primary);
    position: relative;
}

.section-title::after,
.page-title::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--accent-color));
    border-radius: 2px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 36px;
}

.feature-card {
    background: var(--card-bg);
    padding: 48px 36px;
    border-radius: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(254, 215, 170, 0.3);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 64px;
    margin-bottom: 24px;
    display: inline-block;
    transition: transform 0.4s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
}

.step {
    text-align: center;
    padding: 40px 32px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(254, 215, 170, 0.3);
    transition: all 0.4s ease;
    position: relative;
}

.step:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 28px;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.25);
    transition: transform 0.4s ease;
}

.step:hover .step-number {
    transform: scale(1.1) rotate(10deg);
}

.step h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.letter-editor {
    max-width: 720px;
    margin: 0 auto;
}

.paper {
    background: var(--card-bg);
    padding: 56px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    border: 1px solid rgba(254, 215, 170, 0.4);
    overflow: hidden;
}

.paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--accent-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.paper::after {
    content: '';
    position: absolute;
    inset: 24px;
    border: 2px dashed rgba(254, 215, 170, 0.6);
    border-radius: 16px;
    pointer-events: none;
}

.form-group {
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 247, 237, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.1);
    background: white;
}

.form-group textarea {
    resize: vertical;
    line-height: 1.9;
    min-height: 200px;
}

.form-actions {
    text-align: center;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.letters-container {
    max-width: 900px;
    margin: 0 auto;
}

.letter-card {
    background: var(--card-bg);
    padding: 36px;
    border-radius: 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 5px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.letter-card::before {
    content: '✉️';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
    opacity: 0;
    font-size: 28px;
    transition: all 0.4s ease;
}

.letter-card:hover {
    transform: translateX(12px);
    box-shadow: var(--shadow-lg);
    border-left-width: 8px;
}

.letter-card:hover::before {
    opacity: 0.3;
    transform: translateY(-50%) translateX(0);
}

.letter-card.sent {
    border-left-color: #10b981;
}

.letter-card.sent::before {
    content: '📬';
}

.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.letter-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.letter-status {
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.letter-status.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: var(--primary-dark);
}

.letter-status.sent {
    background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
    color: #059669;
}

.letter-meta {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.8;
}

.letter-meta p {
    margin: 4px 0;
}

.letter-preview {
    color: var(--text-secondary);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 16px;
    background: rgba(255, 247, 237, 0.5);
    border-radius: 12px;
    margin-top: 12px;
}

.loading,
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 24px;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

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

.empty-state h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 28px;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-card {
    background: var(--card-bg);
    padding: 48px;
    border-radius: 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(254, 215, 170, 0.3);
    transition: all 0.4s ease;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.about-card h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: 26px;
    margin-bottom: 24px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.about-card p {
    margin-bottom: 16px;
    line-height: 1.9;
    color: var(--text-secondary);
}

.about-list {
    list-style: none;
}

.about-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.about-list li:last-child {
    border-bottom: none;
}

.about-list strong {
    color: var(--primary-color);
    font-weight: 600;
}

.about-card code {
    background: rgba(254, 215, 170, 0.4);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary-dark);
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: var(--card-bg);
    padding: 56px;
    border-radius: 28px;
    max-width: 520px;
    width: 100%;
    position: relative;
    text-align: center;
    animation: modalIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(254, 215, 170, 0.4);
}

.modal-large {
    max-width: 720px;
    text-align: left;
    padding: 48px;
}

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

.close {
    position: absolute;
    right: 24px;
    top: 20px;
    font-size: 36px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--primary-color);
    background: rgba(234, 88, 12, 0.1);
}

.modal-icon {
    font-size: 80px;
    margin-bottom: 28px;
    display: inline-block;
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.modal-content h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: 30px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.8;
    font-size: 16px;
}

.footer {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 80px;
    border-top: 1px solid rgba(254, 215, 170, 0.5);
}

.footer p {
    font-size: 15px;
}

/* 认证页面样式 */
.auth-section {
    padding: 80px 0;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.auth-container {
    max-width: 480px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 48px;
}

.auth-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.auth-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 36px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.auth-form {
    background: var(--card-bg);
    padding: 48px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(254, 215, 170, 0.4);
}

.auth-form .form-group {
    margin-bottom: 28px;
}

.auth-form .form-group label {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 15px;
}

.auth-form .form-group input {
    background: rgba(255, 247, 237, 0.5);
    transition: all 0.3s ease;
}

.auth-form .form-group input:focus {
    background: white;
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.1);
}

.auth-form .form-actions {
    margin-top: 36px;
}

.auth-switch {
    text-align: center;
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 15px;
}

.auth-switch a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.auth-switch a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* 用户信息下拉菜单 */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(254, 215, 170, 0.4);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    color: var(--text-primary);
    text-decoration: none;
}

.user-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
    color: #dc2626;
}

.user-dropdown-item:hover {
    background: rgba(254, 215, 170, 0.3);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }
    
    .nav-links {
        gap: 16px;
        font-size: 14px;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 16px;
    }
    
    .paper {
        padding: 24px;
    }
    
    .section-title,
    .page-title {
        font-size: 28px;
    }
}
