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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    min-height: 100vh;
    color: #333;
}

/* Header */
#header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Main */
#main {
    min-height: calc(100vh - 200px);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 0;
    background: rgba(255, 255, 255, 0.95);
    margin-bottom: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

/* Steps Section */
.steps-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.steps-section h2 {
    text-align: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 5px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.step-number {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.step-description {
    color: #666;
    font-size: 14px;
}

/* Info Box */
.info {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #007bff;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    margin-bottom: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
    border-style: dashed !important;
    border-width: 2px !important;
    position: relative;
}

.upload-area:hover {
    border-color: #0056b3;
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    border-style: dashed !important;
    border-width: 2px !important;
}

.upload-area.dragover {
    border-color: #28a745;
    background: #f0fff4;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
    border-style: dashed !important;
    border-width: 2px !important;
}

.upload-area p {
    color: #718096;
    font-weight: 500;
    font-size: 16px;
}

#fileInput {
    display: none;
}

/* Data Preview */
.data-preview {
    margin-bottom: 30px;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#dataTable th,
#dataTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

#dataTable th {
    background: #007bff;
    color: white;
    font-weight: 600;
}

/* 通用表格样式 - 确保所有表格内容左对齐 */
table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table th,
table td {
    text-align: left !important;
    padding: 8px 12px;
    vertical-align: top;
}

/* 表格表头样式 - 采用统一蓝色背景，白色文字 */
table th,
.table th {
    background: #007bff !important;
    color: white !important;
    font-weight: 600 !important;
    text-align: left !important;
}

/* 确保Bootstrap表格也左对齐并添加圆角 */
.table {
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

.table td {
    text-align: left !important;
}

/* 确保表格容器也支持圆角 */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

#dataTable tr:hover {
    background: rgba(0, 123, 255, 0.05);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.action-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.action-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.action-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Formula Input */
.formula-section {
    background: #f7fafc;
    border: 2px solid #000000;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Deepen border color for all steps */
.formula-section:hover {
    border-color: #a0aec0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Comparison Section Styling */
.comparison-section {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #63b3ed;
    box-shadow: 0 4px 15px rgba(99, 179, 237, 0.15);
}

.comparison-section h3 {
    color: #2b6cb0;
    font-size: 1.25rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}



.comparison-section p {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

/* Comparison Result Styling */
#comparisonResult {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

/* Card Styling Enhancements */
.comparison-section .card {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.comparison-section .card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comparison-section .card-header {
    font-weight: 600;
    font-size: 16px;
}

.comparison-section .card-body {
    padding: 20px;
}

/* Alert Styling Enhancements */
.comparison-section .alert {
    border-radius: 6px;
    margin-bottom: 15px;
    padding: 15px;
    font-size: 14px;
}

.comparison-section .alert h6 {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
}

.comparison-section .alert p {
    margin-bottom: 10px;
    font-size: 14px;
    color: inherit;
}

.comparison-section .alert ul {
    margin-bottom: 0;
    padding-left: 20px;
    font-size: 14px;
}

.comparison-section .alert li {
    margin-bottom: 5px;
}

/* List Group Styling Enhancements */
.comparison-section .list-group {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comparison-section .list-group-item {
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.comparison-section .list-group-item:hover {
    background-color: #f7fafc;
}

/* Row Styling */
.comparison-section .row {
    margin-left: -10px;
    margin-right: -10px;
}

.comparison-section .col-md-6 {
    padding-left: 10px;
    padding-right: 10px;
}

/* Color Coding Enhancements - Bootstrap 5 compatible colors */
.list-group-item-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    /* color: #059669; */
    font-weight: 500;
}

.list-group-item-warning {
    background-color: #fffbeb;
    border-color: #fef3c7;
    /* color: #f59e0b; */
    font-weight: 500;
}

.list-group-item-danger {
    background-color: #fee2e2;
    border-color: #fecaca;
    /* color: #dc2626; */
    font-weight: 500;
}

.list-group-item-secondary {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    /* color: #6b7280; */
}

.formula-section h3,
.formula-section h4 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* 确保.formula-section内的第一个h3元素顶部间距正常 */
.formula-section > h3:first-child,
.formula-section > h4:first-child {
    margin-top: 0;
}

#formulaInput {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#formulaInput:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Results Section */
.results-section {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.results-section h3 {
    margin-bottom: 15px;
    color: #22543d;
    font-size: 16px;
    font-weight: 600;
}

/* Output Options */
.output-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.output-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.output-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838 0%, #13854e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.output-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mode Selection Section */
.generation-mode-selector {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.generation-mode-selector .form-label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.generation-mode-selector .form-check {
    margin-bottom: 8px;
}

/* Filename Settings Section */
.filename-settings {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.filename-settings .form-label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.filename-settings .form-check {
    margin-bottom: 8px;
}

/* Delimiters Selector Section */
.delimiters-selector {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.delimiters-selector .form-label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.delimiters-selector .form-check {
    margin-right: 20px;
    margin-bottom: 8px;
}

.delimiters-selector .form-check-inline {
    display: inline-flex;
    align-items: center;
}

.delimiters-selector .form-check-label {
    margin-left: 5px;
}

/* Footer */
#footer {
    background: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    margin-top: 60px;
}

#footer a {
    margin: 0 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

/* Language Switch */
.language-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.language-switch button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.language-switch button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.language-switch button.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Logo Image */
#header img {
    border: 1px solid white;
    border-radius: 4px;
}

/* Hero Section */
.hero-section p {
    margin: 0 50px;
    text-align: center;
    line-height: 1.6;
    padding: 0 20px;
}

.hero-section .badge,
.badge {
    text-decoration: none;
}

/* Flow Steps Indicator */
.flow-steps-container {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-bottom: 30px;
    border-radius: 15px;
}

.flow-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.step-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.3s ease;
}

.step-label {
    margin-top: 5px;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    transition: all 0.3s ease;
}

.step-line {
    height: 3px;
    background: #e2e8f0;
    width: 100%;
    position: relative;
    top: -22px;
    z-index: -1;
    transition: all 0.3s ease;
}

/* Data Section */
.formula-section p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

#pasteDataInput {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
    width: 100%;
    box-sizing: border-box;
}

#pasteDataInput.valid {
    border-color: #28a745;
    background: #f0fff4;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

#pasteDataInput.invalid {
    border-color: #dc3545;
    background: #fff5f5;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.upload-area.has-template {
    border: 2px solid #28a745;
    background: #f0fff4;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* 上传成功后的hover效果，保持绿色边框 */
.upload-area.has-template:hover {
    border-color: #28a745 !important;
    background: #e6fff0 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

#pasteDataPreview {
    margin-top: 15px;
    margin-bottom: 20px;
    display: none;
}

#pasteDataPreview h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

#pasteDataPreview>div {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 200px;
}

/* 统一上传区域样式，移除特殊样式 */
#imageUploadArea input[type="file"],
#templateUploadArea input[type="file"] {
    display: none;
}





#templateInfo,
#imageInfo {
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 8px;
    display: none;
}

#templateInfo p,
#imageInfo p {
    margin: 0;
    color: white;
    font-size: 14px;
}

#templateInfo strong,
#imageInfo strong {
    font-weight: 600;
}

#templateFileName,
#imageFileNames {
    font-weight: 500;
}

/* Results Section */
#resultsSection {
    display: block;
}

/* Fixed Icons on Right Side */
.fixed-icons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.fixed-icon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #007bff;
    border-radius: 50%;
    color: #007bff;
    font-size: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.fixed-icon-item:hover {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.fixed-icon-item i {
    transition: all 0.3s ease;
}

.fixed-icon-item:hover i {
    transform: scale(1.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .output-options {
        flex-direction: column;
    }

    #dataTable {
        font-size: 12px;
    }

    #dataTable th,
    #dataTable td {
        padding: 8px;
    }
    
    .fixed-icons {
        right: 10px;
    }
    
    .fixed-icon-item {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* 版本徽章容器 */
.version-badge-container {
    position: relative;
    display: inline-block;
    margin-right: 10px;
}

/* 版本限制信息 */
.version-limit-info {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.2;
    white-space: pre-line;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    height: auto;
}

/* 鼠标悬停显示 */
.version-badge-container:hover .version-limit-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

/* 确保span元素垂直居中 */
.version-limit-info span {
    display: inline-block;
    vertical-align: middle;
}

