/* ===== 共用樣式 ===== */

/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* 確保頁面寬度固定，不受滾動條影響 */
    width: 100vw;
    box-sizing: border-box;
    /* 修正：確保 body 可以正確容納所有內容 */
    min-height: 100vh;
    /* 修正：允許 body 滾動 */
    overflow-y: auto;
}

/* 頁面容器 */
.page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
    /* 修正：確保頁面容器不會干擾主頁面佈局 */
    height: auto;
    /* 修正：為底部導航欄留出空間 */
    padding-bottom: 120px;
}

/* 頁首樣式 */
.header {
    background: #ff8c00;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    position: -webkit-sticky;  /* Safari 兼容性 */
    position: sticky;
    top: 0;
    z-index: 200;  /* 提高 z-index 确保在 tab-navigation 之上 */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.page-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.page-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    margin: 0 1rem;
}

.page-title-main {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.page-title-sub {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.user-name {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
}

.back-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

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

/* 主要內容區域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    /* 確保容器寬度固定，滾動條覆蓋在內容上 */
    width: 100%;
    box-sizing: border-box;
    min-height: 0; /* 確保 flex 子元素可以正確縮放 */
    /* 修正：確保內容區域可以正確滾動 */
    overflow-y: auto;
    /* 修正：確保主內容區域可以正確分配空間 */
    position: relative;
    /* 修正：確保主內容區域不會超出容器 */
    max-height: calc(100vh - 90px);
    /* 為底部導航欄留出額外空間 */
    padding-bottom: 20px;
}

/* 空狀態樣式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.empty-icon {
    margin-bottom: 16px;
    color: #ccc;
}

.empty-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.empty-description {
    font-size: 14px;
    color: #999;
    line-height: 1.4;
}

/* 底部導航樣式 */
.bottom-nav {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #666;
}

.nav-item.active {
    color: #ff8c00;
    background: rgba(255, 140, 0, 0.1);
}

.nav-item:hover {
    color: #ff8c00;
    transform: translateY(-2px);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-text {
    font-size: 0.8rem;
    font-weight: 500;
}

/* 頁首左側區域樣式 */
.header-left {
    display: flex;
    align-items: center;
}

/* 手機號碼驗證彈窗樣式 */
.phone-verification-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
}

.phone-verification-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 90%;
    width: 360px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.phone-verification-modal-header {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    padding: 1rem 1.5rem;
    text-align: center;
    border-radius: 16px 16px 0 0;
}

.phone-verification-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.phone-verification-modal-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.verification-message {
    text-align: center;
}

.verification-message p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.verification-button-container {
    display: flex;
    justify-content: center;
}

.verification-btn {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
    text-align: center;
    min-width: 200px;
}

.verification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 140, 0, 0.4);
    background: linear-gradient(135deg, #ffa500, #ff8c00);
}

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

.phone-verification-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
}

.phone-verification-modal-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
    background: #f8f9fa;
    color: #666;
}

.phone-verification-modal-btn:hover {
    background: #e9ecef;
    color: #333;
}

.verification-status {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-top: 1rem;
    display: none;
}

.verification-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.verification-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 投票選擇彈窗樣式 */
.vote-selection-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.vote-selection-modal-content {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.2s ease;
}

.vote-selection-modal-content.show {
    opacity: 1;
    transform: scale(1);
}

.vote-selection-modal-title {
    padding: 20px;
    background: #ff8c00;
    color: white;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.vote-selection-buttons {
    background: white;
    display: flex;
    flex-direction: column;
}

.vote-selection-btn {
    padding: 16px 20px;
    border: none;
    background: white;
    color: #333;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
}

.vote-selection-btn:hover {
    background-color: #f8f9fa;
}

.vote-selection-btn:last-child {
    border-bottom: none;
}

.vote-selection-btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    color: #ff8c00;
    flex-shrink: 0;
}

.vote-selection-btn-text {
    flex: 1;
    text-align: left;
}

.vote-selection-race-number {
    color: #ff8c00;
    font-weight: 700;
}

.vote-selection-btn.weak {
    opacity: 0.6;
    font-size: 14px;
}

