/* ==========================================
   吃瓜合集 - 前台样式
   暗色主题 + 响应式
   ========================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #0f0c29;
    color: #e0e0e0;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

a { color: #6c63ff; text-decoration: none; }
a:hover { color: #8b83ff; }

/* ========== 入口页 ========== */
.entry-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* 背景动效 */
.entry-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(108,99,255,0.03) 0%, transparent 70%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.entry-box {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 360px;
    max-width: 100%;
}

.entry-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin: 0 auto 16px;
    display: block;
    object-fit: cover;
    background: rgba(108,99,255,0.1);
}

.entry-emoji {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 16px;
}

.entry-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.entry-subtitle {
    color: #888;
    font-size: 13px;
    margin-bottom: 28px;
}

.entry-input-wrap {
    position: relative;
    margin-bottom: 16px;
}

.entry-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    text-align: center;
    letter-spacing: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.entry-input:focus {
    border-color: #6c63ff;
    box-shadow: 0 0 20px rgba(108,99,255,0.15);
}

.entry-input::placeholder {
    letter-spacing: 2px;
    font-size: 14px;
    color: #555;
}

.entry-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #6c63ff, #5a52d5);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 14px;
}

.entry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108,99,255,0.3);
}

.entry-btn:active { transform: translateY(0); }

.entry-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.entry-link {
    padding: 8px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #aaa;
    font-size: 13px;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-block;
}

.entry-link:hover {
    background: rgba(108,99,255,0.1);
    border-color: rgba(108,99,255,0.3);
    color: #6c63ff;
}

.entry-error {
    color: #ff4757;
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

.entry-notice {
    margin-top: 20px;
    padding: 10px 16px;
    background: rgba(108,99,255,0.08);
    border: 1px solid rgba(108,99,255,0.15);
    border-radius: 8px;
    color: #9e99ff;
    font-size: 12px;
    max-width: 100%;
}

/* ========== 内容展示页 ========== */
.view-page {
    min-height: 100vh;
    background: #0f0c29;
}

.view-header {
    background: linear-gradient(135deg, #16213e, #1a1a2e);
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.view-header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.view-back {
    color: #6c63ff;
    font-size: 13px;
}

.view-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* 公告横幅 */
.notice-banner {
    background: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(233,30,99,0.08));
    border: 1px solid rgba(108,99,255,0.2);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notice-banner .icon { font-size: 20px; }

.notice-banner .text {
    color: #c5c0ff;
    font-size: 13px;
    flex: 1;
}

/* 分类标签 */
.type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.type-tab {
    padding: 7px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.type-tab:hover,
.type-tab.active {
    background: rgba(108,99,255,0.15);
    border-color: rgba(108,99,255,0.4);
    color: #6c63ff;
}

/* 日期折叠组 */
.day-group {
    margin-bottom: 16px;
}

.day-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.day-group-header:hover {
    background: rgba(108,99,255,0.06);
    border-color: rgba(108,99,255,0.15);
}

.day-group-title {
    font-size: 15px;
    font-weight: 500;
    color: #e0e0e0;
}

.day-group-arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.3s;
}

.day-group.open .day-group-arrow {
    transform: rotate(180deg);
}

.day-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.day-group.open .day-group-body {
    max-height: 5000px;
}

.day-group-content {
    padding: 12px 0;
}

/* 内容卡片 */
.content-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.content-card:hover {
    background: rgba(108,99,255,0.05);
    border-color: rgba(108,99,255,0.15);
    transform: translateX(4px);
    color: inherit;
}

.content-card-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.content-card-info { flex: 1; min-width: 0; }

.content-card-title {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card-desc {
    font-size: 12px;
    color: #777;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card-tags {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.content-tag {
    padding: 2px 8px;
    background: rgba(108,99,255,0.1);
    border-radius: 4px;
    font-size: 11px;
    color: #8b83ff;
}

/* ========== 详情页 ========== */
.detail-page {
    min-height: 100vh;
    background: #0f0c29;
}

.detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px;
}

.detail-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.4;
}

.detail-meta {
    color: #666;
    font-size: 13px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.detail-content {
    color: #ccc;
    font-size: 15px;
    line-height: 1.8;
    word-wrap: break-word;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.detail-content a { color: #6c63ff; }

.detail-content p { margin-bottom: 12px; }

.detail-content h1, .detail-content h2, .detail-content h3 {
    color: #fff;
    margin: 20px 0 10px;
}

.detail-back {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 24px;
    background: rgba(108,99,255,0.12);
    border: 1px solid rgba(108,99,255,0.25);
    border-radius: 8px;
    color: #6c63ff;
    font-size: 14px;
    transition: all 0.2s;
}

.detail-back:hover {
    background: rgba(108,99,255,0.2);
    color: #8b83ff;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ========== 加载动画 ========== */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(108,99,255,0.2);
    border-top-color: #6c63ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
    .entry-box { width: 100%; }
    .entry-title { font-size: 20px; }
    .view-container { padding: 12px; }
    .content-card-img { width: 60px; height: 60px; }
    .detail-container { padding: 16px 12px; }
    .detail-title { font-size: 18px; }
}
