/* --- Base & Font --- */
body {
    font-family: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: #f6f8fa;
    color: #24292e;
}

/* --- Header & Footer --- */
.site-header {
    background-color: #24292e;
    color: #ffffff;
    padding: 20px 0 16px;
    font-weight: 500;
    border-bottom: 1px solid #30363d;
}

.header-inner {
    text-align: center;
}

.site-header .header-link {
    color: #ffffff;
    text-decoration: none;
}

.site-header .header-link:hover {
    opacity: 0.85;
}

.site-header h1 {
    font-size: 28px;
    margin: 0;
}

.site-subtitle {
    margin: 8px 0 14px;
    font-size: 14px;
    color: #c9d1d9;
}

.site-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.site-nav a {
    color: #ffffff;
    text-decoration: none;
    border: 1px solid #57606a;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
}

.site-nav a:hover {
    background-color: #30363d;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    font-size: 12px;
    color: #586069;
}

/* --- Main Container --- */
main {
    margin-top: 24px;
    margin-bottom: 24px;
}

.site-intro {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
}

.site-intro h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.site-intro p {
    margin: 0;
    color: #57606a;
    font-size: 14px;
}

/* --- Loading --- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 0;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #d0d7de;
    border-top-color: #0969da;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 12px;
    font-size: 14px;
    color: #586069;
}

/* --- Error & Empty Messages --- */
.error-message {
    background-color: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    color: #656d76;
}

.empty-message {
    text-align: center;
    padding: 32px 0;
    color: #656d76;
}

/* --- Issue Card (List View) --- */
.issue-card {
    display: block;
    background-color: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.issue-card:hover {
    border-color: #0969da;
    box-shadow: 0 0 0 1px #0969da;
}

.issue-card h2 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #0969da;
}

.issue-card .meta {
    font-size: 12px;
    color: #586069;
}

/* --- Tag Styling --- */
.meta .tags {
    margin-top: 8px;
}

.tag {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: #0969da;
    background-color: #ddf4ff;
    border: 1px solid transparent;
    border-radius: 2em;
}

/* --- Detail View --- */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 14px;
    color: #0969da;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-card {
    background-color: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 32px;
}

.issue-title {
    font-size: 28px;
    font-weight: 600;
    border-bottom: 1px solid #d0d7de;
    padding-bottom: 12px;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.issue-body {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.7;
}

.issue-body pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 14px;
    background-color: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    padding: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* --- Label Filter & Pagination --- */
.label-filter {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d0d7de;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.label-filter a {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: #0969da;
    background-color: #ddf4ff;
    border: 1px solid transparent;
    border-radius: 2em;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.label-filter a.active {
    color: #ffffff;
    background-color: #0969da;
    border-color: #0969da;
}

.label-filter a:hover {
    color: #ffffff;
    background-color: #0969da;
    border-color: #0969da;
}

.pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    color: #0969da;
    text-decoration: none;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.pagination a:hover {
    background-color: #f6f8fa;
    border-color: #d0d7de;
}

.pagination a.current {
    color: #ffffff;
    background-color: #0969da;
    border-color: #0969da;
}

.pagination a.disabled {
    color: #8c959f;
    background-color: transparent;
    border-color: #d0d7de;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination span {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    color: #8c959f;
}

/* --- Issue Card Preview --- */
.issue-preview {
    margin-top: 8px;
    font-size: 14px;
    color: #656d76;
    line-height: 1.4;
}

/* --- Markdown Styling --- */
.issue-body h1, .issue-body h2, .issue-body h3, .issue-body h4, .issue-body h5, .issue-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.issue-body h1 {
    font-size: 2em;
    border-bottom: 1px solid #d0d7de;
    padding-bottom: 8px;
}

.issue-body h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #d0d7de;
    padding-bottom: 8px;
}

.issue-body h3 {
    font-size: 1.25em;
}

.issue-body p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.issue-body ul, .issue-body ol {
    margin-bottom: 16px;
    padding-left: 32px;
}

.issue-body li {
    margin-bottom: 4px;
}

.issue-body .code-block {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 14px;
    background-color: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
}

.issue-body .code-block code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

.issue-body .inline-code {
    background-color: rgba(175, 184, 193, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
}

.issue-body .markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.issue-body hr {
    border: 0;
    height: 1px;
    background-color: #d0d7de;
    margin: 24px 0;
}

.issue-body a {
    color: #0969da;
    text-decoration: none;
}

.issue-body a:hover {
    text-decoration: underline;
}

.issue-body strong {
    font-weight: 600;
}

.issue-body em {
    font-style: italic;
}

.issue-body blockquote {
    margin: 16px 0;
    padding: 0 16px;
    border-left: 4px solid #d0d7de;
    color: #656d76;
}

/* --- Responsive --- */
@media (max-width: 544px) {
    .detail-card {
        padding: 16px;
    }

    .issue-title {
        font-size: 22px;
    }

    .pagination a {
        padding: 4px 8px;
        font-size: 12px;
    }
}
