/* 基本樣式 */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #fff;
}

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

.upcoming-matches {
    background-color: #ffffff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 新聞頁面專用的紅色背景標題 */
.news-section .section-title,
.ranking-section .section-title,
.ranking-section h2 {
    font-size: 22px;
    margin-bottom: 5px;
    color: white;
    background-color: #dc3545;
    padding: 6px 16px;
    border-radius: 4px;
    margin-top: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Top Lady 專用的粉紅色背景標題 */
.ranking-section h3.section-title {
    font-size: 22px;
    margin-bottom: 5px;
    color: white;
    background-color: #F33994 !important;
    padding: 6px 16px;
    border-radius: 4px;
    margin-top: 20px;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* 比賽區塊專用的紅色背景標題 */
.matches-section .section-title {
    font-size: 22px;
    margin-bottom: 5px;
    color: white;
    background-color: #dc3545;
    padding: 6px 16px;
    border-radius: 4px;
    margin-top: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* 日期樣式 */
.match-date {
    text-align: center;
    margin: 20px 0 10px 0;
    padding: 5px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    border-radius: 4px;
}

/* 比賽列表容器 */
.matches-container {
    margin: 10px 0;
}

/* 比賽項目基本樣式 */
.match-item {
    background-color: #f8f8f8;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.match-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.match-item:nth-child(even) {
    background-color: #ffffff;
}

/* 比賽代碼樣式 */
.game-code {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

/* 場地文字樣式 */
.venue-text {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

/* 表格布局 */
.match-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* 隊伍列樣式 */
.team-col {
    width: 45%;
    padding: 0 5px;
    vertical-align: middle;
}

.team-left {
    text-align: right;
}

.team-right {
    text-align: left;
}

/* VS列樣式 */
.vs-col {
    width: 10%;
    text-align: center;
    font-weight: bold;
    color: #e84855;
    font-size: 14px;
    vertical-align: middle;
}

/* 隊伍名稱樣式 */
.team-col .team-name {
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color 0.2s ease;
}

.match-item:hover .team-col .team-name {
    color: #dc3545;
}

/* 分數樣式 */
.team-col .score {
    font-weight: bold;
    font-size: 16px;
    color: #e84855;
    line-height: 1.1;
}

/* 左右對齊 */
.team-left .team-name,
.team-left .score {
    text-align: right;
    padding-right: 2px;
}

.team-right .team-name,
.team-right .score {
    text-align: left;
    padding-left: 2px;
}

/* ===== 響應式布局 ===== */

/* 一般小螢幕裝置 */
@media screen and (max-width: 480px) {
    .match-item {
        padding: 6px 8px;
    }
    
    .team-col .team-name {
        font-size: 13px;
    }
    
    .team-col .score {
        font-size: 15px;
    }
    
    .vs-col {
        font-size: 12px;
    }
    
    .match-date {
        font-size: 15px;
        margin: 15px 0 8px 0;
    }
}

/* iPhone 14 Pro Max (430px) */
@media screen and (min-width: 415px) and (max-width: 430px) {
    .match-item {
        padding: 6px 5px;
    }
    
    .team-col {
        width: 46%;
        padding: 0;
    }
    
    .vs-col {
        width: 8%;
        font-size: 11px;
        padding: 0;
    }
    
    .team-col .team-name {
        font-size: 13px;
    }
    
    .team-left .team-name,
    .team-left .score {
        padding-right: 0;
    }
    
    .team-right .team-name,
    .team-right .score {
        padding-left: 0;
    }
    
    .venue-text {
        font-size: 9px;
    }
    
    .game-code {
        font-size: 10px;
        margin-bottom: 3px;
    }
}

/* iPhone 12/13 (390px) */
@media screen and (min-width: 376px) and (max-width: 414px) {
    .match-item {
        padding: 6px 6px;
    }
    
    .team-col {
        width: 46%;
        padding: 0 2px;
    }
    
    .vs-col {
        width: 8%;
        font-size: 10px;
        padding: 0;
    }
    
    .team-col .team-name {
        font-size: 12px;
    }
    
    .team-col .score {
        font-size: 15px;
    }
    
    .upcoming-matches {
        padding: 15px;
    }
    
    .news-section .section-title,
    .ranking-section .section-title,
    .ranking-section h2,
    .matches-section .section-title {
        font-size: 18px;
        padding: 5px 14px;
    }
}

/* iPhone SE/小螢幕設備(375px) */
@media screen and (max-width: 375px) {
    .match-item {
        padding: 5px 5px;
    }
    
    .team-col {
        padding: 0 1px;
    }
    
    .vs-col {
        font-size: 10px;
        padding: 0;
    }
    
    .team-col .team-name {
        font-size: 12px;
    }
    
    .team-col .score {
        font-size: 14px;
    }
    
    .match-date {
        font-size: 15px;
    }
}

/* 超小螢幕設備(320px) */
@media screen and (max-width: 320px) {
    .team-col .team-name {
        font-size: 11px;
    }
    
    .team-col .score {
        font-size: 13px;
    }
    
    .vs-col {
        font-size: 9px;
    }
}

/* ===== 其他樣式 ===== */

/* 新聞內容相關樣式 */
.news-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.news-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.news-date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.news-title {
    color: #333;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.news-text {
    color: #444;
    line-height: 1.6;
}

.news-image {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    display: block;
}

/* 排行榜相關樣式 */
.rankings {
    display: block;
    margin-bottom: 18px;
}

.ranking-section {
    background-color: #fff;
    padding: 2px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.ranking-table th,
.ranking-table td {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

.ranking-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    font-size: 12px;
}

.ranking-table tr:hover {
    background-color: #f9f9f9;
}

/* 姓名欄位粗體 */
.ranking-table td:nth-child(2) {
    font-weight: bold;
}

/* 當螢幕寬度大於 400px 時切換為雙欄 */
@media screen and (min-width: 480px) {
    .rankings {
        display: flex;
        justify-content: space-between;
        gap: 3px;
    }

    .ranking-section {
        flex: 1;
        margin-bottom: 0;
    }
}

/* 通知相關樣式 */
.toast {
    position: fixed;
    left: 50%;
    top: 65%;
    transform: translate(-50%, -50%) scale(0.7);
    background-color: rgba(250, 137, 147, 0.721);
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

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

/* 點擊相關樣式 */
.match-item.clickable {
    cursor: pointer;
}

.view-result {
    font-size: 14px;
    color: #fa363a;
    font-weight: bold;
}

/* 店家資訊相關樣式 */
.venue-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.venue-list {
    display: grid;
    gap: 15px;
    margin-top: 10px;
}

.venue-item {
    padding: 12px;
    background-color: #f8f8f8;
    border-radius: 6px;
    border-left: 4px solid #fa363a;
}

.venue-item h3 {
    font-size: 0.95em;
    margin: 0 0 5px 0;
}

.venue-teams {
    font-size: 0.85em;
    font-weight: normal;
}

.venue-item p {
    margin: 5px 0;
    color: #444;
}

/* 地址行樣式 */
.address-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    color: #444;
}

/* 地圖圖標樣式 */
.map-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    cursor: pointer;
}

.map-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.map-link:hover .map-icon {
    opacity: 0.8;
}

/* 內容容器 */
.matches-content {
    text-align: center;
}

.matches-content .match-item {
    margin: 6px 0;
}

/* ==================== 新聞區塊樣式 ==================== */

/* 新聞區塊與其他區塊保持一致的間距 */
.news-section {
    margin-bottom: 5px;
}

/* 新聞內容區域，限制間距 */
.news-content {
    margin-bottom: 0;
    padding-bottom: 0;
    margin-top: 5px;
}

/* 新聞頁面容器優化 */
.container {
    min-height: auto !important;
    /* margin-bottom: 20px !important; */
    padding-bottom: 20px !important;
}

/* 新聞展開/收起功能 */
.news-expand-section {
    display: none;
}

.news-expand-section.show-all {
    display: block;
}

.expand-toggle {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    margin-bottom: 15px;
}

.expand-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 12px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

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

/* 確保新聞頁面沒有多餘的底部空間 */
body.news-page {
    padding-bottom: 10px !important;
}

/* 針對新聞頁面進一步優化間距 */
.news-section .section-title {
    margin-bottom: 3px;
    margin-top: 0;
}

/* 新聞頁面內容區域優化 */
#content {
    margin-top: 10px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* ==================== 折疊功能樣式 ==================== */

/* 比賽區塊折疊樣式 */
.matches-section {
    margin-bottom: 5px;
}

.matches-item.collapsible {
    border: none;
    border-radius: 0;
    margin-bottom: 1px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    transition: all 0.3s ease;
}

.matches-item.collapsible:hover {
    background: rgba(0, 0, 0, 0.02);
}

.matches-header {
    display: block;
    padding: 15px 20px;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

.matches-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.matches-header.expanded {
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
    border-bottom: 2px solid #6c757d;
}

.matches-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.matches-header .matches-date {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.matches-header .expand-icon {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.matches-header.expanded .expand-icon {
    transform: rotate(45deg);
}

.matches-content.collapsed {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.matches-content.expanded {
    max-height: 1000px;
    padding-top: 20px;
    padding-bottom: 20px;
    opacity: 1;
    transition: all 0.3s ease;
}

/* 響應式樣式 */
@media (max-width: 768px) {
    .matches-header {
        padding: 12px 15px;
    }
    
    .matches-header .matches-date {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .matches-header {
        padding: 10px 12px;
    }
    
    .matches-header .matches-date {
        font-size: 14px;
    }
}

/* ==================== 折疊新聞功能樣式 ==================== */

/* 可折疊新聞項目樣式 */
.news-item.collapsible {
    border: none;
    border-radius: 0;
    margin-bottom: 1px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    transition: all 0.3s ease;
}

.news-item.collapsible:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* 新聞標題區域 */
.news-header {
    display: block;
    padding: 10px 15px;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
}

.news-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.news-header.expanded {
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
    color: #495057;
}

.news-header.expanded .news-date,
.news-header.expanded .news-title {
    color: #495057;
}

/* 日期樣式 */
.news-header .news-date {
    display: inline;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    margin-right: 12px;
}

.news-header.expanded .news-date {
    color: #495057;
}

/* 標題樣式 */
.news-header .news-title {
    display: inline;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin: 0;
}



/* 新聞內容區域 */
.news-text {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    background: #ffffff;
}

.news-text.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.news-text.expanded {
    max-height: 2000px; /* 足夠大的值來容納內容 */
    padding-top: 20px;
    padding-bottom: 20px;
    opacity: 1;
}

/* 新聞內容文字樣式 */
.news-text p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #333;
}

.news-text strong {
    color: #dc3545;
    font-weight: 600;
}

.news-text em {
    color: #666;
    font-style: italic;
}

/* 折疊功能響應式設計 */
@media (max-width: 768px) {
    .news-header {
        padding: 8px 12px;
    }
    
    .news-header .news-date {
        display: block;
        margin-bottom: 8px;
        margin-right: 0;
    }
    
    .news-header .news-title {
        display: block;
        font-size: 16px;
    }
    

    
    .news-text {
        padding: 0 15px;
    }
    
    .news-text.expanded {
        padding-top: 15px;
        padding-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .news-header {
        padding: 6px 10px;
    }
    
    .news-header .news-title {
        font-size: 15px;
    }
    
    .news-header .news-date {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .news-text {
        padding: 0 12px;
    }
    
    .news-text.expanded {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

