/* 首页样式 - 开枝散叶 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0d0d2b 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

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

/* 顶部导航 */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 14px;
    color: #888;
    padding-left: 10px;
    border-left: 1px solid #444;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-login {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-login:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.my-world {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(100,200,100,0.1);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(100,200,100,0.3);
}

.btn-my-world {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-logout {
    background: rgba(255,100,100,0.2);
    border: 1px solid rgba(255,100,100,0.3);
    color: #ff8888;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

/* 通用区块 */
.section-public,
.section-chapters,
.section-start {
    margin: 40px 0;
}

.section-title {
    font-size: 20px;
    color: #ffd700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,215,0,0.3);
}

/* 世界动态公屏 */
.public-feed {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 20px;
    height: 200px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.feed-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
    animation: slideIn 0.5s ease;
}

.feed-item.highlight {
    border-left-color: #ffd700;
    background: rgba(255,215,0,0.1);
}

.feed-item.danger {
    border-left-color: #ff6b6b;
    background: rgba(255,100,100,0.1);
}

.feed-world {
    color: #4fc3f7;
    font-weight: bold;
    margin-right: 10px;
}

.feed-text {
    color: #ccc;
    font-size: 14px;
}

.feed-time {
    float: right;
    color: #666;
    font-size: 12px;
}

.feed-loading {
    text-align: center;
    color: #888;
    padding: 60px;
}

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

/* 章节网格 */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chapter-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.chapter-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,215,0,0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chapter-name {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
}

.chapter-range {
    font-size: 12px;
    color: #888;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.chapter-desc {
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.chapter-action {
    text-align: center;
    padding: 10px;
    background: rgba(255,215,0,0.1);
    border-radius: 8px;
    color: #ffd700;
    font-size: 14px;
    transition: all 0.3s;
}

.chapter-card:hover .chapter-action {
    background: rgba(255,215,0,0.2);
}

/* 快速开始区 */
.section-start {
    text-align: center;
}

.start-box {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid rgba(255,255,255,0.1);
}

.start-box h2 {
    color: #ffd700;
    margin-bottom: 30px;
    font-size: 24px;
}

.start-buttons {
    margin: 30px 0;
}

.btn-start {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 20px 50px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 36px;
}

.btn-desc {
    font-size: 12px;
    opacity: 0.8;
}

.guest-tips {
    color: #888;
    font-size: 14px;
    margin-top: 20px;
}

/* 创建成功信息 */
.start-info {
    background: rgba(100,200,100,0.1);
    border: 1px solid rgba(100,200,100,0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
}

.world-code-box,
.world-password-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.label {
    color: #888;
    font-size: 14px;
}

.value {
    color: #4fc3f7;
    font-weight: bold;
}

.value.big {
    font-size: 20px;
    color: #ffd700;
}

.btn-copy {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.warning-text {
    color: #ff8888;
    font-size: 13px;
    margin-top: 15px;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a3a 0%, #2a2a4a 100%);
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
}

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

.modal h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #ffd700;
}

.form-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-large {
    padding: 18px;
    font-size: 18px;
    margin-top: 20px;
}

.modal-tips {
    margin-top: 20px;
    color: #888;
    font-size: 14px;
    text-align: center;
}

.modal-tips a {
    color: #4fc3f7;
    text-decoration: none;
}

.modal-tips a:hover {
    text-decoration: underline;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.modal-buttons .btn-primary {
    flex: 1;
}

/* 降临确认弹窗 */
.incarnate-info {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.incarnate-warning {
    color: #ff8888;
    font-size: 13px;
    padding: 10px;
    background: rgba(255,100,100,0.1);
    border-radius: 6px;
    margin-bottom: 15px;
}

/* 创建成功弹窗 */
.modal-success {
    text-align: center;
}

.success-info {
    text-align: left;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.warning-box {
    background: rgba(255,100,100,0.1);
    border: 1px solid rgba(255,100,100,0.3);
    border-radius: 8px;
    padding: 15px;
    color: #ff8888;
    font-size: 14px;
    margin: 20px 0;
}

/* 页脚 */
.home-footer {
    text-align: center;
    padding: 30px 0;
    color: #666;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 60px;
}

/* 响应式 */
@media (max-width: 768px) {
    .home-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    
    .start-box {
        padding: 25px;
    }
    
    .btn-start {
        padding: 15px 35px;
    }
}


/* ========== 增强样式 ========== */

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); }
}

/* 入场动画 */
.section-public, .section-chapters, .section-start {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}
.section-chapters { animation-delay: 0.2s; }
.section-start { animation-delay: 0.4s; }

/* 动态卡片悬停效果 */
.public-feed .feed-item {
    transition: all 0.3s ease;
}
.public-feed .feed-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

/* 章节卡片增强 */
.chapter-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}
.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 开始按钮增强 */
.btn-start {
    position: relative;
    overflow: hidden;
}
.btn-start::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 星级显示 */
.rating-stars {
    display: inline-flex;
    gap: 2px;
}
.rating-stars .star {
    color: #FFD700;
    font-size: 14px;
}
.rating-stars .star.empty {
    color: #444;
}

/* 快速统计栏 */
.quick-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 15px 0;
}
.quick-stat-item {
    background: rgba(255,255,255,0.05);
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.quick-stat-item .icon {
    font-size: 18px;
}
.quick-stat-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
}
.quick-stat-item .label {
    font-size: 11px;
    color: #888;
}

/* 特色标签 */
.feature-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.feature-tag {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #aaa;
}
