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

:root {
    --primary-color: #8b7a6b;
    --secondary-color: #d4b48c;
    --accent-color: #c49a6c;
    --bg-light: #fef9f0;
    --bg-white: #ffffff;
    --text-dark: #4a3b2c;
    --text-gray: #8b7a6b;
    --border-light: #e8dfd7;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #fff9f0 0%, #fef5e8 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
}

/* Header 头部导航 */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}

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

.logo {
    text-decoration: none;
}

.logo h1 {
    font-size: 26px;
    font-weight: 300;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #8b7a6b, #c49a6c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    font-size: 11px;
    color: var(--text-gray);
    letter-spacing: 2px;
    margin-top: 2px;
}

.nav {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #c49a6c, #b08968);
    color: white !important;
    padding: 8px 24px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary::after {
    display: none;
}

/* Hero 主视觉区 */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '🌸';
    position: absolute;
    font-size: 200px;
    opacity: 0.03;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.flower-icon {
    font-size: 64px;
    margin-bottom: 24px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

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

.hero h2 {
    font-size: 52px;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.hero p {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-top: 40px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 42px;
    font-weight: 300;
    color: var(--accent-color);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-gray);
    margin-top: 8px;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 36px;
    }
    
    .stats {
        gap: 40px;
    }
    
    .stat-number {
        font-size: 32px;
    }
}

/* Section 通用样式 */
.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 48px;
    position: relative;
    padding-bottom: 16px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

/* 纪念堂卡片网格 */
.memorial-gallery {
    padding: 60px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 20px;
}

.memorial-card {
    background: var(--bg-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

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

.card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: #f5f0eb;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.memorial-card:hover .card-image img {
    transform: scale(1.08);
}

.altar-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(74, 59, 44, 0.85);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
}

.card-content {
    padding: 20px;
}

.card-content h4 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.pet-info {
    color: var(--text-gray);
    font-size: 13px;
    margin-bottom: 8px;
}

.date {
    font-size: 12px;
    color: #b8a28c;
    margin-bottom: 12px;
}

.card-stats {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--accent-color);
}

.card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Features 特色区域 */
.features {
    padding: 60px 0;
    background: rgba(212, 180, 140, 0.08);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    text-align: center;
}

.feature {
    padding: 32px 24px;
    background: var(--bg-white);
    border-radius: 20px;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 52px;
    margin-bottom: 20px;
    display: inline-block;
}

.feature h4 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.feature p {
    color: var(--text-gray);
    font-size: 14px;
}

/* 认证表单页面 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 32px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

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

.auth-header h2 {
    font-size: 32px;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-gray);
    font-size: 14px;
}

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

.auth-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
}

.auth-form input,
.auth-form textarea,
.auth-form select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: 16px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(196, 154, 108, 0.1);
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #b08968);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--border-light);
    color: var(--text-dark);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-block {
    width: 100%;
}

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

.btn-small {
    padding: 8px 20px;
    font-size: 13px;
}

.alert {
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-error {
    background: #fff5f5;
    color: #e74c3c;
    border: 1px solid #ffe0e0;
}

.alert-success {
    background: #f0f9f0;
    color: #27ae60;
    border: 1px solid #d4ecd4;
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.auth-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

/* 纪念堂详情页 */
.memorial-page {
    padding: 40px 0 60px;
}

