/* 全局样式 */
:root {
    --primary-color: #07c160;
    --secondary-color: #4a4a4a;
    --border-color: #e0e0e0;
    --background-color: #f5f5f5;
}

body {
    background-color: var(--background-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--secondary-color);
}

.container {
    max-width: 1200px;
    padding: 2rem;
}

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.divider {
    color: #ccc;
    margin: 0 0.5rem;
}

/* 上传区域样式 */
.upload-box {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background-color: rgba(7, 193, 96, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

.upload-text {
    font-size: 1.2rem;
    color: #666;
}

.upload-tip {
    font-size: 0.9rem;
    color: #999;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
}

/* 参数设置区域样式 */
.params-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.param-item {
    margin-bottom: 1.5rem;
}

.param-item:last-child {
    margin-bottom: 0;
}

.param-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-range {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-value {
    min-width: 3rem;
    text-align: right;
    color: #666;
    font-weight: 500;
}

.mode-options {
    display: flex;
    gap: 1rem;
}

.mode-option {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mode-option.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 处理按钮样式 */
.process-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.process-btn:hover:not(:disabled) {
    background: #06a152;
    transform: translateY(-1px);
}

.process-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 结果展示区域样式 */
.results-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.result-image-container {
    margin-bottom: 1rem;
    text-align: center;
    background: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
}

.result-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 4px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.action-btn:hover {
    background: #06a152;
    transform: translateY(-1px);
}

.action-btn i {
    font-size: 0.9rem;
}

/* 编辑模式样式 */
.edit-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
}

.canvas-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#mainCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* 工具栏样式 */
.top-toolbar,
.bottom-toolbar {
    position: fixed;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    z-index: 1001;
}

.top-toolbar {
    top: 0;
}

.bottom-toolbar {
    bottom: 0;
    justify-content: center;
    gap: 1rem;
}

.tool-group {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 工具面板样式 */
.tools-panel {
    position: fixed;
    top: 60px;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 1rem;
    color: #fff;
    z-index: 1001;
    width: 300px;
}

.tool-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* 颜色选择器样式 */
.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-btn {
    width: 30px;
    height: 30px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn.active {
    border-color: #fff;
    transform: scale(1.1);
}

/* Loading遮罩样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: #fff;
}

.mode-option[data-mode="shuimo"] {
    background: rgba(0, 0, 0, 0.05);
    color: var(--secondary-color);
}

.mode-option[data-mode="shuimo"].active {
    background: var(--primary-color);
    color: #fff;
}