body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #9dd0ec; /* 浅蓝色背景 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

#app {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.paper-preview {
    flex: 2;
    background-color: #f3d3d3; /* 浅粉色背景 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

canvas#paper-canvas {
    border: 1px solid #ccc;
    width: 100%;
    max-width: 800px;
    height: auto;
    background-color: #ffffff; /* 纸张白色 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 模拟纸张阴影 */
}

.settings-panel {
    flex: 1;
    background: #c3f1ee;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-panel h2 {
    margin-top: 0;
    color: #000000;
}

.settings-panel label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}

.settings-panel select,
.settings-panel input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
}

button:hover {
    background-color: #0056b3;
}

/* 页边距设置容器 */
.margin-settings {
    margin-top: 10px;
}

/* 在现有的 margin-settings 样式后添加以下样式 */
.margin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
}

.margin-header label {
    margin: 0;
}

.toggle-icon {
    transition: transform 0.3s;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

/* 每行的页边距设置 */
.margin-row {
    display: flex;
    justify-content: space-between;
    align-items: center; /* 确保文字和输入框垂直居中 */
    gap: 10px;
    margin-bottom: 10px;
}

.margin-row label {
    flex: 1; /* 标签占据一定比例 */
    text-align: right;
    margin-right: 5px;
    line-height: 1; /* 确保文字与输入框对齐 */
    display: flex;
    align-items: center; /* 垂直居中 */
}

.margin-row input {
    flex: 3; /* 输入框占据更多比例 */
    min-width: 60px; /* 确保输入框不会太小 */
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    height: 36px; /* 确保输入框高度一致 */
}

/* 水印设置样式 */
.watermark-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.watermark-toggle {
    display: flex;
    align-items: center;
    gap: 10px; /* 控制文字和按钮之间的间距 */
    margin-bottom: 15px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* 控制文字和复选框之间的间距 */
    cursor: pointer;
}

.toggle-text {
    font-size: 14px;
    color: #333;
}

/* 开关按钮样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc; /* 默认灰色 */
    transition: 0.4s;
    border-radius: 20px; /* 长椭圆形 */
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%; /* 圆形按钮 */
}

input:checked + .slider {
    background-color: #4caf50; /* 开启时绿色 */
}

input:checked + .slider:before {
    transform: translateX(20px); /* 滑块向右移动 */
}

.watermark-options {
    padding-top: 10px;
}

.watermark-options label {
    display: block;
    margin: 10px 0 5px;
}

.watermark-options input[type="range"] {
    width: calc(100% - 50px);
    display: inline-block;
}

.watermark-options span {
    display: inline-block;
    width: 45px;
    text-align: right;
    margin-left: 5px;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-container input[type="range"] {
    flex: 1;
}

.range-container span {
    width: 50px;
    text-align: right;
}

/* 颜色输入框样式优化 */
input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}