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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e8e8e8;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 粒子背景 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.nav-logo h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #e8e8e8;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

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

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

/* 主要内容区域 */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* 欢迎区域 */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.hero-content {
    max-width: 800px;
    width: 100%;
}

.hero-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3.5rem;
    color: #ffd700;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #b8b8b8;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* 许愿区域 */
.wish-container {
    position: relative;
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#wishText {
    width: 100%;
    min-height: 120px;
    padding: 1.5rem;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: #e8e8e8;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

#wishText:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

#wishText::placeholder {
    color: #888;
}

.wish-counter {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.9rem;
    color: #888;
}

/* 抽签按钮 */
.draw-section {
    margin-top: 3rem;
}

.draw-button {
    position: relative;
    padding: 1.5rem 3rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a2e;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.draw-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.4);
}

.draw-button:active {
    transform: translateY(0);
}

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

.draw-button:hover .btn-glow {
    left: 100%;
}

.draw-hint {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.3rem;
    color: #ffd700;
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    font-size: 1rem;
    color: #b8b8b8;
}

/* 结果区域 */
.result-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.result-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: resultSlideIn 0.5s ease-out;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.result-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    color: #ffd700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ffd700;
}

/* 签文卡片 */
.sign-card {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.sign-image-container {
    flex-shrink: 0;
}

.sign-image {
    width: 150px;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.sign-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.sign-number {
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 1rem;
}

.sign-number .number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 0.5rem;
}

.sign-name {
    font-size: 1.8rem;
    color: #e8e8e8;
    font-weight: 600;
    line-height: 1.4;
}

/* 签文详情 */
.sign-details {
    margin-bottom: 2rem;
}

.detail-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 4px solid #ffd700;
}

.detail-section h4 {
    font-size: 1.2rem;
    color: #ffd700;
    margin-bottom: 1rem;
    font-weight: 600;
}

.detail-section p {
    line-height: 1.8;
    color: #e8e8e8;
    font-size: 1rem;
}

.annotate-text {
    font-style: italic;
    color: #d4d4aa;
}

.explain-text {
    color: #e8e8e8;
}

.details-text {
    color: #b8b8b8;
    font-size: 0.95rem;
}

.source-text {
    color: #a8a8a8;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 操作按钮 */
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid #ffd700;
    background: transparent;
    color: #ffd700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.action-btn:hover {
    background: #ffd700;
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* 历史记录 */
.history-section,
.about-section {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    color: #ffd700;
    text-align: center;
    margin-bottom: 3rem;
}

.history-list {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.4);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-date {
    color: #888;
    font-size: 0.9rem;
}

.history-wish {
    color: #b8b8b8;
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.history-result {
    color: #ffd700;
    font-weight: 600;
}

.clear-history-btn {
    display: block;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-2px);
}

/* 关于页面 */
.about-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #e8e8e8;
    font-size: 1.1rem;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    max-width: 500px;
    width: 100%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.modal-header h3 {
    color: #ffd700;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ffd700;
}

.modal-body {
    padding: 1.5rem;
}

.share-preview {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.share-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.share-option {
    padding: 0.8rem 1.5rem;
    border: 2px solid #ffd700;
    background: transparent;
    color: #ffd700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.share-option:hover {
    background: #ffd700;
    color: #1a1a2e;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.9);
    color: #1a1a2e;
    padding: 1rem 2rem;
    border-radius: 25px;
    z-index: 3000;
    animation: toastSlideIn 0.3s ease-out;
    font-weight: 500;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 底部 */
.footer {
    background: rgba(26, 26, 46, 0.8);
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-content p {
    color: #888;
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.9rem;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .sign-card {
        flex-direction: column;
        text-align: center;
    }
    
    .sign-image {
        width: 120px;
        height: 160px;
        margin: 0 auto;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .share-options {
        flex-direction: column;
    }
    
    .share-option {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .draw-button {
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
    }
    
    .result-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .sign-number .number {
        font-size: 2rem;
    }
    
    .sign-name {
        font-size: 1.5rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

/* 隐藏元素的通用类 */
.hidden {
    display: none !important;
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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