
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f0f0;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: #e65100; text-decoration: none; }
a:hover { text-decoration: underline; }


.header {
    background: #e65100;
    border-bottom: 4px solid #bf360c;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.header-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.header-topbar a {
    color: rgba(255,255,255,0.8);
    margin-left: 16px;
}
.header-topbar a:hover { color: #fff; text-decoration: none; }

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}
.header-logo:hover { text-decoration: none; }

.header-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
}

.header-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-logo-text p {
    font-size: 10px;
    color: rgba(255,255,255,0.7);
}

.header-search {
    display: flex;
}

.header-search input {
    width: 256px;
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    color: #333;
}
.header-search input:focus {
    box-shadow: 0 0 0 2px #ffcc80;
}

.header-search button {
    padding: 6px 16px;
    background: #bf360c;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
}
.header-search button:hover { background: #8f2908; }

.header-nav {
    display: flex;
    gap: 4px;
    padding-bottom: 0;
    margin-bottom: -4px;
}

.header-nav a {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    border-radius: 4px 4px 0 0;
    text-decoration: none;
}
.header-nav a:hover, .header-nav a.active {
    color: #fff;
    background: #bf360c;
    text-decoration: none;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    gap: 24px;
}

.main-content {
    flex: 1;
    min-width: 0;
}


.welcome-box {
    background: #fff;
    border: 1px solid #ccc;
    margin-bottom: 16px;
}

.welcome-box .box-header {
    background: #e65100;
    padding: 8px 16px;
}

.welcome-box .box-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.welcome-box .box-body {
    padding: 16px;
}

.welcome-box .box-body p {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 12px;
}

.welcome-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 4px;
}


.articles-box {
    background: #fff;
    border: 1px solid #ccc;
}

.articles-box .box-header {
    background: #e65100;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.articles-box .box-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}


.terms-table-header {
    display: grid;
    grid-template-columns: 1fr 80px 96px;
    gap: 16px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid #ccc;
    font-size: 12px;
    font-weight: 700;
    color: #666;
}

.terms-table-header .col-views,
.terms-table-header .col-date {
    text-align: right;
}


.terms-list {
    
}

.term-row {
    display: grid;
    grid-template-columns: 1fr 80px 96px;
    gap: 16px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.term-row:nth-child(odd) { background: #fff; }
.term-row:nth-child(even) { background: #fafafa; }
.term-row:hover { background: #fff3e0; text-decoration: none; }

.term-row .term-name {
    font-size: 14px;
    font-weight: 500;
    color: #e65100;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.term-row .term-views {
    text-align: right;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.term-row .term-date {
    text-align: right;
    font-size: 12px;
    color: #666;
}


.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #ccc;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    background: #e65100;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.pagination-btn:hover { background: #bf360c; }
.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 4px;
}

.page-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    cursor: pointer;
}
.page-num:hover { background: #fff3e0; }
.page-num.active {
    background: #e65100;
    color: #fff;
    border-color: #e65100;
}

.pagination-info {
    margin-left: 16px;
    font-size: 12px;
    color: #666;
}


.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-box {
    background: #fff;
    border: 1px solid #ccc;
}

.sidebar-box .box-header {
    background: #e65100;
    padding: 8px 12px;
}

.sidebar-box .box-header h3 {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}


.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}
.stat-row:last-child { border-bottom: none; }

.stat-row .stat-label {
    font-size: 13px;
    color: #666;
}

.stat-row .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #e65100;
}


.sidebar-link {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: #e65100;
    border-bottom: 1px solid #eee;
    text-decoration: none;
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { background: #fff3e0; text-decoration: none; }


.info-box {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    padding: 12px;
}

.info-box h4 {
    font-size: 13px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 8px;
}

.info-box p {
    font-size: 12px;
    color: #333;
    line-height: 1.7;
}


.footer {
    background: #333;
    color: rgba(255,255,255,0.7);
    margin-top: 32px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    font-size: 12px;
}

.footer-grid h4 {
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
}

.footer-grid li { margin-bottom: 4px; }

.footer-grid a {
    color: rgba(255,255,255,0.7);
}
.footer-grid a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 24px;
    padding-top: 16px;
    text-align: center;
    font-size: 12px;
}


.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    margin-bottom: 16px;
}

.breadcrumb a { color: #e65100; }

.article-box {
    background: #fff;
    border: 1px solid #ccc;
}

.article-box .article-header {
    background: #e65100;
    padding: 12px 16px;
}

.article-box .article-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: #fff3e0;
    border-bottom: 1px solid #ffcc80;
    font-size: 12px;
    color: #666;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-body {
    padding: 24px;
}

.article-body h2 {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e65100;
}

.article-body .article-text {
    font-size: 14px;
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
}

.related-box {
    background: #fff;
    border: 1px solid #ccc;
    margin-top: 16px;
}

.related-box .box-header {
    background: #e65100;
    padding: 8px 16px;
}

.related-box .box-header h3 {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.related-box .box-body {
    padding: 12px;
}

.related-box .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    background: #fff;
    border: 1px solid #ccc;
    color: #e65100;
    border-radius: 4px;
    text-decoration: none;
}
.related-box .back-btn:hover { background: #fff3e0; text-decoration: none; }


.error-box {
    background: #fff;
    border: 1px solid #ccc;
}

.error-box .box-header {
    background: #d32f2f;
    padding: 8px 16px;
}

.error-box .box-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.error-box .box-body {
    padding: 32px;
    text-align: center;
}

.error-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-box p {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.error-box .home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #e65100;
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
    text-decoration: none;
}
.error-box .home-btn:hover { background: #bf360c; text-decoration: none; }


.loading {
    text-align: center;
    padding: 48px;
    color: #666;
    font-size: 14px;
}

.no-results {
    text-align: center;
    padding: 32px;
    color: #666;
    font-size: 14px;
}

.error-message {
    padding: 32px 16px;
    text-align: center;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}


@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 12px;
    }

    .sidebar {
        width: 100%;
        order: -1;
    }

    .header-search input { width: 160px; }

    .header-nav { flex-wrap: wrap; }

    .header-main { flex-direction: column; gap: 12px; }

    .terms-table-header,
    .term-row {
        grid-template-columns: 1fr 60px;
    }

    .terms-table-header .col-date,
    .term-row .term-date {
        display: none;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 8px;
    }

    .article-meta { flex-wrap: wrap; }
}
