* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f7f7f8;
    color: #1a1a1a;
}

.wrap {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    border: 1px solid #e2e2e6;
    border-radius: 12px;
    padding: 28px;
}

h1 {
    font-size: 22px;
    margin: 0 0 20px;
}

label {
    display: block;
    font-size: 13px;
    color: #555;
    margin: 14px 0 6px;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5d5db;
    border-radius: 8px;
    font-size: 15px;
}

textarea {
    min-height: 140px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    resize: vertical;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 15px;
    font-weight: 600;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-secondary {
    background: #eceef2;
    color: #333;
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.message {
    margin-top: 14px;
    font-size: 14px;
}

.message.error {
    color: #d92d20;
}

.message.success {
    color: #12b76a;
}

.problem-box {
    background: #f2f4f7;
    border-radius: 8px;
    padding: 16px;
    font-size: 16px;
    margin-bottom: 10px;
}

.meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
}

.log-line {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px dashed #e5e5e5;
}

.log-time {
    color: #888;
    margin-right: 8px;
}

.log-type {
    font-weight: 700;
}

.log-content {
    display: block;
    margin-top: 2px;
    color: #333;
    white-space: pre-wrap;
}

a {
    color: #2563eb;
}

.stuck-line {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: #fff4ed;
    border: 1px solid #ffd9b8;
    cursor: pointer;
}

.stuck-badge {
    display: inline-block;
    background: #e8590c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.stuck-detail {
    margin-top: 8px;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #eee;
}

.episode-card {
    border: 1px solid #ffd9b8;
    background: #fff8f2;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}

.episode-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.rule-badge {
    display: inline-block;
    background: #eceef2;
    color: #333;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.judgment-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.judgment-confirmed { background: #fee2e2; color: #b91c1c; }
.judgment-dismissed { background: #dcfce7; color: #15803d; }
.judgment-uncertain { background: #fef3c7; color: #92400e; }

.validation-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ffd9b8;
}

.stats-box {
    background: #f2f4f7;
    border-radius: 8px;
    padding: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.stats-tile {
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    border: 1px solid #e2e2e6;
}

.stats-tile .num {
    font-size: 20px;
    font-weight: 700;
}

.stats-tile .label {
    font-size: 11px;
    color: #888;
}
