:root {
    --primary: #5d5fef;
    --primary-light: #8a8df5;
    --primary-dark: #4a4bc5;
    --secondary: #9d4edd;
    --accent: #ff6b9d;
    --success: #4dc9f0;
    --warning: #ff9e5e;
    --danger: #ff4d7a;
    --light: #ffffff;
    --dark: #2d2f45;
    --gray: #8a8ca5;
    --light-gray: #f0f2ff;
    --bg-gradient: linear-gradient(145deg, #f8f9ff 0%, #f0f2ff 100%);
    --card-shadow: 0 12px 40px rgba(93, 95, 239, 0.12);
    --card-shadow-hover: 0 20px 50px rgba(93, 95, 239, 0.18);
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --border-radius-lg: 28px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* 修改后的 body 样式 */
body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-gradient);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    /* 修改以下部分 */
    display: flex;
    flex-direction: column; /* 纵向排列 */
    justify-content: flex-start; /* 从顶部开始 */
    align-items: center; /* 水平居中 */
}

.container {
    display: flex;
    max-width: 1300px;
    width: 100%;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    min-height: 780px;
    transition: var(--transition);
}

.container:hover {
    box-shadow: var(--card-shadow-hover);
}

/* 左侧面板 */
.left-panel {
    flex: 1;
    padding: 50px 40px;
    background: linear-gradient(180deg, #fcfcff 0%, #f8f9ff 100%);
    border-right: 1px solid rgba(93, 95, 239, 0.08);
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0.8;
}

.header { 
    margin-bottom: 40px; 
    text-align: left;
    position: relative;
}

.header h1 {
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header p { 
    color: var(--gray); 
    font-size: 16px; 
    font-weight: 400;
    max-width: 500px;
    line-height: 1.7;
}

.header h1 i {
    font-size: 38px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 3px 6px rgba(93, 95, 239, 0.2));
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 18px;
    position: relative;
    padding-bottom: 10px;
}

.section-title i { 
    color: var(--primary); 
    width: 22px; 
    text-align: center; 
    font-size: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.input-group { 
    margin-bottom: 35px; 
    position: relative; 
}

.input-with-icon { 
    position: relative; 
}

.input-with-icon i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
    z-index: 2;
    font-size: 18px;
}

.text-input {
    width: 100%;
    padding: 18px 20px 18px 52px;
    border: 2px solid rgba(93, 95, 239, 0.15);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    background: white;
    color: var(--dark);
    box-shadow: 0 4px 12px rgba(93, 95, 239, 0.05);
}

.text-input:focus {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(93, 95, 239, 0.15);
    outline: none;
    transform: translateY(-1px);
}

.text-input::placeholder {
    color: #a8aac5;
    font-weight: 400;
}

/* 历史记录下拉菜单 */
.history-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(93, 95, 239, 0.12);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.history-dropdown.show { 
    display: block; 
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(93, 95, 239, 0.08);
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover { 
    background: linear-gradient(90deg, rgba(93, 95, 239, 0.05), rgba(157, 78, 221, 0.05));
    padding-left: 22px;
}

.history-text { 
    flex: 1; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    font-size: 15px; 
    margin-right: 12px; 
    color: var(--dark);
    font-weight: 500;
}

.history-delete { 
    color: var(--gray); 
    padding: 6px 10px; 
    font-size: 16px; 
    border-radius: 6px; 
    transition: var(--transition);
}

.history-delete:hover { 
    color: var(--danger); 
    background: rgba(255, 77, 122, 0.1); 
    transform: rotate(90deg);
}

/* 文件上传区域 - 修改版 */
.file-upload-area {
    position: relative;
    border: 2px dashed rgba(93, 95, 239, 0.25);
    border-radius: var(--border-radius-sm);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(145deg, rgba(93, 95, 239, 0.02), rgba(157, 78, 221, 0.02));
    margin-bottom: 15px;
    transition: var(--transition);
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-upload-area.has-logo {
    border-color: var(--primary);
    background: linear-gradient(145deg, rgba(93, 95, 239, 0.05), rgba(157, 78, 221, 0.05));
    padding: 20px;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: linear-gradient(145deg, rgba(93, 95, 239, 0.05), rgba(157, 78, 221, 0.05));
    transform: translateY(-2px);
}

.upload-icon { 
    font-size: 36px; 
    color: var(--primary); 
    margin-bottom: 12px; 
    display: block; 
    transition: var(--transition);
    z-index: 2;
}

.file-upload-area:hover .upload-icon {
    transform: translateY(-5px);
}

.upload-text { 
    color: var(--gray); 
    font-size: 15px;
    font-weight: 500;
    z-index: 2;
}

.upload-hint {
    font-size: 13px; 
    margin-top: 8px; 
    color: #a8aac5;
    z-index: 2;
}

.logo-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1;
    display: none;
}

.logo-preview.show {
    display: block;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.remove-logo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 77, 122, 0.9);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
}

.file-upload-area.has-logo:hover .remove-logo-btn {
    opacity: 1;
    transform: scale(1);
}

.remove-logo-btn:hover {
    background: var(--danger);
    transform: scale(1.1) !important;
}

.checkbox-container { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 20px; 
    padding: 12px 15px;
    background: rgba(93, 95, 239, 0.03);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(93, 95, 239, 0.08);
}

.checkbox-container input { 
    width: 20px; 
    height: 20px; 
    cursor: pointer; 
    accent-color: var(--primary);
}

.checkbox-container label { 
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
}

/* 设置区域 */
.settings-section { 
    background: linear-gradient(145deg, rgba(93, 95, 239, 0.03), rgba(157, 78, 221, 0.03));
    border-radius: var(--border-radius-sm); 
    padding: 25px; 
    box-shadow: 0 8px 24px rgba(93, 95, 239, 0.05);
    border: 1px solid rgba(93, 95, 239, 0.08);
    margin-bottom: 15px;
}

.settings-row { 
    display: flex; 
    gap: 25px; 
    margin-bottom: 25px; 
}

.setting-item { 
    flex: 1; 
}

.setting-header { 
    display: flex; 
    justify-content: space-between; 
    font-size: 14px; 
    margin-bottom: 12px;
    font-weight: 600;
}

.setting-label {
    color: var(--primary-dark);
}

.setting-value { 
    font-weight: 800; 
    color: var(--primary); 
    font-size: 16px;
}

input[type="range"] { 
    width: 100%; 
    height: 8px;
    accent-color: var(--primary); 
    cursor: pointer; 
    border-radius: 4px;
    background: rgba(93, 95, 239, 0.1);
}

.color-settings { 
    display: flex; 
    gap: 20px; 
    margin-top: 10px;
}

.color-item { 
    flex: 1; 
}

.color-picker-wrapper {
    display: flex; 
    align-items: center; 
    gap: 12px;
    border: 1px solid rgba(93, 95, 239, 0.15); 
    border-radius: var(--border-radius-sm); 
    padding: 12px 15px;
    background: white;
    transition: var(--transition);
}

.color-picker-wrapper:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(93, 95, 239, 0.12);
}

