/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --color-primary: #8b4513;
    --color-primary-light: #a0522d;
    --color-accent: #c41e3a;
    --color-bg-dark: #1e3c2f;
    --color-bg-medium: #2d5a3d;
    --color-paper: #f5f1e8;
    --color-paper-light: #fff8e1;
    --color-paper-accent: #ffecb3;
    --color-text: #3e2723;
    --color-text-secondary: #5d3a1a;
    --color-warning-bg: #ffebee;
    --color-info-bg: #e3f2fd;
    --color-info-border: #1976d2;
    --color-team-badge: #ff6f00;
    --shadow-large: 0 20px 60px rgba(0,0,0,0.4);
    --shadow-medium: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-small: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-image: 0 4px 12px rgba(0,0,0,0.15);
    --border-radius-large: 12px;
    --border-radius-medium: 8px;
    --border-radius-small: 20px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   Base Styles
   ============================================ */
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-medium) 50%, var(--color-bg-dark) 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.03) 2px,
        rgba(255,255,255,0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   Layout Container
   ============================================ */
.container {
    max-width: 900px;
    margin: 40px auto;
    background: var(--color-paper);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large), inset 0 0 100px rgba(139, 69, 19, 0.1);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 3px dashed var(--color-accent);
    border-radius: var(--border-radius-medium);
    pointer-events: none;
    opacity: 0.6;
}

/* ============================================
   Header
   ============================================ */
header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, var(--color-primary) 100%);
    color: #fff;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    border-bottom: 4px solid var(--color-accent);
}

header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 20px;
    background: var(--color-accent);
    border-radius: 50%;
    opacity: 0.3;
}

h1 {
    font-size: 2.2em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.3em;
    color: var(--color-paper);
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.badge-container {
    margin-top: 15px;
}

.tournament-badge {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    padding: 8px 20px;
    border-radius: var(--border-radius-small);
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: var(--shadow-medium);
}

.team-badge {
    display: inline-block;
    background: var(--color-team-badge);
    color: white;
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 0.85em;
    margin-left: 10px;
    font-weight: bold;
}

/* ============================================
   Main Content
   ============================================ */
.content {
    padding: 40px 50px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

section {
    margin-bottom: 35px;
    page-break-inside: avoid;
}

/* ============================================
   Typography
   ============================================ */
h2 {
    color: var(--color-primary);
    font-size: 1.5em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-accent);
    display: flex;
    align-items: center;
    font-weight: 700;
}

h2::before {
    content: '◆';
    color: var(--color-accent);
    margin-right: 10px;
    font-size: 0.8em;
}

h3 {
    color: var(--color-text-secondary);
    font-size: 1.2em;
    margin: 20px 0 12px 0;
    font-weight: 600;
}

p, li {
    line-height: 1.8;
    color: var(--color-text);
    font-size: 1.05em;
    margin-bottom: 10px;
}

ul, ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
    position: relative;
}

li::marker {
    color: var(--color-accent);
}

/* ============================================
   Components - Highlight Box
   ============================================ */
.highlight-box {
    background: linear-gradient(135deg, var(--color-paper-light) 0%, var(--color-paper-accent) 100%);
    border-left: 5px solid var(--color-accent);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 var(--border-radius-medium) var(--border-radius-medium) 0;
    box-shadow: var(--shadow-small);
}

.highlight-box strong {
    color: var(--color-accent);
    font-size: 1.1em;
}

.highlight-box ul {
    margin-top: 10px;
    margin-bottom: 0;
}

/* ============================================
   Components - Warning Box
   ============================================ */
.warning-box {
    background: var(--color-warning-bg);
    border: 2px solid var(--color-accent);
    border-radius: var(--border-radius-medium);
    padding: 20px;
    margin: 20px 0;
    color: var(--color-accent);
    font-weight: 500;
}

.warning-box::before {
    content: '⚠️ ';
    font-size: 1.2em;
}

/* ============================================
   Components - Info Box
   ============================================ */
.info-box {
    background: var(--color-info-bg);
    border-left: 5px solid var(--color-info-border);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 var(--border-radius-medium) var(--border-radius-medium) 0;
}

/* ============================================
   Components - Image Container
   ============================================ */
.image-container {
    background: white;
    border: 3px solid var(--color-primary);
    border-radius: var(--border-radius-large);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-image);
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-medium);
    display: block;
    margin: 0 auto;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.image-container img:hover {
    transform: scale(1.02);
}

.image-caption {
    margin-top: 15px;
    color: var(--color-text-secondary);
    font-size: 0.95em;
    font-weight: 500;
    font-style: italic;
}

/* ============================================
   Image Modal/Lightbox
   ============================================ */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--border-radius-medium);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #f1f1f1;
    font-size: 1.1em;
    padding: 10px;
}

/* ============================================
   Components - Tables
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: var(--border-radius-medium);
    overflow: hidden;
    box-shadow: var(--shadow-small);
}

th {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 600;
    font-size: 1.05em;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #e0e0e0;
    color: var(--color-text);
}

tr:nth-child(even) {
    background: #faf7f2;
}

tr:hover {
    background: var(--color-paper);
}

/* ============================================
   Components - Metric Cards
   ============================================ */
.key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.metric-card {
    background: white;
    border: 2px solid var(--color-accent);
    border-radius: var(--border-radius-medium);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.metric-value {
    font-size: 2em;
    color: var(--color-accent);
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.metric-label {
    color: var(--color-text-secondary);
    font-size: 0.95em;
    font-weight: 500;
}

/* ============================================
   Navigation
   ============================================ */
.page-nav {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.nav-link {
    color: var(--color-paper);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.nav-link:active {
    transform: translateY(0);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Offset for sticky nav when scrolling to anchor */
section[id] {
    scroll-margin-top: 60px;
}

/* ============================================
   Footer
   ============================================ */
.contact-footer {
    background: var(--color-text);
    color: var(--color-paper);
    padding: 30px;
    text-align: center;
    margin-top: 40px;
    border-radius: 0 0 var(--border-radius-large) var(--border-radius-large);
}

.contact-footer p {
    color: var(--color-paper);
    margin: 5px 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .container {
        margin: 20px 10px;
    }

    .nav-container {
        padding: 0 10px;
        gap: 4px;
    }

    .nav-link {
        padding: 4px 8px;
        font-size: 0.8em;
    }

    section[id] {
        scroll-margin-top: 50px;
    }

    .content {
        padding: 25px;
    }

    h1 {
        font-size: 1.6em;
    }

    .key-metrics {
        grid-template-columns: 1fr;
    }

    .image-container {
        padding: 10px;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 10px;
    }

    .team-badge {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
        margin: 0;
    }

    .container::before {
        display: none;
    }

    .image-container {
        break-inside: avoid;
    }

    .page-nav {
        display: none;
    }

    section[id] {
        scroll-margin-top: 0;
    }
}
