@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --bg-gradient-1: #0f172a;
    --bg-gradient-2: #312e81;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --h1-color: #f43f5e;
    --h2-color: #38bdf8;
    --h3-color: #34d399;
    --h4-color: #fbbf24;
    --h5-color: #e879f9;
    --h6-color: #93c5fd;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), #1e1b4b);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
}

.box {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    background: -webkit-linear-gradient(45deg, #a78bfa, #38bdf8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    height: 450px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-main);
    padding: 20px;
    font-size: 0.95rem;
    font-family: monospace;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

textarea:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.options-group {
    margin-top: 20px;
    padding: 0 5px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
    user-select: none;
    transition: color 0.2s;
}

.checkbox-option:hover {
    color: var(--accent-hover);
}

.checkbox-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-option:hover input~.checkmark {
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.4);
}

.checkbox-option input:checked~.checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-option input:checked~.checkmark:after {
    display: block;
}

.checkbox-option .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

button {
    margin-top: 25px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

button:active {
    transform: translateY(0);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.results-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.total-count {
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 10px;
    color: #e2e8f0;
}

.total-count span {
    color: #fff;
    font-size: 1.3rem;
    margin-left: 5px;
    background: -webkit-linear-gradient(45deg, #10b981, #34d399);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 12px;
}

.result-list::-webkit-scrollbar {
    width: 8px;
}

.result-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.result-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.result-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 24px;
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.card:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px) scale(1.01);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.tag-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-h1 {
    background: rgba(244, 63, 94, 0.15);
    color: var(--h1-color);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.tag-h2 {
    background: rgba(56, 189, 248, 0.15);
    color: var(--h2-color);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.tag-h3 {
    background: rgba(52, 211, 153, 0.15);
    color: var(--h3-color);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.tag-h4 {
    background: rgba(251, 191, 36, 0.15);
    color: var(--h4-color);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.tag-h5 {
    background: rgba(232, 121, 249, 0.15);
    color: var(--h5-color);
    border: 1px solid rgba(232, 121, 249, 0.3);
}

.tag-h6 {
    background: rgba(147, 197, 253, 0.15);
    color: var(--h6-color);
    border: 1px solid rgba(147, 197, 253, 0.3);
}

.tag-intro {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    flex: 1;
    line-height: 1.4;
    word-break: break-all;
    margin-top: -2px;
}

.card-counts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.count-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.count-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.count-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.site-footer {
    width: 100%;
    text-align: center;
    padding: 20px 0 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.site-footer a {
    color: var(--h2-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}