.vote-selection-btn.weak .vote-selection-btn-icon {
    width: 18px;
    height: 18px;
    color: #999;
}

.vote-selection-btn.weak:hover {
    opacity: 0.8;
}

/* ==================== 選膽彈窗共用樣式 ==================== */

/* 選膽彈窗覆蓋層 */
.favorite-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
}

/* 選膽彈窗內容 */
.favorite-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 400px;
    width: 88%;
    max-height: 75vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* 選膽彈窗頭部 */
.favorite-modal-header {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: center;
    border-radius: 12px 12px 0 0;
}

.favorite-modal-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

/* 選膽彈窗主體 */
.favorite-modal-body {
    padding: 0.85rem;
    flex: 1;
    overflow-y: auto;
}

/* 馬匹列表 */
.favorite-horse-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 馬匹項目 */
.favorite-horse-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorite-horse-item:hover {
    background: #fff8f0;
    border-color: #ff8c00;
    transform: translateY(-1px);
}

.favorite-horse-item.selected {
    background: linear-gradient(135deg, #fff8f0, #fff);
    border: 2px solid #ff8c00;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.2);
}

/* 馬匹號碼 */
.favorite-horse-number {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* 馬匹信息 */
.favorite-horse-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.favorite-horse-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 馬膽標籤 */
.favorite-badge {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(255, 140, 0, 0.3);
}

.favorite-horse-details {
    font-size: 0.75rem;
    color: #666;
}

/* 馬匹賠率 */
.favorite-horse-odds {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff8c00;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* 選膽彈窗底部 */
.favorite-modal-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.6rem;
}

/* 選膽彈窗按鈕 */
.favorite-modal-btn {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
}

.favorite-modal-btn.cancel {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
}

.favorite-modal-btn.cancel:hover {
    background: #e9ecef;
    color: #333;
}

.favorite-modal-btn.confirm {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.favorite-modal-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.4);
}

.favorite-modal-btn.confirm:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 彈窗區域樣式 */
.modal-section {
    margin-bottom: 1rem;
}

.modal-section:last-of-type {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
}

/* 馬匹列表樣式（一行顯示3匹馬） */
.favorite-horse-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 0;
}

