* {
    box-sizing: border-box;
}

.clipsub-container {
    max-width: 860px;
    margin: 40px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
}

.clipsub-header {
    padding-bottom: 28px;
    border-bottom: 1px solid #eaeef3;
    margin-bottom: 32px;
}

.clipsub-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
    color: #1a3a6b;
}

.clipsub-header p {
    font-size: 16px;
    color: #6b7a8f;
    margin: 0 0 16px 0;
}

.clipsub-balance-info {
    display: flex;
    gap: 32px;
    padding: 12px 0 0 0;
    font-size: 14px;
    color: #3d4a5c;
    border-top: 1px solid #e8edf5;
}

.clipsub-balance-info strong {
    color: #2563eb;
    font-weight: 600;
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #1a3a6b;
}

.upload-area {
    position: relative;
    padding: 48px 24px;
    border: 2px dashed #c7d8f0;
    border-radius: 12px;
    text-align: center;
    background: #f5f9ff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #6b9cf5;
    background: #edf3fe;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-area p {
    margin: 0;
    font-size: 15px;
    color: #4a5a6e;
}

.upload-area .file-info {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7a8f;
}

.upload-area small {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: #8a9aa8;
}

.mode-group {
    margin-bottom: 28px;
}

.mode-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: #1a3a6b;
}

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mode-card {
    padding: 20px 24px;
    background: #f5f9ff;
    border: 2px solid #d6e4f5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.mode-card:hover {
    border-color: #8bb3f0;
    background: #edf3fe;
}

.mode-card-inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a3a6b;
}

.mode-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #3d5a8f;
}

.mode-desc {
    font-size: 13px;
    color: #6b8ab0;
    margin-top: 2px;
}

.mode-price {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin-top: 6px;
}

.mode-card.active {
    border-color: #2563eb;
    background: #2563eb;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.30);
    transform: scale(1.02);
}

.mode-card.active .mode-title,
.mode-card.active .mode-subtitle,
.mode-card.active .mode-desc,
.mode-card.active .mode-price {
    color: #ffffff;
}

@media (max-width: 768px) {
    .mode-selector {
        grid-template-columns: 1fr;
    }
}

.clipsub-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
}

.clipsub-submit-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35);
}

.clipsub-submit-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.subtitle-settings {
    background: #f5f9ff;
    padding: 20px 24px 24px 24px;
    border-radius: 12px;
    border: 1px solid #dce8f5;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.setting-item {
    display: flex;
    flex-direction: column;
}

.setting-item label {
    font-size: 13px;
    font-weight: 500;
    color: #1a3a6b;
    margin-bottom: 4px;
}

.setting-item select,
.setting-item input[type="color"] {
    padding: 8px 10px;
    border: 1px solid #c7d8f0;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    color: #1a3a6b;
    transition: border 0.2s ease;
}

.setting-item select:focus,
.setting-item input[type="color"]:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.setting-item input[type="color"] {
    height: 40px;
    padding: 3px;
    cursor: pointer;
}

#clipsub-status {
    margin: 24px 0;
    padding: 20px 24px;
    background: #f5f9ff;
    border-radius: 10px;
    border: 1px solid #dce8f5;
}

.status-message {
    font-size: 14px;
    color: #1a3a6b;
    margin-bottom: 8px;
}

.progress-bar {
    height: 4px;
    background: #dce8f5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 0.3s ease;
}

#clipsub-result {
    margin-top: 32px;
    padding: 24px;
    background: #f5f9ff;
    border-radius: 12px;
    border: 1px solid #dce8f5;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1a3a6b;
}

.result-mode {
    font-size: 13px;
    color: #ffffff;
    background: #2563eb;
    padding: 4px 14px;
    border-radius: 20px;
}

.transcript-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1a3a6b;
    margin-bottom: 6px;
}

#transcript-text {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #c7d8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    min-height: 140px;
    color: #1a3a6b;
    background: #ffffff;
    transition: border 0.2s ease;
}

#transcript-text:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.download-section {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.download-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.srt-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.20);
}

.srt-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.30);
}

.video-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.20);
}

.video-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.30);
}

#clipsub-error {
    margin-top: 20px;
    padding: 14px 20px;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.error-message {
    color: #dc2626;
    font-size: 14px;
}

@media (max-width: 768px) {
    .clipsub-container {
        padding: 24px;
        margin: 20px 12px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .clipsub-balance-info {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .download-section {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
        text-align: center;
    }
}