.color-picker-wrapper input { 
    border: none; 
    width: 32px; 
    height: 32px; 
    cursor: pointer; 
    background: none; 
    border-radius: 8px;
    overflow: hidden;
}

.color-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    display: block;
}

/* 生成按钮 */
.btn-generate {
    width: 100%; 
    padding: 20px; 
    margin-top: 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; 
    border: none; 
    border-radius: var(--border-radius-sm);
    font-size: 18px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(93, 95, 239, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.6s;
}

.btn-generate:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(93, 95, 239, 0.4);
}

.btn-generate:hover::before {
    left: 100%;
}

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

/* 右侧面板 */
.right-panel {
    flex: 1; 
    padding: 50px 40px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    background: linear-gradient(145deg, #fcfcff 0%, #f8f9ff 100%);
    position: relative;
    overflow: hidden;
}

.right-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    opacity: 0.8;
}

.qr-display {
    background: white; 
    border: 1px solid rgba(93, 95, 239, 0.12);
    border-radius: var(--border-radius); 
    padding: 30px;
    width: 100%; 
    max-width: 380px; 
    min-height: 380px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 15px 40px rgba(93, 95, 239, 0.1);
    position: relative;
    transition: var(--transition);
}

.qr-display:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(93, 95, 239, 0.15);
}

#final-image { 
    max-width: 100%; 
    border-radius: 12px;
    display: none; 
    animation: fadeInScale 0.5s ease;
}

.placeholder { 
    text-align: center; 
    color: var(--gray); 
    padding: 30px;
}

.placeholder i { 
    font-size: 70px; 
    opacity: 0.15; 
    margin-bottom: 20px; 
    display: block; 
    color: var(--primary);
}

.placeholder p { 
    font-size: 18px; 
    font-weight: 500; 
    color: var(--gray);
}

/* 下载按钮 */
.btn-download {
    padding: 20px 30px; 
    width: 100%; 
    max-width: 380px; 
    margin-top: 30px;
    background: linear-gradient(135deg, var(--success), #3aa8d8);
    color: white; 
    border: none;
    border-radius: var(--border-radius-sm); 
    font-weight: 700; 
    cursor: pointer;
    display: none; 
    align-items: center; 
    justify-content: center; 
    gap: 12px;
    font-size: 17px;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(77, 201, 240, 0.3);
}

.btn-download:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(77, 201, 240, 0.4);
    background: linear-gradient(135deg, #3dc5f0, #2f9ac7);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container { 
        flex-direction: column; 
        max-width: 650px;
    }
    
    .left-panel { 
        border-right: none; 
        border-bottom: 1px solid rgba(93, 95, 239, 0.08); 
        padding: 40px 30px;
    }
    
    .right-panel { 
        padding: 40px 30px; 
    }
    
    .settings-row { 
        flex-direction: column; 
        gap: 20px; 
    }
    
    .header h1 { 
        font-size: 30px; 
    }
    .breadcrumb-section {
        max-width: 650px; /* 与平板端容器宽度一致 */
    }
}

@media (max-width: 576px) {
    body { 
        padding: 15px; 
    }
    
    .container { 
        border-radius: 20px; 
        min-height: auto;
    }
    
    .left-panel, 
    .right-panel { 
        padding: 30px 20px; 
    }
    
    .header h1 { 
        font-size: 26px; 
    }
    
    .section-title { 
        font-size: 16px; 
    }
    
    .btn-generate,
    .btn-download { 
        padding: 18px; 
    }
    
    .file-upload-area {
        min-height: 120px;
        padding: 20px 15px;
    }
    .breadcrumb-section {
        margin-bottom: 15px;
        padding: 0 5px;
    }
}

/* 错误动画 */
.error-shake {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(255, 77, 122, 0.2) !important;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 隐藏的二维码生成器 */
#hidden-qr-generator { 
    display: none; 
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background-color: var(--dark);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}