/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 确保Tailwind类优先级 */
html.light body .bg-gray-50 {
    background-color: #f9fafb !important;
}

html.light body .dark\:bg-gray-900 {
    background-color: #111827 !important;
}

/* 导航栏样式强化 */
.bg-white {
    background-color: #ffffff !important;
}

.dark .bg-gray-800 {
    background-color: #1f2937 !important;
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.text-primary-600 {
    color: #0284c7 !important;
}

.dark .text-primary-400 {
    color: #38bdf8 !important;
}

.text-gray-700 {
    color: #374151 !important;
}

.dark .text-gray-300 {
    color: #d1d5db !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    display: block; /* 修改为block布局，移除flex布局 */
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative; /* 确保定位正确 */
}

.container {
    width: 90%;
    max-width: 1200px;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    margin-top: 80px; /* 增加顶部边距，确保内容不被导航栏遮挡 */
    padding-bottom: 20px; /* 添加底部内边距 */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: visible; /* 确保内容可以溢出 */
    position: relative; /* 确保定位正确 */
    z-index: 1; /* 确保内容在导航栏下方 */
}

.content-wrapper {
    display: flex;
    flex: 1;
    height: auto;
    flex-direction: row;
}

.left-panel {
    width: 280px;
    background-color: #fff;
    padding: 12px 10px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.right-panel {
    flex: 1;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.control-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    justify-content: space-between;
}

.control-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.control-btn:hover {
    background-color: #2980b9;
}

.save-btn {
    background-color: #2ecc71;
}

.save-btn:hover {
    background-color: #27ae60;
}

.save-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.watermark-text-info {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #333;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 20px;
}

.watermark-controls {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group {
    margin-bottom: 8px;
}

.control-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    color: #34495e;
    font-size: 0.85rem;
}

input[type="text"], select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

input[type="color"] {
    width: 100%;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    margin-top: 3px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.hidden-elements {
    display: none;
}

.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #fff;
    border-radius: 8px;
    border: 2px dashed #ccc;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

.upload-prompt i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-prompt p {
    color: #666;
    font-size: 16px;
    margin-bottom: 10px;
}

.upload-prompt.hidden {
    display: none;
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* 导航栏样式 */
nav {
    width: 100%;
    z-index: 50;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark nav {
    background-color: #1f2937;
}

/* 移动端菜单样式 */
#mobileMenu {
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.dark #mobileMenu {
    background-color: #1f2937;
    border-top: 1px solid #374151;
}

/* 导航栏内部元素样式强化 */
nav .flex {
    display: flex !important;
}

nav .justify-between {
    justify-content: space-between !important;
}

nav .items-center {
    align-items: center !important;
}

nav .h-16 {
    height: 4rem !important;
}

nav .hidden {
    display: none !important;
}

nav .sm\:flex {
    display: flex !important;
}

@media (min-width: 640px) {
    nav .sm\:flex {
        display: flex !important;
    }
    
    nav .sm\:hidden {
        display: none !important;
    }
    
    nav .sm\:ml-6 {
        margin-left: 1.5rem !important;
    }
    
    nav .sm\:space-x-8 > * + * {
        margin-left: 2rem !important;
    }
}

/* 确保导航栏在所有域名下都正确显示 */
@media screen and (max-width: 640px) {
    nav .flex-shrink-0 {
        margin-right: 1rem;
    }
    
    .container {
        width: 100%;
        margin-top: 70px;
        border-radius: 0;
    }
}

/* 确保移动端菜单正确显示 */
/* 添加一些工具图标的样式 */
.tools-icons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .right-panel {
        height: 50vh;
    }
}