.memorial-container {
    background: var(--bg-white);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.altar-section {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
    padding: 48px;
}

.altar-image {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.altar-image img {
    width: 100%;
    height: auto;
    display: block;
}

.altar-code {
    display: inline-block;
    background: #f5f0eb;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.pet-name {
    font-size: 40px;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.pet-type {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 16px;
}

.lifespan {
    font-size: 14px;
    color: var(--accent-color);
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.memorial-desc {
    color: var(--text-gray);
    line-height: 1.8;
    margin: 20px 0;
    padding: 16px;
    background: #fef9f0;
    border-radius: 16px;
}

.stats-box {
    display: flex;
    gap: 32px;
    margin: 28px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fef9f0, #fff5e8);
    border-radius: 20px;
}

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

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 400;
    color: var(--accent-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 4px;
}

.action-buttons {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.action-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.candle-btn {
    background: #ffecd6;
    color: #b87c4a;
}

.candle-btn:hover {
    background: #ffe0c4;
    transform: translateY(-2px);
}

.flower-btn {
    background: #ffe8e5;
    color: #c98a6b;
}

.flower-btn:hover {
    background: #ffdbd6;
    transform: translateY(-2px);
}

.actions-section {
    padding: 40px 48px;
    border-top: 1px solid var(--border-light);
    background: #fefaf5;
}

.actions-section h3 {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.actions-list {
    max-height: 400px;
    overflow-y: auto;
}

.action-record {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-icon {
    font-size: 20px;
}

.action-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-dark);
}

.action-time {
    font-size: 12px;
    color: var(--text-gray);
}

.login-tip {
    text-align: center;
    padding: 20px;
    background: #f5f0eb;
    border-radius: 16px;
    margin-top: 20px;
}

.login-tip a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

@media (max-width: 768px) {
    .altar-section {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 24px;
    }
    
    .actions-section {
        padding: 24px;
    }
    
    .pet-name {
        font-size: 28px;
    }
    
    .stats-box {
        gap: 16px;
    }
}

/* 用户中心 */
.user-center {
    padding: 40px 0;
}

.user-profile {
    background: var(--bg-white);
    border-radius: 32px;
    padding: 40px;
    margin-bottom: 48px;
    box-shadow: var(--shadow-md);
}

.profile-card {
    display: flex;
    gap: 40px;
    align-items: center;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-color), #b08968);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.default-avatar {
    font-size: 48px;
    color: white;
}

.profile-info h3 {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 8px;
}

.profile-info p {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 12px;
}

.vip-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    margin: 12px 0;
}

.vip-active {
    background: linear-gradient(135deg, #ffd966, #ffc107);
    color: #8b4513;
}

.vip-inactive {
    background: #e8e0d8;
    color: var(--text-gray);
}

.balance {
    font-size: 24px;
    font-weight: 500;
    color: var(--accent-color);
    margin: 12px 0;
}

.profile-info .btn {
    margin-right: 12px;
    margin-top: 8px;
}

.user-memorials,
.recent-actions {
    margin-bottom: 48px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: 32px;
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: 20px;
}

/* 创建纪念堂表单 */
.create-memorial {
    padding: 40px 0;
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 32px;
    padding: 48px;
    box-shadow: var(--shadow-lg);
}

.form-title {
    font-size: 32px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 8px;
}

.form-subtitle {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 40px;
}

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

.memorial-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.photo-upload {
    border: 2px dashed var(--border-light);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.photo-upload:hover {
    border-color: var(--accent-color);
}

.photo-upload input {
    margin-bottom: 16px;
}

.photo-preview {
    margin-top: 16px;
}

.photo-preview img {
    max-width: 200px;
    border-radius: 12px;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 32px 24px;
    }
}

/* Modal 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-white);
    border-radius: 32px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-gray);
    transition: var(--transition);
}

.close:hover {
    color: var(--accent-color);
}

.modal-content h3 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 24px;
    text-align: center;
}

.recharge-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.recharge-option {
    background: #f5f0eb;
    padding: 14px;
    text-align: center;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.recharge-option:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.modal-content input {
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--border-light);
    border-radius: 16px;
    margin: 16px 0;
    font-size: 16px;
}

/* Footer 页脚 */
.footer {
    background: linear-gradient(135deg, #5e4a38, #4a3b2c);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 48px 0 32px;
    margin-top: 80px;
}

.footer p {
    margin-bottom: 8px;
    font-size: 14px;
}

.copyright {
    font-size: 12px;
    opacity: 0.6;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .header .container {
        padding: 12px 16px;
    }
    
    .nav {
        gap: 16px;
    }
    
    .nav-link {
        font-size: 13px;
    }
    
    .btn-primary {
        padding: 6px 16px;
    }
    
    .auth-card {
        padding: 32px 24px;
    }
    
    .profile-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b08968;
}