/* style.css - 图片加水印工具样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 80px 1.5rem 2rem;
    margin: 0;
}
.navbar {
    height: 80px !important;
}
.watermark-container {
    max-width: 1400px;
    width: 100%;
    background: #ffffff;
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 5px 15px 2px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: #333;
    text-align: center;
}

.sub {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.95rem;
	text-align: center;
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

/* ===== 左侧控制面板 ===== */
.control-panel {
    flex: 0 0 360px;
    min-width: 300px;
    background: #f8f9fa;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e9edf4;
    max-height: 780px;
    overflow-y: auto;
}

.control-panel::-webkit-scrollbar {
    width: 4px;
}
.control-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

.control-group {
    margin-bottom: 1.2rem;
}

.control-label {
    display: block;
    font-weight: 600;
    color: #0b1a33;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.control-input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 2px solid #dce2ec;
    border-radius: 0.8rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
    color: #0b1a33;
}

.control-input:focus {
    outline: none;
    border-color: #0D6EFD;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #dce2ec;
    border-radius: 1rem;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    background: #ffffff;
}

.upload-area:hover {
    border-color: #0D6EFD;
    background: #f0f4ff;
}

.upload-area i {
    font-size: 2.5rem;
    color: #0D6EFD;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-area span {
    color: #6c757d;
    font-size: 0.9rem;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-area.has-image {
    border-color: #0D6EFD;
    background: #f0f4ff;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #dce2ec;
    transition: 0.15s;
}

.radio-option:hover {
    border-color: #0D6EFD;
    background: #f0f4ff;
}

.radio-option input[type="radio"] {
    accent-color: #0D6EFD;
    width: 16px;
    height: 16px;
}

.radio-option:has(input:checked) {
    border-color: #0D6EFD;
    background: #e8eeff;
    color: #0D6EFD;
}

/* 位置按钮网格 */
.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.position-btn {
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
}

/* 滑块行 */
.slider-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.slider-row label {
    font-size: 0.85rem;
    color: #475569;
    min-width: 60px;
}

.slider-row input[type="range"] {
    flex: 1;
    accent-color: #0D6EFD;
    height: 4px;
    cursor: pointer;
}

.slider-row input[type="color"] {
    width: 40px;
    height: 36px;
    border: 1px solid #dce2ec;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
}

.slider-value {
    min-width: 36px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0b1a33;
    background: #ffffff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* ===== 右侧预览面板 ===== */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.preview-header span {
    font-weight: 600;
    color: #0b1a33;
}

.save-btn {
    background: #0D6EFD;
    border: none;
    color: white;
    padding: 0.4rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.save-btn:hover {
    background: #0b5ed7;
    transform: scale(1.02);
}

.save-btn:active {
    transform: scale(0.95);
}

.preview-container {
    flex: 1;
    background: #f8f9fa;
    border-radius: 1.2rem;
    border: 2px solid #e9edf4;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container canvas {
    max-width: 100%;
    max-height: 100%;
    display: none;
    object-fit: contain;
}

.preview-container .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
}

.preview-container .placeholder i {
    font-size: 4rem;
    color: #cbd5e1;
}

.preview-container .placeholder span {
    font-size: 1rem;
}

.preview-container.has-image canvas {
    display: block;
}

.preview-container.has-image .placeholder {
    display: none;
}

.preview-info {
    display: flex;
    gap: 2rem;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.preview-info span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.preview-info .status-active {
    color: #0D6EFD;
    font-weight: 500;
}

.preview-info .status-inactive {
    color: #94a3b8;
}


/* 平铺间距控制组 */
#tileSpacingGroup {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

#tileSpacingGroup.hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
}

#tileSpacingGroup.visible {
    opacity: 1;
    max-height: 100px;
    margin-bottom: 1.2rem;
}

/* 确保滑块样式统一 */
#tileSpacing {
    flex: 1;
    accent-color: #0D6EFD;
    height: 4px;
    cursor: pointer;
}


/* 水印文字输入框字符计数 */
#watermarkText {
    padding-right: 60px !important; /* 为字符计数留出空间 */
}

#charCount {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    transition: color 0.2s;
}

#charCount.warning {
    color: #f59e0b; /* 接近限制时橙色警告 */
}

#charCount.danger {
    color: #ef4444; /* 达到限制时红色警告 */
}