/**
 * 排行榜页面样式
 * Ranking Page Styles
 */

/* Hero Banner */
.ranking-hero {
    background: linear-gradient(135deg, #FF6A00 0%, #E65F00 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    /* margin-bottom: 40px; */
}

.ranking-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.ranking-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.ranking-subtitle {
    font-size: 18px;
    opacity: 0.95;
    line-height: 1.6;
}

/* Container */
.ranking-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: flex;
    gap: 30px;
    width: 100%;
    box-sizing: border-box;
}

/* 排行榜分类页面包屑容器：对齐 1400px 主容器宽度，避免视觉错位 */
.ranking-hero + .Community-category-article-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.ranking-main-content {
    flex: 1;
    min-width: 0;
}

.ranking-sidebar {
    width: 350px;
    flex-shrink: 0;
}

/* Brand List */
.brand-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Brand Card */
.brand-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s;
    position: relative;
}

.brand-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Rank Badge */
.rank-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: white;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.4);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: white;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.rank-badge.rank-other {
    background: #f0f0f0;
    color: #666;
}

/* Brand Logo */
.brand-logo {
    width: 210px;
    height: 128px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #f0f0f0;
}

/* Brand Info */
.brand-info {
    flex: 1;
    min-width: 0;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.brand-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.brand-name-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.brand-name-link:hover {
    color: #FF6A00;
}

/* 品牌名下方的公司全称 / 生产商副标题 */
.brand-company-subtitle {
    font-size: 13px;
    color: #9aa0a6;
    margin: 4px 0 2px;
    line-height: 1.4;
    font-weight: 400;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-logo-link {
    display: inline-block;
    line-height: 0;
    transition: transform 0.2s;
}

.brand-logo-link:hover {
    transform: scale(1.03);
}

.brand-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-verified {
    background: #FFF5EE;
    color: #FF6A00;
}

.badge-level {
    background: #fff7e6;
    color: #fa8c16;
}

/* 官方入驻商家小角标（C 端友好语义，统一 pro/premium）—— 灰底橘字低调款 */
.badge-official {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    background: #FFF5EE;
    color: #FF6A00;
    border: 1px solid #FFD9BF;
}

.badge-official svg {
    flex-shrink: 0;
}

/* 旧版付费订阅徽章 — 已废弃，不再使用，保留样式以兼容历史缓存 */
.badge-plan {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(255, 106, 0, 0.25);
}

.badge-plan svg {
    flex-shrink: 0;
}

.badge-plan-pro {
    background: linear-gradient(135deg, #FF6A00 0%, #FF8C3B 100%);
}

.badge-plan-premium {
    background: linear-gradient(135deg, #8b5cf6 0%, #FF6A00 100%);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.brand-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

/* Brand Products */
.brand-products {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f7f7f7;
    border-radius: 6px;
    font-size: 13px;
}

.products-label {
    color: #999;
    font-weight: 500;
    flex-shrink: 0;
}

.products-value {
    color: #333;
    line-height: 1.5;
}

/* Vote Section */
.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 2px solid #f0f0f0;
    min-width: 120px;
}

.vote-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #f5222d;
}

.vote-count svg {
    width: 20px;
    height: 20px;
    fill: #f5222d;
}

.vote-btn {
    padding: 10px 24px;
    background: #FF6A00;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    width: 100%;
}

.vote-btn:hover:not(:disabled) {
    background: #E65F00;
}

.vote-btn:disabled,
.vote-btn.voted {
    background: #d9d9d9;
    cursor: not-allowed;
    color: #999;
}

.view-detail-btn {
    padding: 10px 24px;
    background: white;
    color: #FF6A00;
    border: 1px solid #FF6A00;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.view-detail-btn:hover {
    background: #FFF5EE;
    border-color: #E65F00;
    color: #E65F00;
}

/* Sidebar - 额外样式 */
.ranking-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 84px;
    align-self: flex-start;
}

.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sidebar-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #333;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

/* Apply Ranking Section */
.apply-ranking-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.btn-apply-ranking {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FF6A00 0%, #E65F00 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}

.btn-apply-ranking:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.4);
    background: linear-gradient(135deg, #E65F00 0%, #D55500 100%);
}

.btn-apply-ranking svg {
    stroke-width: 2.5;
}

.apply-hint {
    color: #999;
    font-size: 13px;
    margin: 12px 0 0 0;
}

/* Hot Brands List */
.hot-brands-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hot-brand-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.hot-brand-item:last-child {
    border-bottom: none;
}

.hot-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.hot-brand-info {
    flex: 1;
    min-width: 0;
}

.hot-brand-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hot-brand-votes {
    font-size: 12px;
    color: #999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
}

.empty-state svg {
    stroke: #d9d9d9;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: #666;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #999;
    margin: 0;
}

/* Loading State */
.vote-btn.loading {
    position: relative;
    color: transparent;
}

.vote-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ranking-container {
        flex-direction: column;
        padding: 0 16px 40px;
    }
    
    .ranking-sidebar {
        width: 100%;
        order: 2;
    }
}

@media (max-width: 768px) {
    .ranking-hero {
        padding: 40px 12px;
    }
    
    .ranking-title {
        font-size: 28px;
    }
    
    .ranking-subtitle {
        font-size: 15px;
    }
    
    .ranking-container {
        padding: 0 12px 40px;
    }
    
    .brand-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
        gap: 16px;
    }
    
    .brand-header {
        justify-content: center;
    }
    
    .vote-section {
        border-left: none;
        border-top: 2px solid #f0f0f0;
        padding-left: 0;
        padding-top: 16px;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        min-width: auto;
    }
    
    .vote-btn,
    .view-detail-btn {
        width: auto;
        flex: 1;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .brand-logo {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 16/10;
    }
    
    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .brand-name {
        font-size: 18px;
    }
    
    .brand-description {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
    
    .sidebar-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ranking-hero {
        padding: 30px 8px;
    }
    
    .ranking-title {
        font-size: 24px;
    }
    
    .ranking-subtitle {
        font-size: 14px;
    }
    
    .ranking-container {
        padding: 0 8px 30px;
    }
    
    .brand-card {
        padding: 12px;
        gap: 12px;
    }
    
    .brand-name {
        font-size: 16px;
    }
    
    .brand-logo {
        max-width: 240px;
    }
    
    .vote-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .vote-btn,
    .view-detail-btn {
        width: 100%;
        padding: 10px 20px;
    }
    
    .rank-badge {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .sidebar-card {
        padding: 16px;
    }
    
    .sidebar-card-title {
        font-size: 16px;
    }
}

/* Modal Styles */
.ranking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.ranking-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
    color: #666;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.required {
    color: #f5222d;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FF6A00;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="file"] {
    padding: 8px 0;
    font-size: 14px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.checkbox-group {
    margin-top: 24px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-label a {
    color: #FF6A00;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-submit {
    background: #FF6A00;
    color: white;
}

.btn-submit:hover {
    background: #E65F00;
}

.btn-submit:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-submit {
        width: 100%;
    }
}
