/* ============ SVG 占位符生成器 - 工具特有样式 ============ */
/* 通用样式（容器布局、卡片、按钮、分隔线、info-box、section-row-1-2 等）由 common.css 统一提供 */
/* 注：.ratio-options / .btn-ratio 为各工具自带的选项按钮样式，common.css 未提供，故在此定义 */

/* ---- 选项按钮（比率 / 快捷尺寸等） ---- */
.ratio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-ratio {
    padding: 6px 12px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ratio:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.btn-ratio.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
    color: white;
}

/* ---- 画布尺寸输入 ---- */
.custom-ratio-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.custom-ratio-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-ratio-item label {
    font-size: 12px;
    color: #6b7280;
}

.custom-input {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.custom-input:focus {
    border-color: #8b5cf6;
}

.custom-ratio-sep {
    font-size: 16px;
    color: #6b7280;
    padding-bottom: 6px;
    flex-shrink: 0;
}

/* ---- 颜色选择 ---- */
.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.color-input {
    width: 36px;
    height: 36px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: #fff;
    flex-shrink: 0;
}

.color-text {
    flex: 1;
    min-width: 80px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Consolas', monospace;
    outline: none;
}

.color-text:focus {
    border-color: #8b5cf6;
}

.color-opacity {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.color-opacity label {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.opacity-val {
    font-size: 12px;
    color: #6b7280;
    font-family: 'Consolas', monospace;
    min-width: 36px;
    text-align: right;
}

/* ---- 滑块（带数值） ---- */
.range-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-slider {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

.range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    min-width: 48px;
    text-align: right;
}

/* ---- 导出信息 ---- */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.info-label {
    color: #6b7280;
}

.info-value {
    color: #374151;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ---- 预览区 ---- */
.svg-preview {
    overflow: auto;
    border-radius: 8px;
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #f3f4f6;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.preview-wrapper {
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.preview-img {
    display: block;
    max-width: 100%;
}

/* ---- 代码区 ---- */
.code-area {
    overflow: auto;
    max-height: 240px;
}

.code-block {
    margin: 0;
    padding: 12px;
    background: #1f2937;
    border-radius: 8px;
    font-size: 12px;
    color: #e5e7eb;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}
