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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: #fff;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 1em;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

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

.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1em;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.captcha-area {
    position: relative;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    margin-bottom: 12px;
}

#captcha-canvas {
    border-radius: 6px;
    cursor: crosshair;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.hint-bar {
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.hint-text {
    font-size: 1.1em;
    font-weight: 600;
    color: #92400e;
    letter-spacing: 1px;
}

.click-info {
    text-align: center;
    margin-bottom: 12px;
    color: #6b7280;
    font-size: 0.95em;
}

.click-info strong {
    color: #3b82f6;
    font-size: 1.1em;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { background: #3b82f6; color: #fff; }
.btn-success { background: #22c55e; color: #fff; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-block { width: 100%; justify-content: center; margin-top: 10px; }
.btn-small { padding: 6px 12px; font-size: 0.85em; }
.btn-icon { font-size: 1.1em; }

.result-banner {
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.05em;
    text-align: center;
    margin-bottom: 14px;
}

.result-success { background: #dcfce7; color: #166534; border: 1px solid #22c55e; }
.result-fail { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.detail-table th, .detail-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.detail-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.detail-table tr.correct { background: #f0fdf4; }
.detail-table tr.wrong { background: #fef2f2; }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    gap: 10px;
    color: #6b7280;
    z-index: 10;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hidden { display: none !important; }

.api-section { display: flex; flex-direction: column; gap: 12px; }

.api-desc { color: #6b7280; font-size: 0.9em; margin-bottom: 6px; }

.api-endpoint {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.api-endpoint code {
    display: inline-block;
    background: #1e293b;
    color: #22d3ee;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.9em;
    margin: 0 6px;
}

.api-method {
    display: inline-block;
    background: #22c55e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
}

.api-method-post { background: #f97316; }

.api-endpoint p { color: #64748b; font-size: 0.85em; margin-top: 6px; }
.api-endpoint p code { background: #e2e8f0; color: #475569; padding: 1px 5px; margin: 0; font-size: 0.85em; }

.section-desc { color: #6b7280; font-size: 0.9em; margin-bottom: 12px; }

.generate-form { display: flex; flex-direction: column; gap: 10px; }

.generate-form label { font-weight: 500; color: #374151; }

.generate-form input[type="number"] {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
}

.generate-form input:focus { outline: none; border-color: #3b82f6; }

.gen-progress { margin-top: 12px; }

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    width: 0;
    transition: width 0.5s ease;
}

.gen-progress p { margin-top: 8px; color: #6b7280; font-size: 0.9em; text-align: center; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.stat-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.stat-item.stat-success { background: #f0fdf4; border-color: #bbf7d0; }
.stat-item.stat-fail { background: #fef2f2; border-color: #fecaca; }

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #1e293b;
}

.stat-success .stat-value { color: #16a34a; }
.stat-fail .stat-value { color: #dc2626; }

.stat-label { font-size: 0.8em; color: #64748b; margin-top: 2px; }

.footer {
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.85em;
    margin-top: 30px;
    padding: 20px;
}
