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

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background: #E6F0FF;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0 20px;
}

header h1 {
    color: #2c5aa0;
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.subtitle {
    color: #6b8cae;
    font-size: 1rem;
}

.back-link {
    display: inline-block;
    color: #4A90E2;
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.back-link:hover { text-decoration: underline; }

/* 导航卡片 */
.main-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.nav-card {
    display: block;
    background: linear-gradient(135deg, #4A90E2, #7ab8ff);
    color: #fff;
    text-align: center;
    padding: 16px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
    transition: transform 0.2s;
}

.nav-card:hover {
    transform: translateY(-3px);
}

/* 上传区 */
.upload-section { margin-bottom: 30px; }

.upload-box {
    background: #fff;
    border: 3px dashed #4A90E2;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-box:hover {
    background: #f5fbff;
    border-color: #2c5aa0;
    transform: scale(1.01);
}

.upload-box.dragover {
    background: #dbeaff;
    border-color: #2c5aa0;
}

.upload-icon { font-size: 3rem; margin-bottom: 8px; }

.upload-content p { color: #555; font-size: 1.1rem; }

.upload-hint { color: #999; font-size: 0.85rem !important; margin-top: 4px; }

.upload-status {
    margin-top: 12px;
    border-radius: 12px;
    text-align: left;
    display: none;
    font-size: 0.9rem;
    max-height: 320px;
    overflow-y: auto;
}

.upload-status.success { display: block; background: #d4edda; color: #155724; padding: 12px; }
.upload-status.error   { display: block; background: #f8d7da; color: #721c24; padding: 12px; }
.upload-status.processing { display: block; background: #fff3cd; color: #856404; padding: 12px; }

.upload-queue { padding: 10px; }
.upload-queue strong { display: block; margin-bottom: 10px; color: #2c5aa0; }
.upload-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid #cce0ff;
}
.up-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 10px; font-size: 0.9rem; }
.up-state { font-size: 0.85rem; white-space: nowrap; padding: 2px 8px; border-radius: 4px; }
.up-state.uploading { color: #4A90E2; background: #e6f0ff; }
.up-state.success   { color: #155724; background: #d4edda; }
.up-state.fail      { color: #721c24; background: #f8d7da; }
.up-state.skip      { color: #856404; background: #fff3cd; }
.up-errors { margin-top: 8px; padding: 10px; background: #f8d7da; color: #721c24; border-radius: 6px; font-size: 0.85rem; }
.up-summary { margin-top: 10px; padding: 10px; background: #e6f0ff; border-radius: 6px; color: #2c5aa0; font-weight: 600; text-align: center; }

/* 时间轴 */
.timeline-section h2 {
    color: #2c5aa0;
    margin-bottom: 18px;
    font-size: 1.3rem;
}

.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #4A90E2, #a8d4ff);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 3px 12px rgba(74, 144, 226, 0.1);
    cursor: pointer;
    transition: all 0.25s;
}

.timeline-item:hover {
    transform: translateX(6px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.2);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 22px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4A90E2;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #a8d4ff;
}

.timeline-date {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c5aa0;
    margin-bottom: 4px;
}

.timeline-meta {
    color: #8899aa;
    font-size: 0.9rem;
}

/* 详情页 Tab */
.detail-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #dbeaff;
    color: #4A90E2;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
    background: linear-gradient(135deg, #4A90E2, #7ab8ff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 统计头部 */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.search-box input {
    padding: 10px 14px;
    border: 2px solid #cce0ff;
    border-radius: 12px;
    width: 260px;
    font-size: 0.95rem;
    outline: none;
    transition: box-shadow 0.2s;
}

.search-box input:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.12);
}

.sort-buttons { display: flex; gap: 8px; }

.btn {
    padding: 8px 16px;
    border: none;
    background: #fff;
    color: #4A90E2;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    border: 2px solid #4A90E2;
}

.btn:hover, .btn.active {
    background: linear-gradient(135deg, #4A90E2, #7ab8ff);
    color: #fff;
    border-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #4A90E2, #7ab8ff);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 10px 24px;
    font-size: 1rem;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* 表格 */
.table-wrapper {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

th, td { padding: 12px 14px; text-align: left; }

th {
    background: linear-gradient(135deg, #4A90E2, #7ab8ff);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}

td { border-bottom: 1px solid #eef4ff; }

tr:hover td { background: #f8fbff; }

tr:last-child td { border-bottom: none; }

/* 礼物滑动单元格 */
.gift-cell {
    max-width: 220px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 0;
    scrollbar-width: thin;
}

.gift-cell::-webkit-scrollbar { height: 4px; }
.gift-cell::-webkit-scrollbar-thumb { background: #4A90E2; border-radius: 2px; }

.gift-tag {
    display: inline-flex;
    align-items: center;
    background: #e6f0ff;
    color: #2c5aa0;
    padding: 3px 10px;
    border-radius: 20px;
    margin-right: 6px;
    font-size: 0.82rem;
    border: 1px solid #cce0ff;
    font-weight: 600;
}

/* 弹幕内容换行 */
.danmaku-content {
    max-width: 300px;
    word-break: break-all;
    line-height: 1.5;
}

/* 搜索页 */
.search-box-section {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.search-type {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #555;
    font-size: 0.95rem;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #cce0ff;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
}

.search-input-group input:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.12);
}

.search-summary {
    background: #e6f0ff;
    color: #2c5aa0;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 600;
    text-align: center;
}

/* 查看器高亮 */
.viewer-wrapper { max-height: 80vh; overflow-y: auto; }

.highlight-row {
    background: #fff3cd !important;
    border-left: 4px solid #ffc107;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { background: #fff3cd; }
    50% { background: #ffe9a8; }
    100% { background: #fff3cd; }
}

/* 空状态 */
.empty-state, .loading {
    text-align: center;
    padding: 50px 20px;
    color: #8899aa;
    font-size: 1.05rem;
}

/* 响应式 */
@media (max-width: 640px) {
    header h1 { font-size: 1.4rem; }
    .stats-header { flex-direction: column; align-items: stretch; }
    .search-box input { width: 100%; }
    .sort-buttons { justify-content: center; }
    th, td { padding: 10px 8px; font-size: 0.85rem; }
    .timeline { padding-left: 22px; }
    .timeline-item::before { left: -20px; width: 12px; height: 12px; }
    .main-nav { grid-template-columns: 1fr 1fr; }
    .search-input-group { flex-direction: column; }
    .gift-cell { max-width: 140px; }
    .danmaku-content { max-width: 180px; }
}