/* 基础样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.app-header {
    background-color: #343a40;
    color: white;
    padding: 0.5rem 0; /* PC端增加到8px，让顶部更高一些 */
}

/* 移动端优化 - 手机端显示更高一些 */
@media (max-width: 768px) {
    .app-header {
        padding: 0.375rem 0; /* 手机端增加到6px，比桌面端更高 */
    }
    
    .app-header .container {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    
    .app-header .h6 {
        font-size: 1rem; /* 手机端保持正常字体大小 */
        margin: 0;
    }
    
    .app-header .btn-sm {
        padding: 0.25rem 0.5rem; /* 手机端正常按钮内边距 */
        font-size: 0.875rem; /* 手机端正常按钮字体 */
    }
    
    .app-header .fas {
        font-size: 16px !important; /* 手机端正常图标大小 */
    }
}

.app-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 主内容区域 */
.main-content {
    min-height: calc(100vh - 160px);
    padding: 0;
    background-color: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.1), 0 4px 6px -1px rgba(0,0,0,0.05);
}

/* 两栏布局 - 核心样式 */
.two-column-layout {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    margin-top: -0.25rem;
}

.left-column,
.right-column {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.25rem;
}

.right-column {
    border-left: 1px solid #dee2e6;
}

/* 卡片样式 */
.card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-header {
    background-color: #495057;
    color: white;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.card-body {
    padding: 1rem;
}

/* 表单元素样式 */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* 预览区域样式 */
.preview-container {
    min-height: 200px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    overflow-y: auto;
    padding: 10px;
    max-height: 600px; /* 设置最大高度，超过则显示滚动条 */
}

.barcode-image-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 150px;
    min-width: 150px;
    overflow: visible;
}

.barcode-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    background-color: white;
    position: relative;
    z-index: 1;
}

/* 颜色选择器样式 */
.color-input {
    height: 36px;
    border: 1px solid #ced4da;
    cursor: pointer;
    margin-right: 10px;
    border-radius: 4px;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.color-text {
    text-align: center;
    font-family: monospace;
    font-size: 12px;
    border-radius: 4px;
}

/* 确保颜色选择器和文本框有合适的间距 */
.color-input-wrapper {
    display: flex;
    align-items: center;
}

.input-group .form-control:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .form-control:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.empty-state {
    text-align: center;
    color: #6c757d;
}

/* 间距工具类 */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

/* 文本工具类 */
.text-center { text-align: center !important; }
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-base { font-size: 1rem !important; }
.font-bold { font-weight: 700 !important; }
.font-medium { font-weight: 500 !important; }
.text-gray-300 { color: #dee2e6 !important; }
.text-gray-400 { color: #adb5bd !important; }
.text-gray-500 { color: #6c757d !important; }
.text-gray-700 { color: #495057 !important; }
.text-primary { color: #007bff !important; }
.text-white { color: #fff !important; }

/* 背景颜色工具类 */
.bg-white { background-color: #fff !important; }
.bg-gray-50 { background-color: #f8f9fa !important; }
.bg-gray-700 { background-color: #495057 !important; }
.bg-gray-800 { background-color: #343a40 !important; }

/* Flex布局工具类 */
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

/* 边框工具类 */
.border { border: 1px solid #dee2e6 !important; }
.border-l { border-left: 1px solid #dee2e6 !important; }
.border-gray-200 { border-color: #dee2e6 !important; }
.rounded { border-radius: 0.375rem !important; }

/* 页脚样式 */
.app-footer {
    background-color: #343a40;
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-text {
    margin-bottom: 0.5rem;
}

.copyright-text {
    font-size: 0.875rem;
    color: #adb5bd;
}

/* 图标样式 */
.fas {
    margin-right: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 767px) {
    /* 移动端使用单列布局 */
    .two-column-layout {
        flex-direction: column;
        flex-wrap: wrap;
    }
    
    .left-column,
    .right-column {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0.5rem;
    }
    
    .right-column {
        border-left: none;
        border-top: 1px solid #dee2e6;
    }
    
    /* 移动端标题大小调整 */
    .app-title {
        font-size: 1.5rem;
    }
    
    /* 移动端主内容区域内边距 */
    .main-content {
        padding: 0;
    }
    
    /* 移动端字符容器间距 */
    .character-container {
        gap: 0.5rem;
    }
}

/* 桌面端样式增强 */
@media (min-width: 768px) {
    /* 确保桌面端两栏布局正确 */
    .two-column-layout {
        display: flex !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .left-column,
    .right-column {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        display: block !important;
        float: none !important;
        margin: 0 !important;
        padding: 0.5rem !important;
    }
    
    .right-column {
        border-left: 1px solid #dee2e6 !important;
    }
}

/* 工具提示基础样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* 清除浮动 */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* 高度100% */
.h-full {
    height: 100%;
}

/* 行高 */
.line-height-1 {
    line-height: 1;
}

.line-height-1_5 {
    line-height: 1.5;
}

/* 鼠标悬停效果 */
.hover\:bg-gray-700:hover {
    background-color: #495057 !important;
}

/* 最大宽度 */
.max-w-full {
    max-width: 100% !important;
}

/* 高度自动 */
.h-auto {
    height: auto !important;
}

/* 溢出隐藏 */
.overflow-hidden {
    overflow: hidden !important;
}

/* 网格布局 */
.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

/* 响应式文本对齐 */
.text-md-right {
    text-align: right !important;
}

@media (max-width: 767px) {
    .text-md-right {
        text-align: center !important;
    }
}

/* 移动设备边距调整 */
.mb-md-0 {
    margin-bottom: 0 !important;
}

@media (max-width: 767px) {
    .mb-md-0 {
        margin-bottom: 1rem !important;
    }
}