:root {
    --primary-color: #1890ff;
    --secondary-color: #13c2c2;
    --bg: #f5f7fa;
    --panel: #ffffff;
    --muted: #8c8c8c;
    --radius: 12px;
    --shadow-light: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-heavy: 0 6px 20px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

/* ================== Header ================== */
.header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--panel);
    box-shadow: var(--shadow-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;           /* 图片和文字的间距 */
    font-size: 20px;
    font-weight: 600;
}

.logo img {
    height: 36px;        /* 控制 Logo 大小 */
    width: auto;
}

.nav-links a {
    margin-left: 24px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ================== Main Workspace ================== */
.main-workspace {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 16px;
    overflow: hidden;
}

/* ----------------- 左侧面板 ----------------- */
.left-panel {
    width: 580px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-heavy);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tabs */
.tab-navigation {
    display: flex;
    background: #fafafa;
    border-bottom: 1px solid #e6e6e6;
}

.tab-item {
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: all 0.2s;
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: 600;
}

/* Tab content */
.tab-content-container {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.tab-page { display: none; }
.tab-page.active { display: block; }

/* Inputs and Textarea */
textarea, input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* File Upload */
.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.file-label {
    background: #e6f7ff;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #91d5ff;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.file-label:hover { background: #bae7ff; }

.file-name {
    font-size: 13px;
    color: var(--muted);
    transition: color 0.2s;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover { background: #40a9ff; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ----------------- 右侧面板 ----------------- */
.right-panel {
    flex: 1;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-heavy);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.output-box-title {
    font-size: 20px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 16px;
}

#unified-output-content {
    background: #fafafa;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

/* Logs */
.log-entry {
    margin: 6px 0;
    padding: 8px;
    border-left: 3px solid var(--primary-color);
}

.log-info { border-left-color: var(--primary-color); }
.log-success { border-left-color: #52c41a; }
.log-error { border-left-color: #ff4d4f; color: #ff4d4f; }

.log-time { color: var(--muted); margin-right: 8px; }

/* Misc */
.hidden-file { display: none; }
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ===== 图片生成预览 ===== */
.image-preview {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.image-preview img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
}

.img-size-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
    font-size: 14px;
}