/* ============================================
   叩门 - 出山页面样式
   ============================================ */

/* 出山页面容器 */
.emerge-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 100px;
}

/* ============================================
   顶部标题区
   ============================================ */
.emerge-header {
    background: var(--bg-card);
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-color);
}

.emerge-title {
    font-family: var(--font-calligraphy);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.emerge-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================
   排行榜区域
   ============================================ */
.ranking-section {
    padding: 20px 16px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 排行榜项目 - 与主页先贤卡片风格一致 */
.ranking-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-red);
}

.ranking-item.voted {
    border-color: var(--accent-red);
    background: rgba(196, 30, 58, 0.02);
}

/* 排名徽章 */
.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-calligraphy);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: white;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: white;
}

.rank-badge.normal {
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* 头像 - 改为矩形铺满风格 */
.ranking-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.ranking-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 信息区 */
.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-family: var(--font-calligraphy);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ranking-era {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ranking-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 票数 */
.ranking-votes {
    text-align: center;
    margin-right: 8px;
}

.votes-count {
    font-family: var(--font-calligraphy);
    font-size: 1.3rem;
    color: var(--accent-red);
    display: block;
}

.votes-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 投票按钮 - 与主页按钮风格一致 */
.vote-btn {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.25);
}

.vote-btn:hover {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(196, 30, 58, 0.35);
}

.vote-btn:active {
    transform: translateY(0);
}

.vote-btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.vote-btn.voted {
    background: #4CAF50;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-item:hover,
.page-item.active {
    background: var(--accent-red);
    color: white;
}

.page-item.more {
    background: transparent;
    color: var(--text-muted);
}

.vote-notice {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ============================================
   提名区域 - 卡片风格优化
   ============================================ */
.nomination-section {
    padding: 0 16px 20px;
}

.nomination-header {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.nomination-question {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.nominate-btn {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--font-serif);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nominate-btn:hover {
    background: var(--accent-red);
    color: white;
}

/* ============================================
   我的提名区域
   ============================================ */
.my-nominations-section {
    padding: 0 16px 20px;
}

.section-title {
    font-family: var(--font-calligraphy);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.my-nominations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.my-nomination-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: all 0.3s ease;
}

.my-nomination-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.nomination-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.nomination-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nomination-info {
    flex: 1;
    min-width: 0;
}

.nomination-name {
    font-family: var(--font-calligraphy);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.nomination-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nomination-status {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.nomination-status.approved {
    background: #E8F5E9;
    color: #4CAF50;
}

.nomination-status.pending {
    background: #FFF3E0;
    color: #FF9800;
}

.nomination-status.rejected {
    background: #FFEBEE;
    color: #F44336;
}

/* ============================================
   提名弹窗
   ============================================ */
.nomination-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nomination-modal.show {
    opacity: 1;
    visibility: visible;
}

.nomination-modal .modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 380px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.nomination-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-family: var(--font-calligraphy);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input,
.form-textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--border-color);
}

.btn-submit {
    background: var(--accent-red);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.25);
}

.btn-submit:hover {
    background: var(--accent-red-hover);
}

/* ============================================
   投票成功提示
   ============================================ */
.vote-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 32px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.vote-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.toast-icon {
    font-size: 2rem;
    color: #4CAF50;
}

.toast-text {
    font-size: 1rem;
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 380px) {
    .ranking-item {
        padding: 12px;
        gap: 10px;
    }

    .ranking-avatar {
        width: 40px;
        height: 40px;
    }

    .ranking-name {
        font-size: 1rem;
    }

    .votes-count {
        font-size: 1.1rem;
    }

    .vote-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

/* ============================================
   动画效果
   ============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ranking-item {
    animation: slideIn 0.4s ease-out;
}

.ranking-item:nth-child(1) { animation-delay: 0.05s; }
.ranking-item:nth-child(2) { animation-delay: 0.1s; }
.ranking-item:nth-child(3) { animation-delay: 0.15s; }
.ranking-item:nth-child(4) { animation-delay: 0.2s; }
.ranking-item:nth-child(5) { animation-delay: 0.25s; }
.ranking-item:nth-child(6) { animation-delay: 0.3s; }
