:root {
    color-scheme: light dark;
    --bg: #f7f7f5;
    --card-bg: #ffffff;
    --text: #1b1b1b;
    --muted: #6b6b6b;
    --border: #e4e2dd;
    --accent: #b5452f;
    --accent-bg: #fbeee9;
    --positive: #2e7d4f;
    --positive-bg: #e7f4ec;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

header.site {
    padding: 32px 16px 16px;
    text-align: center;
}

header.site h1 {
    margin: 0 0 4px;
    font-size: 1.75rem;
}

header.site p {
    margin: 0;
    color: var(--muted);
}

header.site .stats-line {
    margin-top: 8px;
    font-size: 0.85rem;
}

header.site p a {
    color: inherit;
    text-decoration: underline;
}

header.site p a:hover {
    color: var(--accent);
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

.video-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
}

.video-row:hover {
    border-color: var(--accent);
}

.video-row-title-match {
    border: 2px solid var(--positive);
}

.video-row-manual {
    border: 2px solid var(--accent);
}

.video-row img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.video-row-title {
    flex: 1;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    font-size: 0.85rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    color: var(--muted);
}

.filter-link {
    color: var(--muted);
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.filter-link:hover {
    border-color: var(--accent);
}

.filter-link-active {
    color: var(--text);
    border-color: var(--text);
    font-weight: 600;
}

.filter-toggle {
    color: var(--muted);
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.filter-toggle:hover {
    border-color: var(--accent);
}

.filter-toggle-on {
    color: var(--positive);
    border-color: var(--positive);
    font-weight: 600;
}

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.pagination a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.pagination a:hover {
    text-decoration: underline;
}

.video-detail-title {
    font-size: 1.3rem;
    margin: 24px 0 4px;
}

.last-checked {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 20px;
}

.video-group {
    margin-top: 32px;
}

.video-group h2 {
    font-size: 1.1rem;
    margin: 0 0 12px;
}

.video-group h2 a {
    color: var(--text);
    text-decoration: none;
}

.video-group h2 a:hover {
    text-decoration: underline;
}

.video-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-link img {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.comment-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.comment-meta img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.comment-meta a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.comment-meta a:hover {
    text-decoration: underline;
}

.comment-text {
    margin: 0 0 8px;
    word-wrap: break-word;
}

.comment-text a {
    color: var(--accent);
}

.comment-footer {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--muted);
}

.comment-footer a {
    color: var(--accent);
    text-decoration: none;
}

.comment-footer a:hover {
    text-decoration: underline;
}

.tag {
    display: inline-block;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.75rem;
}

.count-badge {
    display: inline-block;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

.count-badge-has-matches {
    background: var(--positive-bg);
    color: var(--positive);
}

.empty-state {
    text-align: center;
    color: var(--muted);
    margin-top: 64px;
}

footer.site {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 48px;
}

footer.site a {
    color: var(--muted);
}

footer.site .credit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.credit-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16161a;
        --card-bg: #1f1f24;
        --text: #ececec;
        --muted: #9a9a9a;
        --border: #2d2d33;
        --accent: #e8a08c;
        --accent-bg: #2a1f1d;
        --positive: #7bc99a;
        --positive-bg: #1c2e22;
    }
}
