:root {
    --primary:    #1a5fb4;
    --primary-dk: #0d3d7a;
    --primary-lt: #e8f0fb;
    --accent:     #e67e22;
    --accent-lt:  #fef3e8;
    --success:    #2ecc71;
    --bg:         #f4f7fc;
    --card-bg:    #ffffff;
    --text:       #1e2a3b;
    --text-muted: #6b7c93;
    --border:     #dce6f5;
    --radius:     10px;
    --shadow:     0 2px 12px rgba(26,95,180,.09);
    --shadow-md:  0 4px 20px rgba(26,95,180,.13);
}
body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
}
/* ── Breadcrumb ── */
.page-breadcrumb {
    background: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary) 100%);
    padding: 14px 0;
}
.page-breadcrumb .breadcrumb { margin: 0; }
.page-breadcrumb .breadcrumb-item,
.page-breadcrumb .breadcrumb-item a {
    color: rgba(255,255,255,.75);
    font-size: .85rem;
    text-decoration: none;
}
.page-breadcrumb .breadcrumb-item.active,
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: #fff; }
.page-breadcrumb .breadcrumb-item a:hover { color: #fff; }

/* ── Search Bar ── */
.search-wrap { position: relative; }
.search-wrap input {
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: .55rem 3rem .55rem 1.25rem;
    font-size: .9rem;
    width: 100%;
    background: #fff;
    transition: border-color .2s;
}
.search-wrap input:focus { outline: none; border-color: var(--primary); }
.search-wrap .btn-search {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    background: var(--primary); color: #fff; border: none;
    border-radius: 50px; padding: .4rem .85rem; font-size: .85rem; cursor: pointer;
}
.search-wrap .btn-search:hover { background: var(--primary-dk); }

/* ── Section Title ── */
.section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem; font-weight: 700;
    color: var(--text); margin-bottom: 1rem;
    padding-left: .75rem;
    border-left: 4px solid var(--primary);
}
.section-title small { font-size: .78rem; font-weight: 400; color: var(--text-muted); margin-left: .5rem; }

/* ── Grade Filter Cards ── */
.filter-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.filter-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .5rem 0; }
.filter-group:not(:last-child) { border-bottom: 1px solid var(--border); }
.filter-label {
    font-size: .8rem; font-weight: 600; color: var(--text-muted);
    white-space: nowrap; min-width: 5rem;
}
.btn-grade {
    display: inline-block;
    padding: .3rem .85rem;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 500;
    background: var(--primary-lt);
    color: var(--primary);
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: all .18s;
}
.btn-grade:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Composition Ranking Card ── */
.ranking-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    height: 100%;
}
.ranking-card .card-header-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .85rem; padding-bottom: .75rem;
    border-bottom: 2px solid var(--border);
}
.ranking-card .card-header-row h5 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1rem; font-weight: 700;
    color: var(--text); margin: 0;
}
.ranking-card .view-more {
    font-size: .78rem; color: var(--primary); text-decoration: none;
}
.ranking-card .view-more:hover { text-decoration: underline; }

.rank-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem .25rem;
    border-bottom: 1px dashed var(--border);
    gap: .5rem;
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 4px;
    font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.rank-num.top { background: var(--primary); color: #fff; }
.rank-num.other { background: #e9ecef; color: var(--text-muted); }
.rank-item a {
    font-size: .85rem; color: var(--text); text-decoration: none;
    flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-item a:hover { color: var(--primary); }
.word-badge {
    font-size: .72rem; background: #e6f4ea; color: #1e7e34;
    border-radius: 4px; padding: .1rem .4rem; flex-shrink: 0;
}

/* ── Main spacing ── */
.main-content { padding: 2rem 0 3rem; }

/* ── Responsive ── */
@media (max-width: 767px) {
    .ranking-card { margin-bottom: 1rem; }
    .filter-group { gap: .4rem; }
}