/* 彈窗中的馬匹項目樣式調整 */
.favorite-modal-body .horse-item {
    width: 100%;
    padding: 4px 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-modal-body .horse-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.favorite-modal-body .horse-item .horse-number {
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    pointer-events: none;
}

.favorite-modal-body .horse-item .horse-name {
    font-size: 0.75rem;
    pointer-events: none;
}

.favorite-modal-body .horse-item .horse-name-container {
    pointer-events: none;
}

/* 彈窗中未選中的馬匹（other樣式）*/
.favorite-modal-body .horse-item.other {
    background: transparent;
    border: 1px solid #dee2e6;
}

.favorite-modal-body .horse-item.other .horse-number {
    background: transparent;
    color: #ff8c00;
    border: 1px solid #ff8c00;
}

.favorite-modal-body .horse-item.other .horse-name {
    color: #333;
}

/* 彈窗中選中的馬膽（banker樣式）*/
.favorite-modal-body .horse-item.banker {
    background: #ff8c00 !important;
    color: white !important;
    border: 1px solid #ff8c00 !important;
}

.favorite-modal-body .horse-item.banker .horse-number {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #ff8c00 !important;
    border: none !important;
}

.favorite-modal-body .horse-item.banker .horse-name {
    color: white !important;
}

/* 時間選擇選項 */
.view-time-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.view-time-options.view-time-options-disabled .time-option {
    opacity: 0.6;
    cursor: not-allowed;
}

.view-time-options.view-time-options-disabled .reward-text,
.view-time-options.view-time-options-disabled .time-button {
    pointer-events: none;
}

.time-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reward-text {
    font-size: 0.65rem;
    color: #ff8c00;
    margin-bottom: 2px;
    font-weight: 600;
    white-space: nowrap;
}

.time-button {
    width: 100%;
    padding: 5px 2px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    line-height: 1.3;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-option.selected .time-button {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    border-color: #ff8c00;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.time-option:hover .time-button {
    border-color: #ff8c00;
    transform: translateY(-1px);
}

/* 立即可見按鈕樣式（灰色，不鼓勵但可點擊）*/
.time-option.immediate-option .reward-text {
    color: #999;
}

.time-option.immediate-option .time-button {
    background: #f5f5f5;
    color: #999;
    border: none;  /* 去除边框 */
}

.time-option.immediate-option:hover .time-button {
    background: #e9e9e9;
    color: #666;
    border: none;  /* 去除边框 */
}

.time-option.immediate-option.selected .time-button {
    background: #d0d0d0;
    color: #666;
    border: none;  /* 去除边框 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 評述輸入 */
.comment-input {
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.comment-input:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.1);
}

.comment-input::placeholder {
    color: #999;
    font-size: 0.75rem;
}

.comment-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #999;
    text-align: right;
    display: none; /* 隱藏外部提示 */
}

/* ===== 統一命中標籤樣式 ===== */

/* 統一標籤基礎樣式 - 完全複製 ranking.css 中的樣式 */
.vote-tag {
    /* 統一標籤大小 - 與 hit-tag-label 保持一致 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; /* 與 hit-tag-label 相同的寬度 */
    height: 20px; /* 與 hit-tag-label 相同的高度 */
    font-size: 0.8rem; /* 統一基礎字體大小 - 再調大 */
    font-weight: 700;
    border-radius: 3.75px; /* 與 hit-tag-label 相同的圓角 */
    text-align: center;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 與 hit-tag-label 相同的陰影 */
}

/* W (獨贏) - 使用深橙色突出顯示 */
.vote-tag.win {
    /* Changed from green to dark orange for W vote tags */
    background: #dc2626;
    color: #ffffff;
}

/* P (位置) - 使用橙色突出顯示 */
.vote-tag.place {
    /* Keeping standard orange for P vote tags */
    background: #f97316;
    color: #ffffff;
}

/* X (不命中) - 使用灰色低調顯示 */
.vote-tag.miss {
    background: #e5e7eb;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* 連贏榜標籤樣式 - 使用藍色系 */

/* 連 (連贏) - 使用深藍色突出顯示 */
.vote-tag.qpq {
    background: #1d4ed8;
    color: #ffffff;
}

/* 位 (位置Q) - 使用淺藍色突出顯示 */
.vote-tag.pq {
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.6rem; /* 較小字體以適應兩個字母 - 調大 */
}

/* T (三重彩) - 使用較淺的紫色 */
.vote-tag.tce {
    background: #8b5cf6;
    color: #ffffff;
}

/* 4 (四重彩) - 使用較深的紫色 */
.vote-tag.qtt {
    background: #6d28d9;
    color: #ffffff;
    font-size: 0.7rem; /* 調大字體以適應數字 - 再調大 */
}

/* 脈衝動畫效果 */
.vote-tag.pulse-animation {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

/* 連勝效果樣式 */
.streak-container {
    position: relative;
    display: inline-block;
    margin-right: 0.2rem;
}

.streak-banner {
    position: absolute;
    top: -15px;
    left: 0;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
    z-index: 10;
    animation: bannerPulse 2s ease-in-out infinite;
    text-align: left;
}

.vote-row .streak-banner {
    position: absolute;
    top: -15px;
    left: 0;
}

.streak-tags-wrapper {
    display: flex;
    gap: 0.1rem;
    padding: 2px;
    border: 2px solid #f97316;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(251, 146, 60, 0.1));
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.streak-tag {
    border: 1px solid #f97316 !important;
    box-shadow: 0 1px 3px rgba(249, 115, 22, 0.3) !important;
}

.remaining-tags {
    display: inline-flex;
    gap: 0.1rem;
}

@keyframes bannerPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 4px 12px rgba(249, 115, 22, 0.6);
    }
}

/* 響應式設計 - 複製 ranking.css 中的響應式樣式 */
@media (max-width: 480px) {
    .vote-tag {
        width: 18px; /* 響應式縮小 */
        height: 18px; /* 響應式縮小，保持正方形 */
        font-size: 0.75rem; /* 響應式調大 */
        border-radius: 2px;
    }
}

@media (max-width: 375px) {
    .vote-tag {
        width: 16px; /* 更小屏幕進一步縮小 */
        height: 16px; /* 更小屏幕進一步縮小，保持正方形 */
        font-size: 0.7rem; /* 更小屏幕調大 */
    }
}

/* 響應式設計 */
@media (max-width: 480px) {
    .app-title {
        font-size: 1.3rem;
    }
    
    .page-title-main {
        font-size: 1.1rem;
    }
    
    .page-title-sub {
        font-size: 0.8rem;
    }
    
    .page-title-container {
        margin: 0 0.5rem;
    }
    
    .vote-selection-modal-overlay {
        padding: 15px;
    }
    
    .vote-selection-modal-title {
        padding: 18px 16px;
        font-size: 15px;
    }
    
    .vote-selection-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .vote-selection-btn-icon {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }
    
    .vote-selection-btn.weak {
        font-size: 13px;
    }
    
    .vote-selection-btn.weak .vote-selection-btn-icon {
        width: 16px;
        height: 16px;
    }
    
    /* 選膽彈窗響應式 */
    .favorite-modal-content {
        width: 320px;
        max-height: 70vh;
    }
    
    .favorite-modal-header h3 {
        font-size: 1rem;
    }
    
    .favorite-horse-item {
        padding: 0.6rem;
    }
    
    .favorite-horse-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .favorite-horse-name {
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .favorite-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .favorite-horse-details {
        font-size: 0.7rem;
    }
    
    .favorite-modal-footer {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .favorite-modal-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 375px) {
    .app-title {
        font-size: 1.3rem;
    }
    
    .page-title-main {
        font-size: 1rem;
    }
    
    .page-title-sub {
        font-size: 0.75rem;
    }
    
    .page-title-container {
        margin: 0 0.3rem;
    }
    
    .vote-selection-modal-overlay {
        padding: 12px;
    }
    
    .vote-selection-modal-title {
        padding: 16px 14px;
        font-size: 14px;
    }
    
    .vote-selection-btn {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .vote-selection-btn-icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
    
    .vote-selection-btn.weak {
        font-size: 12px;
    }
    
    .vote-selection-btn.weak .vote-selection-btn-icon {
        width: 14px;
        height: 14px;
    }
}

/* ===== 滾動信息區域樣式 ===== */
.scroll-info-container {
    background: #ffffff;
    height: 50px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.scroll-info-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 16px;
    position: relative;
}

.scroll-info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: #333;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
    opacity: 0;
    transition: all 0.5s ease-in-out;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
}

.scroll-info-item.active {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}

.scroll-info-item.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-20px);
}

.scroll-info-avatars {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.scroll-info-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    margin-right: -6px;
    object-fit: cover;
    background: #f5f5f5;
}

.scroll-info-avatar:last-child {
    margin-right: 0;
}

.scroll-info-text {
    display: flex;
    align-items: center;
    gap: 4px;
}

.scroll-info-highlight {
    background: #ff8c00;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 12px;
}

.scroll-info-amount {
    color: #ff8c00;
    font-weight: 600;
    font-size: 13px;
}

.scroll-info-separator {
    color: #999;
    margin: 0 4px;
    font-size: 10px;
}

/* 響應式設計 - 移動優先 */
@media (max-width: 480px) {
    .scroll-info-container {
        height: 44px;
    }
    
    .scroll-info-content {
        padding: 0 12px;
    }
    
    .scroll-info-item {
        font-size: 12px;
    }
    
    .scroll-info-avatar {
        width: 18px;
        height: 18px;
    }
    
    .scroll-info-highlight {
        font-size: 11px;
        padding: 1px 6px;
    }
    
    .scroll-info-amount {
        font-size: 12px;
    }
}

         @media (max-width: 360px) {
             .scroll-info-container {
                 height: 42px;
             }
             
             .scroll-info-item {
                 font-size: 11px;
             }
             
             .scroll-info-avatar {
                 width: 16px;
                 height: 16px;
             }
         }

         /* 新的命中標籤樣式 - 用於滾動信息區域 */
         .scroll-info-text .scroll-hit-tag {
             display: inline-block;
             background: linear-gradient(135deg, #ff6b35, #f7931e);
             color: #ffffff;
             font-size: 11px;
             font-weight: 700;
             padding: 2px 6px;
             border-radius: 8px;
             margin: 0 4px;
             box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
             text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
         }
         
         .scroll-info-text .scroll-hit-amount {
             display: inline-block;
             color: #ff6b35;
             font-weight: 700;
             font-size: 12px;
             margin-left: 2px;
         }

         /* 高命中率顯示的間距調整 */
         .scroll-info-item .scroll-info-text:first-child {
             margin-right: 8px;
         }

/* ==================== 統一投票記錄渲染樣式 ==================== */

/* 投票記錄列表容器 */
.vote-records-section {
    padding: 0 0 40px 0;
    margin-bottom: 20px;
}

.vote-records-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
}

/* 日期標題 */
.date-header {
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    padding: 12.5px 20px 7.5px 5px;
    background: transparent;
    position: static;
    z-index: 10;
    box-shadow: none;
    border-radius: 0;
    border: none;
}

.date-separator {
    display: none;
}

.date-spacing {
    height: 10px;
}

/* 投票記錄項目卡片 */
.vote-record-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #f1f3f4;
    margin-bottom: 7.5px;
}

/* 有命中的賽事樣式 */
.vote-record-item.hit-race {
    border: 0.5px solid #f97316;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
    background: linear-gradient(135deg, #ffffff, #fff8f0);
}

/* 尚未派彩的投票記錄樣式 */
.vote-record-item.pending-vote-item {
    border: 0.5px solid #fbbf24;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

/* 投票記錄頭部 */
.vote-record-header {
    background: #f8f9fa;
    padding: 10px 20px;
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    border-top: 1px solid #f1f3f4;
}

.race-info {
    display: none;
}

/* 賽事標題區域 */
.race-title-outside {
    font-size: 12px;
    color: #2c3e50;
    padding: 10px 20px 5px 5px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.race-title-text {
    flex: 1;
}

.pre-view-message {
    margin-left: 8px;
    font-size: 11px;
    color: #f97316;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pre-view-message:hover {
    color: #fb923c;
}

.modify-vote-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modify-vote-modal.show {
    display: flex;
}

.modify-vote-dialog {
    width: 100%;
    max-width: 360px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
    padding: 24px 28px 26px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
    animation: slideInUp 0.25s ease-out;
}

.modify-vote-icon-line {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fde68a, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.35);
}

.modify-vote-icon {
    font-size: 28px;
    color: #ffffff;
}

.modify-vote-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.5px;
}

.modify-vote-desc {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
}

.modify-vote-desc-race {
    color: #1f2937;
    font-weight: 700;
}

.modify-vote-desc-highlight {
    color: #f97316;
    font-weight: 700;
}

.modify-vote-info-line {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.modify-vote-info-highlight {
    color: #f97316;
    font-weight: 700;
}

.modify-vote-buttons {
    display: flex;
    gap: 14px;
    width: 100%;
    justify-content: center;
}

.modify-vote-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
}

.modify-vote-btn.cancel {
    background: #f3f4f6;
    color: #374151;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.modify-vote-btn.cancel:hover {
    background: #e5e7eb;
}

.modify-vote-btn.confirm {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(249, 115, 22, 0.35);
}

.modify-vote-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.modify-vote-footer-note {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.modify-vote-footer-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.modify-vote-footer-text::before {
    content: "ⓘ";
    font-size: 12px;
    color: #f97316;
}

/* 尚未派彩標籤 */
.pending-tag {
    background: #fbbf24;
    color: #92400e;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

/* 命中標籤容器 */
.hit-tags-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2.5px;
    width: 300px;
    height: 50px;
    align-items: center;
    margin-left: 0;
}

.hit-tags-container.single-row {
    grid-template-rows: 1fr;
    height: 25px;
    align-content: center;
}

/* 命中標籤 */
.hit-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: white;
    height: 22.5px;
    text-align: left;
    white-space: nowrap;
}

.hit-tag-label {
    width: 20px;
    height: 20px;
    font-weight: 700;
    border-radius: 3.75px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.hit-tag-amount {
    font-weight: 600;
    font-size: 0.6125rem;
    color: #1f2937;
    flex-shrink: 0;
    width: 55.5px;
    text-align: left;
}

/* 命中標籤顏色 */
.hit-tag.win .hit-tag-label {
    background: #dc2626;
    color: #ffffff;
}

.hit-tag.place .hit-tag-label {
    background: #f97316;
    color: #ffffff;
}

.hit-tag.qin .hit-tag-label {
    background: #1d4ed8;
    color: #ffffff;
}

.hit-tag.qpl .hit-tag-label {
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.6rem;
}

.hit-tag.tce .hit-tag-label,
.hit-tag.tri .hit-tag-label {
    background: #8b5cf6;
    color: #ffffff;
}

.hit-tag.qtt .hit-tag-label,
.hit-tag.ff .hit-tag-label {
    background: #6d28d9;
    color: #ffffff;
    font-size: 0.7rem;
}

/* 馬匹區域 */
.horses-section {
    padding: 10px 5px;
    background: #ffffff;
    border-bottom: 1px solid #f1f3f4;
}

.vote-record-item.no-tags .horses-section {
    border-bottom: none;
}

.horses-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25px;
}

/* 馬匹項目 */
.horse-item {
    display: flex;
    align-items: center;
    gap: 3.75px;
    border-radius: 5px;
    padding: 2.5px 5px;
    width: 95px;
    flex-shrink: 0;
}

.horse-item.banker {
    background: #ff8c00;
    color: white;
}

.horse-item.banker .horse-number {
    background: rgba(255, 255, 255, 0.9);
    color: #ff8c00;
    width: 20px;
    height: 20px;
    border-radius: 2.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.25px;
    font-weight: 700;
    flex-shrink: 0;
}

.horse-item.banker .horse-name {
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.horse-item.other {
    background: transparent;
    border: 1px solid #dee2e6;
}

.horse-item.other .horse-number {
    background: transparent;
    color: #ff8c00;
    border: 1px solid #ff8c00;
    width: 20px;
    height: 20px;
    border-radius: 2.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.25px;
    font-weight: 700;
    flex-shrink: 0;
}

.horse-item.other .horse-name {
    font-size: 12.5px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.horse-name-container {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.horse-name {
    flex: 1;
}

/* 命中標識徽章 */
.hit-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 10;
}

.hit-badge.hit-position-1::before {
    content: "1";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.hit-badge.hit-position-2::before {
    content: "2";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.hit-badge.hit-position-3::before {
    content: "3";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.hit-badge.hit-position-4 {
    width: 14px;
    height: 14px;
}

.hit-badge.hit-position-4::before {
    content: "4";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 700;
    color: #fff;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .vote-records-list {
        gap: 5px;
        padding: 0 10px;
    }

    .date-header {
        padding: 10px 15px 5px 5px;
        font-size: 13.75px;
    }

    .vote-record-header {
        padding: 7.5px 15px;
        min-height: 50px;
    }

    .horses-section {
        padding: 7.5px 2.5px;
    }

    .horses-grid {
        gap: 1.25px;
    }

    .horse-item {
        width: 84px;
        padding: 2.5px 2.5px;
        gap: 2.5px;
    }

    .horse-item.banker .horse-number,
    .horse-item.other .horse-number {
        width: 20px;
        height: 20px;
        font-size: 11.25px;
    }

    .horse-item.banker .horse-name,
    .horse-item.other .horse-name {
        font-size: 12.5px;
    }
}

/* ==================== 彈窗專用樣式覆蓋（必須放在最後以確保優先級）==================== */

/* 強制覆蓋彈窗中的馬匹樣式 - 未選中狀態 */
.favorite-modal-overlay .favorite-horse-list .horse-item.other,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.other {
    background: transparent !important;
    border: 1px solid #dee2e6 !important;
    color: #333 !important;
}

.favorite-modal-overlay .favorite-horse-list .horse-item.other .horse-number,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.other .horse-number {
    background: transparent !important;
    color: #ff8c00 !important;
    border: 1px solid #ff8c00 !important;
}

.favorite-modal-overlay .favorite-horse-list .horse-item.other .horse-name,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.other .horse-name {
    color: #333 !important;
}

/* 強制覆蓋彈窗中的馬匹樣式 - 選中狀態（banker）*/
.favorite-modal-overlay .favorite-horse-list .horse-item.banker,
.favorite-modal-overlay .favorite-horse-list .horse-item.selected,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.banker,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.selected {
    background: #ff8c00 !important;
    color: white !important;
    border: 1px solid #ff8c00 !important;
}

.favorite-modal-overlay .favorite-horse-list .horse-item.banker .horse-number,
.favorite-modal-overlay .favorite-horse-list .horse-item.selected .horse-number,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.banker .horse-number,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.selected .horse-number {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #ff8c00 !important;
    border: none !important;
}

.favorite-modal-overlay .favorite-horse-list .horse-item.banker .horse-name,
.favorite-modal-overlay .favorite-horse-list .horse-item.selected .horse-name,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.banker .horse-name,
.favorite-modal-overlay .favorite-modal-body .favorite-horse-list .horse-item.selected .horse-name {
    color: white !important;
}

/* ==================== 共用用戶信息展示區域樣式 ==================== */

/* 用戶信息區域容器 */
.user-info-section {
    background: #fff;
    margin: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    animation: fadeInUp 0.6s ease-out;
}

/* 用戶資料頭部 */
.user-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.user-avatar-large {
    flex-shrink: 0;
}

.user-avatar-large img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #f97316;
}

.user-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    padding-right: 140px; /* 為總金額留出空間 */
}

.user-name-large {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
    margin: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 排名和性能指標行 */
.user-rankings-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 4px;
    flex-wrap: nowrap;
}

.user-rankings {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
}

.ranking-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
    animation: slideInRight 0.5s ease-out;
    transition: transform 0.2s ease;
}

.ranking-badge:hover {
    transform: scale(1.05);
}

.ranking-label {
    color: #1f2937;
    font-weight: 500;
}

.ranking-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #ffffff;
    color: #f97316;
    border: 2px solid #f97316;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
}

/* 前三名使用橙色底色+反白字突出顯示 */
.ranking-number.top-three {
    background: #f97316;
    color: #ffffff;
    border: 2px solid #f97316;
    box-shadow: 0 3px 6px rgba(249, 115, 22, 0.4);
}

/* 連勝牌匾樣式 */
.winning-streak-banner {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
    white-space: nowrap;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
}

/* 連勝牌匾動畫效果 */
@keyframes pulse {
    0% {
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 107, 107, 0.5);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
        transform: scale(1);
    }
}

/* 沒有排名和排名載入失敗的樣式 */
.no-ranking,
.ranking-error {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.ranking-error {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fecaca;
}

.user-total-amount {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
    color: #1f2937;
}

.amount-bracket {
    background: #10b981;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 4px;
}

/* 內聯性能指標（在排名右側） */
.recent-performance-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 240px; /* 確保有足夠寬度容納10個標籤 */
    max-width: 100%;
    position: relative; /* 為命中率標籤絕對定位提供參考 */
}

.performance-tags {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: center;
    flex: 0 0 auto;
    min-width: 220px; /* 確保有足夠寬度容納10個標籤（每個約20px + gap） */
    overflow: visible;
    position: relative; /* 為命中率標籤絕對定位提供參考 */
}

.performance-rate {
    position: absolute;
    bottom: -8px;
    right: -2px;
    z-index: 1000; /* 確保在最上層 */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 右對齊，確保尾部位置固定 */
    pointer-events: none; /* 不影響點擊事件 */
    line-height: 1;
    max-width: 100%; /* 防止超出容器 */
}

/* 命中率標籤樣式 */
.hit-rate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end; /* 右對齊 */
    background: transparent; /* 無背景 */
    color: #f97316; /* 橙色文字，突出顯示 */
    font-size: 10px;
    font-weight: 800;
    padding: 0;
    white-space: nowrap;
    animation: hitRateBlink 1.5s ease-in-out infinite;
    text-shadow: 0 1px 3px rgba(249, 115, 22, 0.5);
    letter-spacing: 0.3px;
    text-align: right; /* 文本右對齊 */
}

