/* ===== Livescore2 Base Reset ===== */
body {
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== Livescore2 Banner ===== */
.ls-banner-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
}
.ls-banner-wrap img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
    object-position: center center;
}
.ls-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
    pointer-events: none;
}

/* Banner Overlay - Home & Language button */
.ls-banner-lang {
    position: absolute;
    bottom: 16px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}
.ls-banner-home {
    color: #fff;
    background: rgba(0,0,0,0.4);
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.88rem;
    backdrop-filter: blur(4px);
    transition: all 0.25s;
}
.ls-banner-home:hover {
    background: rgba(0,0,0,0.65);
    text-decoration: none;
}
.ls-banner-wrap .ls-lang-btn {
    color: #fff;
    border: 1px solid rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.4);
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.88rem;
    backdrop-filter: blur(4px);
    transition: all 0.25s;
}
.ls-banner-wrap .ls-lang-btn:hover {
    background: rgba(255,255,255,0.9);
    color: #b8860b;
    text-decoration: none;
}

/* ===== Main Content Area ===== */
.ls-main {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
    box-sizing: border-box;
}

/* ===== Breadcrumb ===== */
.ls-breadcrumb {
    padding: 0 0 16px 0;
    font-size: 0.9rem;
    color: #888;
}
.ls-breadcrumb a { color: #b8860b; }
.ls-breadcrumb a:hover { text-decoration: underline; }

/* ===== Game List (Index) ===== */
.ls-header h1 {
    font-size: 1.4rem;
    color: #b38300;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffe395;
}

/* ===== Search Form ===== */
.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(184,134,11,0.1);
    flex-wrap: wrap;
}
.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    transition: border-color 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: #b38300;
}
.search-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 100px;
}
.search-select:focus {
    outline: none;
    border-color: #b38300;
}
.search-btn {
    padding: 8px 20px;
    background: #b38300;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.search-btn:hover {
    background: #8b6914;
}
.search-clear {
    padding: 8px 16px;
    color: #666;
    font-size: 14px;
    background: #f5f5f5;
    border-radius: 4px;
    transition: background 0.2s;
}
.search-clear:hover {
    background: #e0e0e0;
}

