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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 300;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

.main-content {
    padding: 20px;
}

.input-section {
    margin-bottom: 20px;
}

.input-container {
    position: relative;
    margin-bottom: 15px;
}

#bcbpInput {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
}

#bcbpInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.upload-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

#imageUpload {
    display: none;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.action-btn:active {
    transform: translateY(-1px);
}

.action-btn.parse {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.action-btn.generate {
    background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
}

.clear-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3);
}

.clear-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #5a6268 0%, #3d4142 100%);
}

.clear-btn:active {
    transform: translateY(-1px);
}



.form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* 桌面端优化 */
@media (min-width: 992px) {
    .form-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .form-group {
        margin-bottom: 0;
    }
}

@media (min-width: 1200px) {
    .form-section {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

/* 大屏幕优化 */
@media (min-width: 1600px) {
    .form-section {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
    }
}

/* 可折叠区域样式 */
.section-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid #e1e8ed;
    padding-bottom: 8px;
}

.collapsible-section {
    margin-bottom: 20px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.section-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.section-header .section-title {
    margin: 0;
    border: none;
    padding: 0;
    font-size: 1.1rem;
}

.toggle-icon {
    font-size: 1.2rem;
    color: #667eea;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.section-header.expanded .toggle-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.collapsible-content.expanded {
    max-height: 2000px;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.collapsible-form-section {
    padding: 20px;
    background: #ffffff;
}

.form-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    min-height: 80px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.form-group label span {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    flex: 1;
    min-height: 38px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-group .help-text {
    font-size: 10px;
    color: #6c757d;
    font-style: italic;
    margin: 0;
    line-height: 1.2;
    opacity: 0.8;
    max-width: 70%;
    text-align: right;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 6px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    text-transform: none;
    cursor: pointer;
    font-size: 12px;
}

.radio-group input[type="radio"] {
    margin-right: 6px;
    width: auto;
}

.url-section {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
}

.url-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.url-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #11998e;
}

.toast.error {
    background: #e74c3c;
}

@media (max-width: 768px) {
    body {
        padding: 0px;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    header p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .main-content {
        padding: 15px;
    }

    .action-buttons {
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .action-btn {
        width: 180px;
        justify-content: center;
        padding: 10px 20px;
        font-size: 14px;
    }

    .clear-btn {
        width: 180px;
        justify-content: center;
        padding: 10px 20px;
        font-size: 14px;
    }



    .upload-btn {
        position: static;
        margin-top: 8px;
        width: 100%;
        font-size: 12px;
    }

    .form-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .form-group {
        padding: 10px;
        margin-bottom: 0;
        min-height: auto;
    }

    .collapsible-form-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .form-group label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .form-group .help-text {
        font-size: 9px;
        max-width: 60%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .form-group input,
    .form-group select {
        padding: 8px;
        font-size: 14px;
        margin-bottom: 2px;
    }

    #bcbpInput {
        min-height: 80px;
        font-size: 13px;
        padding: 10px;
    }

    .url-section {
        padding: 15px;
        margin-top: 5px;
    }

    .url-btn {
        padding: 10px 20px;
        font-size: 14px;
        margin: 5px;
    }
}