/* 命中率標籤閃爍動畫 */
@keyframes hitRateBlink {
    0%, 100% {
        opacity: 1;
        color: #f97316;
        text-shadow: 0 1px 3px rgba(249, 115, 22, 0.5);
    }
    50% {
        opacity: 0.6;
        color: #fb923c;
        text-shadow: 0 2px 6px rgba(249, 115, 22, 0.8);
    }
}

/* 關注按鈕區域 */
.follow-button-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.follow-button {
    width: 100%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.follow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.follow-button:active {
    transform: translateY(0);
}

.follow-button:disabled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    cursor: not-allowed;
    opacity: 0.7;
}

.follow-text {
    display: block;
}

/* 貼士區域樣式 */
.tips-horses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 16px;
}

.tips-horse-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
}

.tips-horse-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #9ca3af;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

.tips-horse-name {
    font-size: 12px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.tips-race-time {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
}

.tips-early-view {
    text-align: center;
    margin-top: 8px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.tips-race-time-text {
    font-size: 12px;
    color: #6b7280;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
}

.tips-early-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    font-family: "Microsoft YaHei", "Source Han Sans TC", "Noto Sans TC", sans-serif;
}

.tips-early-link:hover {
    color: #f97316;
    text-decoration: underline;
}

/* 貼士投票記錄詳情樣式 */
.tips-vote-record {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.tips-vote-record .vote-record-item {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}

.tips-vote-record .race-title-outside {
    padding: 10px 16px 5px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tips-vote-record .race-title-text {
    font-size: 12px;
    color: #2c3e50;
    font-weight: 500;
}

.tips-vote-record .horses-section {
    padding: 10px 5px;
    background: #ffffff;
    border-bottom: 1px solid #f1f3f4;
}

.tips-vote-record .vote-record-header {
    background: #f8f9fa;
    padding: 10px 16px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    border-top: 1px solid #f1f3f4;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .user-info-section {
        margin: 6px;
        padding: 12px;
    }

    .user-avatar-large img {
        width: 44px;
        height: 44px;
    }

    .user-name-large {
        font-size: 16px;
    }

    .user-details {
        padding-right: 120px; /* 響應式調整：為總金額留出空間 */
    }

    .user-rankings-row {
        gap: 20px;
    }
    
    .recent-performance-inline {
        flex: 1 1 auto;
        min-width: 200px;
        max-width: 100%; /* 確保不超出父元素 */
    }
    
    .performance-tags {
        min-width: 180px;
        max-width: 100%; /* 確保不超出父元素 */
    }
    
    .hit-rate-badge {
        font-size: 9px;
        padding: 0;
    }
    
    .performance-rate {
        bottom: -8px;
        right: -2px;
        max-width: 100%; /* 確保不超出父元素 */
    }

    .ranking-badge {
        font-size: 13px;
    }

    .ranking-number {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .user-total-amount {
        font-size: 9px;
    }
    
    .user-name-large {
        max-width: 150px;
    }

    .performance-tags {
        gap: 1px;
    }

    .follow-button {
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 375px) {
    .user-info-section {
        margin: 4px;
        padding: 10px;
    }

    .user-avatar-large img {
        width: 40px;
        height: 40px;
    }

    .user-name-large {
        font-size: 15px;
    }

    .user-details {
        padding-right: 100px; /* 響應式調整：為總金額留出空間 */
    }

    .user-rankings-row {
        gap: 16px;
    }

    .ranking-badge {
        font-size: 12px;
    }

    .ranking-number {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }

    .user-total-amount {
        font-size: 8px;
    }
    
    .user-name-large {
        max-width: 120px;
    }
    
    .recent-performance-inline {
        flex: 1 1 auto;
        min-width: 160px;
        max-width: 100%; /* 確保不超出父元素 */
    }
    
    .performance-tags {
        min-width: 150px;
        max-width: 100%; /* 確保不超出父元素 */
    }
    
    .hit-rate-badge {
        font-size: 8px;
        padding: 0;
    }
    
    .performance-rate {
        bottom: -7px;
        right: -2px;
        max-width: 100%; /* 確保不超出父元素 */
    }
}
