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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 720px;
    padding: 32px 36px;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}
.nav-link {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}
.nav-link:hover { color: #333; }
.nav-link.active {
    color: #e8684a;
    border-bottom-color: #e8684a;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.form-group { flex: 1; display: flex; flex-direction: column; }
.form-group.full { flex: 1 1 100%; }

label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}
label .optional { color: #999; font-weight: 400; }
label .required { color: #e8684a; }

.hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

select, input[type="text"], input[type="number"] {
    height: 40px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
}

select:focus, input:focus, textarea:focus {
    border-color: #e8684a;
    box-shadow: 0 0 0 2px rgba(232, 104, 74, 0.1);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea {
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
    resize: vertical;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    line-height: 1.6;
}

.token-textarea {
    min-height: 160px;
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    word-wrap: normal;
    word-break: normal;
}
.rate-textarea { min-height: 100px; }

.btn-submit {
    display: block;
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #e8684a, #d4553a);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}
.btn-submit:hover {
    background: linear-gradient(135deg, #d4553a, #c04a30);
    box-shadow: 0 4px 12px rgba(232, 104, 74, 0.3);
}
.btn-submit:active { transform: scale(0.99); }
.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #333; }

.result-stats { display: flex; gap: 16px; margin-bottom: 16px; }
.stat-item {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background: #f9f9f9;
}
.stat-item .num { font-size: 28px; font-weight: 700; }
.stat-item .label { font-size: 12px; color: #999; margin-top: 4px; }
.stat-item.total .num { color: #333; }
.stat-item.success .num { color: #52c41a; }
.stat-item.skipped .num { color: #faad14; }
.stat-item.failed .num { color: #ff4d4f; }

.error-list {
    max-height: 200px;
    overflow-y: auto;
    background: #fff7f0;
    border: 1px solid #ffe0cc;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}
.error-list p {
    font-size: 12px;
    color: #e8684a;
    margin-bottom: 6px;
    word-break: break-all;
}

.modal-close {
    display: block;
    width: 100%;
    height: 40px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.modal-close:hover { background: #eee; }

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