.game-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(184,134,11,0.1);
    overflow: hidden;
}
.game-row {
    padding: 13px 24px;
    border-bottom: 1px solid #fff1ce;
}
.game-row:last-child { border-bottom: none; }
.game-row-even { background: #fff; }
.game-row-odd { background: #fafafa; }
.game-row a {
    color: #8b6914;
    font-size: 0.95rem;
    font-weight: 500;
    display: block;
}
.game-row a:hover {
    color: #d4940a;
    text-decoration: underline;
}

/* ===== Result Page ===== */
.result-title {
    text-align: center;
    margin-bottom: 20px;
}
.result-title h1 {
    font-size: 1.35rem;
    color: #b38300;
    font-weight: 700;
}
.up-html {
    text-align: center;
    margin-bottom: 16px;
}
.report-download-notice {
    text-align: center;
    background: #fff1ce;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.report-download-notice a { color: #b8860b; font-weight: 500; }

/* ===== Desktop-only / Mobile-only helpers ===== */
.hdr-mobile { display: none; }
.hdr-desktop { display: inline; }
.date-short { display: none; }
.date-full { display: inline; }

/* ===== Match Section ===== */
.match-section {
    margin-bottom: 24px;
}
.round-header {
    background: #ffdd80;
    color: #5d4200;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    font-weight: 600;
}
.match-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.match-table th {
    background: #fff1cc;
    color: #5d4200;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}
.match-table td {
    padding: 10px 12px;
    font-size: 0.88rem;
    text-align: center;
    border-bottom: 1px solid #fff1ce;
}
.match-table .row-odd { background: #fff; }
.match-table .row-even { background: #fafafa; }
.col-no { width: 50px; }
.col-date { width: 100px; }
.col-time { width: 60px; }
.col-team { width: 180px; }
.col-score { width: 100px; }
.col-report { width: 180px; white-space: nowrap; }

/* ===== Report PDF Links ===== */
.pdf-link {
    display: inline-block;
    padding: 2px 4px;
    margin: 0 1px;
    background: #ffe395;
    color: #8b6914;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}
.pdf-link:hover {
    background: #d4940a;
    color: #fff;
    text-decoration: none;
}

/* ===== Report Column Desktop/Mobile Toggle ===== */
.report-mobile { display: none; }
.report-toggle-btn {
    background: #ffe395;
    color: #8b6914;
    border: none;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.report-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background: #fff;
    border: 1px solid #ffe395;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    min-width: 80px;
    padding: 4px 0;
}
.report-mobile { position: relative; }
.report-mobile.open .report-dropdown { display: block; }
.report-dropdown-item {
    display: block;
    padding: 6px 14px;
    font-size: 0.78rem;
    color: #8b6914;
    white-space: nowrap;
}
.report-dropdown-item:hover {
    background: #ffe395;
    text-decoration: none;
}

/* ===== Legend & Back ===== */
.ls-legend {
    margin-top: 24px;
    padding: 16px;
    background: #fff1ce;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
}
.ls-legend strong { color: #5d4200; }
.ls-back {
    margin-top: 20px;
    padding-bottom: 20px;
}
.ls-back a {
    color: #b8860b;
    font-size: 0.9rem;
    font-weight: 500;
}
.ls-back a:hover { text-decoration: underline; }

/* ===== No Data ===== */
.no-data {
    text-align: center;
    padding: 48px 20px;
    color: #999;
    font-size: 0.95rem;
    background: #fff;
    border-radius: 8px;
}

/* ===== Livescore2 Footer ===== */
.ls-footer {
    background: linear-gradient(135deg, #b8860b, #d4940a);
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 18px;
    margin-top: auto;
    font-size: 0.85rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 0;
}
.page-btn {
    padding: 8px 18px;
    background: #d4940a;
    color: #fff;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.page-btn:hover:not(.disabled) {
    background: #b8860b;
    text-decoration: none;
}
.page-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
}
.page-info {
    color: #666;
    font-size: 0.9rem;
}
.total-count {
    font-size: 0.85rem;
    color: #888;
    font-weight: normal;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .ls-banner-wrap img { max-height: 220px; }
}
@media (max-width: 768px) {
    .ls-banner-wrap img { max-height: 160px; }
    .ls-banner-lang { bottom: 10px; right: 12px; gap: 8px; }
    .ls-banner-home, .ls-banner-wrap .ls-lang-btn { padding: 5px 12px; font-size: 0.78rem; }
    .ls-banner-overlay { height: 50px; }
    .ls-footer { font-size: 0.75rem; padding: 12px; }
    .ls-main { padding: 12px; }
    .ls-container { padding: 0; }
    .ls-header h1 { font-size: 1.15rem; }
    .search-form { gap: 6px; padding: 8px 10px; flex-wrap: wrap; }
    .search-input { padding: 6px 10px; font-size: 13px; width: 100%; box-sizing: border-box; }
    .search-select { padding: 6px 10px; font-size: 13px; min-width: 0; flex: 1; }
    .search-btn { padding: 6px 14px; font-size: 13px; }
    .search-clear { padding: 6px 12px; font-size: 13px; }
    .game-row { padding: 10px 14px; }
    .game-row a { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .result-title h1 { font-size: 1.1rem; }
    .up-html { font-size: 0.82rem; padding: 0 2px; }
    .report-table { width: 100% !important; margin: 8px auto !important; }
    .report-table td { font-size: 12px !important; height: 32px !important; line-height: 32px !important; padding: 2px !important; }
    .team-table { width: 100% !important; margin: 8px auto !important; }
    .team-table td { font-size: 12px !important; height: 32px !important; line-height: 32px !important; padding: 2px !important; }
    .report-download-notice { font-size: 0.78rem; padding: 8px 4px; margin-bottom: 12px; }
    .report-download-notice a { font-size: 0.75rem; word-break: break-all; }
    .round-header { font-size: 0.9rem; padding: 8px 12px; }
    .match-table th, .match-table td { padding: 6px 8px; font-size: 0.8rem; }
    .col-no { width: 30px; }
    .col-date { width: 60px; }
    .col-time { width: 60px; }
    .col-score { width: 90px; }
    .col-team { width: 140px; }
    .ls-legend { font-size: 0.78rem; padding: 12px; }
    .ls-back a { font-size: 0.82rem; }
    .page-btn { padding: 6px 12px; font-size: 0.8rem; }
    .pagination { gap: 8px; }
    /* Report column: show dropdown on mobile */
    .report-desktop { display: none; }
    .report-mobile { display: inline-block; }
    /* Mobile table header shortcuts */
    .hdr-mobile { display: inline; }
    .hdr-desktop { display: none; }
    .date-short { display: inline; }
    .date-full { display: none; }
}
@media (max-width: 480px) {
    .ls-banner-wrap img { max-height: 110px; }
    .ls-banner-lang { bottom: 6px; right: 8px; gap: 6px; }
    .ls-banner-home, .ls-banner-wrap .ls-lang-btn { padding: 4px 10px; font-size: 0.72rem; }
    .ls-footer { font-size: 0.68rem; padding: 10px; }
    .ls-main { padding: 8px; }
    .ls-header h1 { font-size: 1rem; margin-bottom: 10px; }
    .search-form { gap: 5px; padding: 6px 8px; }
    .search-input { padding: 5px 8px; font-size: 12px; }
    .search-select { padding: 5px 8px; font-size: 12px; }
    .search-btn { padding: 5px 12px; font-size: 12px; }
    .search-clear { padding: 5px 10px; font-size: 12px; }
    .game-row { padding: 8px 10px; }
    .game-row a { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .game-no { display: none; }
    .result-title h1 { font-size: 0.95rem; }
    .up-html { font-size: 0.75rem; padding: 0 2px; }
    .report-table td { font-size: 11px !important; height: 28px !important; line-height: 28px !important; }
    .team-table td { font-size: 11px !important; height: 28px !important; line-height: 28px !important; }
    .report-download-notice { font-size: 0.72rem; padding: 6px 2px; }
    .report-download-notice a { font-size: 0.68rem; }
    .round-header { font-size: 0.82rem; padding: 6px 10px; }
    .match-table th, .match-table td { padding: 4px 5px; font-size: 0.72rem; }
    .col-report { width: 60px; }
    .report-toggle-btn { font-size: 0.7rem; padding: 3px 8px; }
    .report-dropdown-item { font-size: 0.72rem; padding: 5px 10px; }
    .page-btn { padding: 5px 10px; font-size: 0.75rem; }
    .page-info { font-size: 0.78rem; }
    .pagination { gap: 6px; flex-wrap: wrap; justify-content: center; }
}
