* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --border: #30363d;
    --text: #e6edf3;
    --text-dim: #8b949e;
    --green: #3fb950;
    --yellow: #d29922;
    --red: #f85149;
    --blue: #58a6ff;
    --purple: #bc8cff;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.scan-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.scan-btn:hover { opacity: 0.9; }
.scan-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--purple));
    width: 0%;
    transition: width 0.3s;
    border-radius: 2px;
}

.progress-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: center;
}

.score-section {
    text-align: center;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: border-color 0.5s;
}

.score-circle span {
    font-size: 2.5rem;
    font-weight: 700;
}

.score-label {
    font-size: 1.3rem;
    font-weight: 600;
}

.score-desc {
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.score-red { border-color: var(--red); }
.score-red span { color: var(--red); }
.score-yellow { border-color: var(--yellow); }
.score-yellow span { color: var(--yellow); }
.score-green { border-color: var(--green); }
.score-green span { color: var(--green); }

.section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    gap: 0.75rem;
}

.section-header:hover { background: var(--bg-secondary); }

.section-header h2 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.section-icon {
    font-size: 0.75rem;
}

.icon-green { color: var(--green); }
.icon-yellow { color: var(--yellow); }
.icon-red { color: var(--red); }

.chevron {
    color: var(--text-dim);
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.section.open .chevron { transform: rotate(180deg); }

.section-body {
    display: none;
    padding: 0 1.25rem 1.25rem;
}

.section.open .section-body { display: block; }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.info-item {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.95rem;
    word-break: break-all;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-green { background: rgba(63,185,80,0.15); color: var(--green); }
.tag-yellow { background: rgba(210,153,34,0.15); color: var(--yellow); }
.tag-red { background: rgba(248,81,73,0.15); color: var(--red); }

.issue-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--border);
}

.issue-item.severity-critical, .issue-item.severity-high { border-left-color: var(--red); }
.issue-item.severity-medium { border-left-color: var(--yellow); }
.issue-item.severity-low { border-left-color: var(--blue); }

.issue-type {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.issue-detail {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.rec-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.rec-icon { font-size: 1.2rem; flex-shrink: 0; }

.headers-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.headers-table th, .headers-table td {
    padding: 0.4rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.headers-table th {
    color: var(--text-dim);
    font-weight: 600;
    width: 35%;
}

.headers-table td {
    word-break: break-all;
    font-family: monospace;
    font-size: 0.8rem;
}

.export-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.export-btn:hover { background: var(--bg-secondary); }

.hidden { display: none !important; }

footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.noscript-notice {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    margin: 1rem 0;
}

.noscript-notice a { color: var(--blue); }
.noscript-notice ul { margin-top: 1rem; padding-left: 1.5rem; }
.noscript-notice li { margin: 0.5rem 0; }

@media (max-width: 600px) {
    .info-grid { grid-template-columns: 1fr; }
    .container { padding: 1rem 0.75rem; }
}
