:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-dark: #1d4ed8;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

ul {
    list-style: none;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-weight: 800;
    font-size: 22px;
    color: var(--primary);
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
}

.header-search {
    position: relative;
    width: 160px;
    transition: width 0.2s ease;
}

.header-search-input {
    width: 100%;
    padding: 8px 35px 8px 15px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--bg-body);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.header-search-input:focus {
    background: #fff;
    border-color: var(--primary);
}

.header-search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
}

.header-search-btn:hover {
    color: var(--primary);
}

.home-page .header-search {
    display: none !important;
}

.home-page .header {
    border-bottom: none !important;
}

.home-page .header-content {
    justify-content: flex-start;
}

.hero-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 30px;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-search-box {
    width: 100%;
    max-width: 680px;
    margin: 0 auto 25px;
    position: relative;
}

.hero-input {
    width: 100%;
    padding: 16px 60px 16px 25px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: #fff;
    box-shadow: var(--shadow);
    outline: none;
    transition: border 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.hero-input:focus {
    border-color: var(--primary);
}

.hero-submit-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    width: 48px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-submit-btn:hover {
    background: var(--primary-dark);
}

.trending-chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-sub);
    align-items: center;
}

.chip {
    background: #fff;
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    color: #475569;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.home-section {
    padding: 40px 0 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sec-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.sec-link {
    font-size: 14px;
    color: var(--primary);
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

.cat-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--primary);
}

.cat-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.cat-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.m-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.m-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.2s;
}

.m-text {
    font-weight: 500;
    color: var(--text-main);
    font-size: 15px;
}

.m-icon {
    color: #cbd5e1;
    font-size: 20px;
    margin-left: 10px;
}

.m-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.initial-section {
    background: var(--bg-body);
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    margin-top: 40px;
}

.initial-title {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.initial-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.initial-link {
    font-size: 13px;
    color: var(--text-sub);
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.initial-link:hover {
    color: var(--primary);
    border-color: var(--border);
    background: #fff;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--text-sub);
    margin: 20px 0;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.current-crumb {
    color: var(--text-main);
    font-weight: 500;
}

.entry-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 30px;
    margin-bottom: 40px;
}

.entry-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 25px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
    justify-content: center;
}

.btn-copy,
.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-copy:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.fact-value .btn-copy {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.meta-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: #f1f5f9;
    color: var(--text-sub);
}

.summary-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 0 8px 8px 0;
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.summary-icon {
    color: var(--primary);
    font-size: 24px;
    flex-shrink: 0;
}

.summary-text {
    color: #334155;
    font-size: 15px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.fact-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: transform 0.2s, border-color 0.2s;
}

.fact-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.fact-icon-box {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 18px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.fact-info {
    flex: 1;
    min-width: 0;
}

.fact-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-sub);
    font-weight: 600;
    margin-bottom: 5px;
}

.fact-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    word-break: break-word;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-blue {
    background: #e0f2fe;
    color: #0284c7;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.badge-purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.badge-yellow {
    background: #fef9c3;
    color: #a16207;
}

.badge-red {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-gray {
    background: #f1f5f9;
    color: #475569;
}

.example-section {
    margin-bottom: 40px;
    padding: 10px 24px;
}

.example-content {
    color: #475569;
    line-height: 1.8;
}

.example-content li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-sub);
    margin: 40px 0 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

i.ri-folder-3-line {
    color: var(--primary);
}

.more-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.more-list-item:last-child {
    border-bottom: none;
}

.more-list-item:hover {
    background: #f8fafc;
}

.list-link {
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.list-link:hover {
    text-decoration: underline;
}

.list-cat {
    font-size: 12px;
    color: var(--text-sub);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.page-header {
    padding: 20px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.page-title.single {
    margin: 0;
}

.page-header p {
    margin-top: 10px;
    color: #64748b;
}

.page-body {
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 80px;
    min-height: 300px;
}

.page-body h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin: 40px 0 20px;
}

.page-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 30px 0 15px;
}

.page-body p {
    margin-bottom: 20px;
}

.page-body ul {
    margin-bottom: 20px;
    padding-left: 20px;
    list-style-type: disc;
}

.page-body a {
    color: var(--primary);
    text-decoration: underline;
}

.footer,
.home-footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 60px;
    background: #fff;
}

.home-footer {
    margin-top: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin: 0 auto;
}

.footer-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.group-label {
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

.home-footer a {
    color: #555;
    text-decoration: none;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
}

.home-footer a:hover {
    color: #000;
}


.copyright {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 20px;
}

#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

.pager {
    margin-top: 50px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pager a,
.pager b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-sub);
    font-size: 14px;
    font-weight: 500;
}

.pager b {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pager a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

@media (min-width: 640px) {
    .header-search {
        width: 260px;
    }

    .hero-section {
        padding: 80px 20px;
    }

    .hero-title {
        margin-bottom: 40px;
    }

    .hero-input {
        padding: 22px 70px 22px 35px;
        font-size: 18px;
    }

    .hero-submit-btn {
        width: 56px;
        height: 56px;
        right: 8px;
        top: 8px;
        font-size: 24px;
    }

    .cat-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }

    .m-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .footer-group {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        width: auto;
    }

    .group-label {
        margin-bottom: 0;
        margin-right: 10px;
        display: inline-block;
    }

    .home-footer a {
        font-size: 14px;
        padding: 0;
    }

    .copyright {
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .m-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}