* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #64b5f6;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 300;
}

.subtitle {
    color: #90a4ae;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.format-selector {
    background: rgba(100, 181, 246, 0.1);
    border: 1px solid rgba(100, 181, 246, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.format-selector h3 {
    color: #64b5f6;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.format-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(100, 181, 246, 0.3);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.format-option:hover {
    border-color: #64b5f6;
    background: rgba(100, 181, 246, 0.1);
    transform: translateY(-2px);
}

.format-option.selected {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.format-option.recommended {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.05);
    position: relative;
}

.format-option.recommended::before {
    content: "推荐";
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    z-index: 1;
}

.format-option.recommended .format-name {
    color: #4caf50;
    font-weight: 700;
}

.format-option.recommended:hover {
    border-color: #45a049;
    background: rgba(76, 175, 80, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.2);
}

.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.format-name {
    font-weight: 600;
    color: #64b5f6;
    margin-bottom: 5px;
}

.format-description {
    color: #90a4ae;
    font-size: 0.9rem;
    line-height: 1.4;
}

.format-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 8px;
    margin-top: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #a0a0a0;
    text-align: left;
    max-height: 60px;
    overflow: hidden;
}

.upload-area {
    border: 2px dashed #64b5f6;
    border-radius: 15px;
    padding: 40px 20px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(100, 181, 246, 0.05);
}

.upload-area:hover {
    border-color: #42a5f5;
    background: rgba(100, 181, 246, 0.1);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #42a5f5;
    background: rgba(100, 181, 246, 0.15);
}

.upload-icon {
    font-size: 3rem;
    color: #64b5f6;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.upload-hint {
    color: #90a4ae;
    font-size: 0.9rem;
}

#fileInput {
    display: none;
}

.file-info {
    background: rgba(100, 181, 246, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #64b5f6;
    display: none;
}

.file-name {
    font-weight: 600;
    color: #64b5f6;
}

.file-size {
    color: #90a4ae;
    font-size: 0.9rem;
}

.convert-btn {
    background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(100, 181, 246, 0.3);
    margin-bottom: 20px;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(100, 181, 246, 0.4);
}

.convert-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 8px;
    margin: 20px 0;
    overflow: hidden;
    display: none;
}

.progress-bar {
    background: linear-gradient(90deg, #64b5f6, #42a5f5);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.result {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid #4caf50;
    display: none;
}

.result h3 {
    color: #4caf50;
    margin-bottom: 10px;
}

.download-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    margin-top: 15px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.error {
    background: rgba(244, 67, 54, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #f44336;
    color: #ffcdd2;
    display: none;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: #64b5f6;
}

.stat-label {
    color: #90a4ae;
    font-size: 0.9rem;
}

.format-info {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #ffc107;
    color: #fff3cd;
    font-size: 0.9rem;
    text-align: left;
    display: none;
}

.format-info h4 {
    color: #ffc107;
    margin-bottom: 8px;
}

.validation-info {
    background: rgba(100, 181, 246, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid #64b5f6;
}

.validation-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sample-items {
    margin-bottom: 15px;
}

.sample-items h4 {
    color: #64b5f6;
    margin-bottom: 8px;
    font-size: 1rem;
}

.item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.item-tag {
    background: rgba(100, 181, 246, 0.2);
    color: #64b5f6;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #ffc107;
    font-size: 0.9rem;
}

.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #4caf50;
    font-size: 0.9rem;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.view-diff-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.view-diff-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
}


/* Syntax highlighting for diff viewer */
.comment {
    color: #6a9955;
    font-style: italic;
    opacity: 0.8;
}

.keyword {
    color: #c586c0;
    font-weight: 600;
}

.variable {
    color: #4fc1ff;
    font-weight: 500;
}

.string {
    color: #ce9178;
    background: rgba(206, 145, 120, 0.1);
    padding: 1px 3px;
    border-radius: 3px;
}

.number {
    color: #b5cea8;
    font-weight: 500;
}

.bracket {
    color: #ffd700;
    font-weight: 600;
}

.brace {
    color: #ffd700;
    font-weight: 600;
}

.operator {
    color: #d4d4d4;
    font-weight: 500;
}

.code-line {
    display: flex;
    align-items: flex-start;
    margin: 2px 0;
    padding: 2px 0;
    opacity: 1;
    transform: none;
}

.line-number {
    color: #666;
    margin-right: 15px;
    user-select: none;
    font-size: 0.8rem;
    min-width: 35px;
    text-align: right;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .format-options {
        grid-template-columns: 1fr;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .validation-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .item-list {
        justify-content: center;
    }
    
    .diff-content {
        grid-template-columns: 1fr;
        max-height: 400px;
    }
    
    .diff-side {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .diff-side:last-child {
        border-bottom: none;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.nav-tab {
    background: transparent;
    border: none;
    color: #888;
    padding: 12px 24px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Item Builder Styles */
.builder-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.builder-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group select option {
    background: #2a2a2a;
    color: #fff;
    padding: 8px;
}

.form-group select option[value="minimal"] {
    background: #2d5a2d;
    color: #4ade80;
    font-weight: 600;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Format selection highlight effect */
.format-option input[type="radio"]:checked + .format-name {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.format-option input[type="radio"]:checked ~ .format-description {
    color: #e0e0e0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

.format-option input[type="radio"]:checked ~ .format-preview {
    color: #f0f0f0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Clipboard section styles */
.clipboard-section {
    margin: 30px 0;
    padding: 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.clipboard-header {
    text-align: center;
    margin-bottom: 20px;
}

.clipboard-header h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.clipboard-header p {
    color: #bbb;
    margin: 0;
    font-size: 14px;
}

#clipboardInput {
    width: 100%;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

#clipboardInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

#clipboardInput::placeholder {
    color: #888;
    font-style: italic;
}

#convertClipboard {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

#convertClipboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#convertClipboard:active {
    transform: translateY(0);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.field-help {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
    line-height: 1.3;
}

.result-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 15px;
}

.result-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
}

.copy-btn {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #5cbf60 0%, #4caf50 100%);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.copy-btn.copied::after {
    content: " ✓";
    font-weight: bold;
}

/* Image Resizer Styles */
.resizer-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.resizer-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.resizer-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.resizer-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.resizer-content {
    color: #fff;
}

.resizer-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.resizer-hint {
    color: #888;
    font-size: 14px;
    margin-top: 10px;
}

.resizer-results {
    margin-top: 30px;
}

.resizer-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.resizer-image-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

.resizer-image-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.resizer-image-item p {
    color: #fff;
    font-size: 12px;
    margin: 5px 0;
}

.resizer-image-item .download-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}

/* Additional responsive styles for new features */
@media (max-width: 768px) {
    .nav-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-tab {
        border-radius: 8px;
    }
    
    .builder-form {
        grid-template-columns: 1fr;
    }
    
    .resizer-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
