/* Shenzhen Schools Database - Stylesheet */
:root {
    --primary: #1a73e8;
    --primary-light: #e8f0fe;
    --primary-dark: #1557b0;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* Header */
header {
    background: var(--primary);
    color: white;
    padding: 16px 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}
header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
header h1 { font-size: 20px; font-weight: 600; white-space: nowrap; }
header h1 a { color: white; text-decoration: none; }
header nav { display: flex; gap: 16px; align-items: center; }
header nav a { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 14px; }
header nav a:hover { color: white; }

/* Search bar */
.search-bar {
    display: flex;
    max-width: 400px;
    flex: 1;
}
.search-bar input {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 20px 0 0 20px;
    font-size: 14px;
    outline: none;
}
.search-bar button {
    padding: 8px 16px;
    background: var(--primary-dark);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-left: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-size: 14px;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #4285f4 100%);
    color: white;
    padding: 48px 0;
    text-align: center;
}
.hero h2 { font-size: 32px; margin-bottom: 8px; }
.hero p { font-size: 16px; opacity: 0.9; margin-bottom: 24px; }
.hero .stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 24px;
}
.hero .stat { text-align: center; }
.hero .stat-num { font-size: 36px; font-weight: 700; }
.hero .stat-label { font-size: 13px; opacity: 0.8; }

/* District grid */
.district-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 32px 0;
}
.district-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}
.district-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.district-card h3 { font-size: 20px; margin-bottom: 8px; color: var(--primary); }
.district-card .meta { color: var(--text-secondary); font-size: 14px; }
.district-card .count {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
}
.district-card .no-data {
    background: #f1f3f4;
    color: var(--text-secondary);
}

/* School table */
.school-table-wrap { overflow-x: auto; }
.school-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.school-table th, .school-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.school-table th {
    background: #f1f3f4;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}
.school-table th[data-sort] { cursor: pointer; position: relative; padding-right: 22px; }
.school-table th[data-sort]:hover { background: #e2e5e8; }
.school-table th[data-sort]::after { content: '⇅'; position: absolute; right: 6px; opacity: 0.3; font-size: 12px; }
.school-table th.sort-asc::after { content: '▲'; opacity: 0.8; color: var(--primary); }
.school-table th.sort-desc::after { content: '▼'; opacity: 0.8; color: var(--primary); }
.col-score { text-align: center; min-width: 60px; }
.school-table tr:hover { background: var(--primary-light); }
.school-table a { color: var(--primary); text-decoration: none; }
.school-table a:hover { text-decoration: underline; }

/* School detail */
.school-header {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 24px 0;
}
.school-header h2 { font-size: 28px; margin-bottom: 4px; }
.school-header .district-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.info-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.info-card h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-card .value { font-size: 24px; font-weight: 600; color: var(--primary); }
.info-card .detail { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); font-size: 14px; }
.info-value { font-weight: 500; font-size: 14px; }

/* Score table */
.score-section { margin: 24px 0; }
.score-section h3 { font-size: 18px; margin-bottom: 16px; }

/* Breadcrumb */
.breadcrumb {
    padding: 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 8px; }

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.badge-green { background: #e6f4ea; color: #137333; }
.badge-yellow { background: #fef7e0; color: #b05a00; }
.badge-red { background: #fce8e6; color: #c5221f; }
.badge-gray { background: #f1f3f4; color: var(--text-secondary); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }

/* Footer */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 48px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}
footer a { color: var(--primary); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
    .hero h2 { font-size: 24px; }
    .hero .stats { gap: 20px; }
    .hero .stat-num { font-size: 28px; }
    .district-grid { grid-template-columns: 1fr; }
    header .container { flex-wrap: wrap; }
    .search-bar { max-width: 100%; order: 3; width: 100%; }
}
