:root {
    --primary-color: #FFC107; /* 香蕉黄 */
    --primary-hover: #FFD54F;
    --text-color: #333;
    --bg-color: #f4f4f9;
    --panel-bg: #fff;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #333;
    font-size: 2.5rem;
}

header h1 small {
    font-size: 1rem;
    color: #666;
    font-weight: normal;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: #e0e0e0;
    border-radius: var(--border-radius);
    padding: 5px;
}

.tab-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    border-radius: var(--border-radius);
    transition: background 0.3s;
}

.tab-btn.active {
    background: var(--panel-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Panels */
.panel {
    display: none;
    background: var(--panel-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease-in-out;
}

.panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-upload-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-preview {
    border: 2px dashed #ccc;
    padding: 30px;
    text-align: center;
    border-radius: var(--border-radius);
    color: #777;
    transition: border-color 0.3s;
}

.file-upload-wrapper:hover .file-upload-preview {
    border-color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: #333;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Result Area */
#result-area {
    margin-top: 30px;
    background: var(--panel-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.hidden {
    display: none !important;
}

.error-box {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #ef9a9a;
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading {
    text-align: center;
    padding: 20px;
}

/* Output Images */
.output-item {
    margin-bottom: 20px;
    text-align: center;
}

.output-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.output-item p {
    margin-top: 10px;
    color: #555;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Data Sync Modal (Obfuscated Styles) */
#data-sync-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

#data-sync-modal.active {
    opacity: 1;
    visibility: visible;
}

.x-modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 380px;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#data-sync-modal.active .x-modal-content {
    transform: scale(1);
}

.x-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 5px;
}

.x-close-btn:hover {
    color: #333;
}

.sync-visualizer {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Floating Trigger Button */
.x-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    cursor: pointer;
    z-index: 9990;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    text-decoration: none;
}

.x-float-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.x-float-btn i {
    animation: float-pulse 2s infinite;
}

@keyframes float-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@media (max-width: 600px) {
    .x-float-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}