/* ===== 全局样式 ===== */
.danmaku-template {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: #333;
    line-height: 1.6;
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 头部样式 ===== */
.danmaku-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.danmaku-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,160L48,170.7C96,181,192,203,288,197.3C384,192,480,160,576,149.3C672,139,768,149,864,170.7C960,192,1056,224,1152,224C1248,224,1344,192,1392,176L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: center bottom;
}

.danmaku-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.danmaku-header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
    font-weight: 300;
}

/* 搜索框样式 */
.search-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    flex: 1;
}

.search-box:focus-within {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2), 0 0 0 3px rgba(37, 117, 252, 0.2);
}

#danmaku-search {
    flex: 1;
    padding: 18px 25px;
    border: none;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
    z-index: 10;
    position: relative;
}

#danmaku-search-btn {
    background: #2575fc;
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

#danmaku-search-btn:hover {
    background: #1a68e8;
}

#danmaku-search-btn svg {
    stroke: white;
}

.stats {
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 投稿按钮样式 */
.submit-btn {
    background: #fff;
    color: #2575fc;
    padding: 18px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: inline-block; /* 确保按钮为块级元素 */
    z-index: 10; /* 确保按钮在其他元素之上 */
}

.submit-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

/* ===== 内容区样式 ===== */
.danmaku-container {
    padding: 50px 0;
}

.danmaku-filters {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

#sort-by {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

#sort-by:hover {
    border-color: #6a11cb;
}

/* 弹幕列表样式 */
.danmaku-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    min-height: 300px;
}

.danmu-item {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.danmu-item:hover {
    background: #fafcff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.danmu-content {
    flex: 1;
    font-size: 1.1rem;
    color: #444;
    position: relative;
    padding-left: 15px;
}

.danmu-content::before {
    content: "“";
    position: absolute;
    left: 0;
    top: -5px;
    font-size: 2rem;
    color: #6a11cb;
    opacity: 0.2;
    font-family: serif;
}

.highlight {
    background-color: #fff9c4;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: bold;
}

.copy-btn {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.25);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(106, 17, 203, 0.3);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

/* 加载动画 */
.loading-animation {
    text-align: center;
    padding: 50px 0;
    display: none;
}

.loading-animation.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(106, 17, 203, 0.1);
    border-top: 5px solid #6a11cb;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.no-data {
    text-align: center;
    padding: 50px 20px;
    color: #777;
}

.no-data svg {
    width: 60px;
    height: 60px;
    stroke: #ddd;
    margin-bottom: 20px;
}

/* 分页样式 */
.danmaku-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 0 5px 10px;
    background: white;
    color: #444;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.page-btn:hover, .page-btn.active {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.2);
}

.page-btn.prev, .page-btn.next {
    width: auto;
    padding: 0 20px;
}

.page-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ===== 页脚样式 ===== */
.danmaku-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 50px;
}

/* ===== 复制通知 ===== */
.copy-notification {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.copy-notification.show {
    bottom: 30px;
    opacity: 1;
}

.copy-notification::before {
    content: "✓";
    font-size: 1.2rem;
    color: #4caf50;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .danmaku-header {
        padding: 40px 0 30px;
    }
    
    .danmaku-header h1 {
        font-size: 2.2rem;
    }
    
    .danmaku-header .subtitle {
        font-size: 1rem;
    }
    
    .search-container {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .submit-btn {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
    
    #danmaku-search {
        padding: 15px 20px;
        width: 100%;
        box-sizing: border-box;
        font-size: 1rem;
    }
    
    #danmaku-search-btn {
        width: auto;
        padding: 0 20px;
    }
    
    .danmu-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .copy-btn {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .danmu-content {
        padding-left: 25px;
    }
    
    .danmaku-filters {
        justify-content: center;
    }
    
    .page-btn.prev, .page-btn.next {
        padding: 0 15px;
        margin-bottom: 10px;
    }
    
    .danmaku-container {
        padding: 30px 0;
    }
}