/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏样式修复 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-brand h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-item {
    display: inline-block;
}

.nav-link {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: white;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

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

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-link.active::after {
    width: 80%;
}

/* 红心链接特殊样式 */
.nav-link[href*="hearts"] {
    background: rgba(231, 76, 60, 0.25);
    color: #ffcccc;
}

.nav-link[href*="hearts"]:hover {
    background: rgba(231, 76, 60, 0.35);
}

.nav-link[href*="hearts"].active {
    background: rgba(231, 76, 60, 0.4);
    color: white;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px auto;
    transition: 0.3s;
    border-radius: 2px;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.hero h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* 红心区域 */
.heart-section {
    margin: 2rem 0;
    text-align: center;
}

.heart-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-width: 140px;
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    color: #e74c3c;
    line-height: 1;
}

.heart-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.heart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

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

.heart-icon {
    font-size: 1.4rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

/* 红心表单 */
.heart-form-container {
    max-width: 450px;
    margin: 2rem auto;
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.heart-form {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border: 1px solid #eee;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 1.2rem;
    margin-top: 2rem;
}

.btn-submit, .btn-cancel {
    flex: 1;
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-cancel {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-cancel:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* 警告消息 */
.alert {
    padding: 1.2rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    animation: slideIn 0.3s ease;
    border-left: 4px solid transparent;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
    border-left-color: #28a745;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    border-left-color: #dc3545;
}

/* 最近红心区域 */
.recent-hearts {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.recent-hearts h3 {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

.hearts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

.heart-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.heart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.heart-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
}

.heart-user {
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.heart-time {
    font-size: 0.85rem;
    color: #666;
    background: rgba(0,0,0,0.03);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

/* 联系信息区域 */
.contact-section {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.contact-section h3 {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

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

.contact-item {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid #e9ecef;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    background: white;
    border-color: #667eea;
}

.contact-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-label::before {
    content: '•';
    color: #667eea;
    font-size: 1.2rem;
}

.contact-value {
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

.contact-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-link:hover {
    color: #764ba2;
    text-decoration: underline;
    transform: translateX(3px);
}

.contact-copy {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.contact-copy:active {
    transform: translateY(0);
}

/* 页脚样式 */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.footer-stats span {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-stats span::before {
    content: '📊';
    font-size: 0.9rem;
}

.footer-stats span:nth-child(2)::before {
    content: '❤️';
}

.footer-stats span:nth-child(3)::before {
    content: '👥';
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-copyright a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.footer-copyright a:hover {
    color: white;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        height: 60px;
    }
    
    .nav-brand h1 {
        font-size: 1.3rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        flex-direction: column;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        padding: 1rem 0;
        z-index: 999;
        border-top: 1px solid rgba(255,255,255,0.1);
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: block;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .nav-item {
        width: 100%;
        margin: 0.3rem 0;
    }
    
    .nav-link {
        padding: 1rem;
        border-radius: 0;
        text-align: left;
        padding-left: 2rem;
        border-left: 4px solid transparent;
    }
    
    .nav-link.active {
        border-left-color: white;
        background: rgba(255, 255, 255, 0.15);
    }
    
    .nav-link::after {
        display: none;
    }

    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }

    .heart-stats {
        gap: 1rem;
    }
    
    .stat-item {
        min-width: 120px;
        padding: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }

    .hearts-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .heart-item {
        padding: 1rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-item {
        padding: 1.2rem;
    }

    .footer-stats {
        gap: 0.8rem;
    }
    
    .footer-stats span {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        padding: 0 2rem;
    }
    
    .main-content {
        padding: 0 2rem;
    }
    
    .hearts-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* 大屏幕设备 */
@media (min-width: 1200px) {
    .nav-container, .main-content, .footer-content {
        max-width: 1200px;
    }
}

/* 打印样式 */
@media print {
    .navbar, .heart-btn, .contact-copy, .nav-toggle {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        min-height: auto;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .hero, .recent-hearts, .contact-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}