/* ========================================
   在线涂鸦画板页面样式 - 001huaban.css
   ======================================== */

/* 全局重置 */
body, html {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ========================================
   工具页面通用顶部底部样式
   所有工具页面共用
   ======================================== */

/* 顶部导航 */
.tool-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tool-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tool-logo {
    display: flex;
    align-items: center;
}

.tool-logo-img {
    height: 32px;
    width: auto;
}

.tool-page-title-link {
    flex: 1;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.tool-page-title-link:hover {
    opacity: 0.8;
}

.tool-page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-page-title::before {
    content: '✦';
    font-size: 14px;
    color: #6d55fe;
    opacity: 0.6;
}

.tool-page-title::after {
    content: '✦';
    font-size: 14px;
    color: #6d55fe;
    opacity: 0.6;
}

.tool-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(109, 85, 254, 0.08);
    color: #6d55fe;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-back-btn:hover {
    background: rgba(109, 85, 254, 0.15);
    transform: scale(0.98);
}

/* 底部 */
.tool-footer {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    margin-top: auto;
}

.tool-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
    text-align: center;
}

.tool-copyright {
    font-size: 13px;
    color: #8E8E93;
    margin: 0;
}

.tool-copyright a {
    color: #6d55fe;
    text-decoration: none;
    margin: 0 8px;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-copyright a:hover {
    opacity: 0.7;
}

/* 响应式 - 顶部底部 */
@media (max-width: 768px) {
    .tool-header-inner {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .tool-logo-img {
        height: 28px;
    }
    
    .tool-page-title {
        font-size: 16px;
        gap: 6px;
    }
    
    .tool-page-title::before,
    .tool-page-title::after {
        font-size: 12px;
    }
    
    .tool-back-btn {
        padding: 6px 12px;
    }
    
    .tool-back-btn span {
        display: none;
    }
    
    .tool-footer-inner {
        padding: 20px 16px;
    }
}

/* ========================================
   画板工具专用样式
   ======================================== */

/* 主内容区 */
.huaban-main {
    min-height: calc(100vh - 120px);
}

/* 画板区域 */
.huaban-section {
    padding: 30px 0 40px;
    background: #f8f9fa;
}

.huaban-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 工具栏 */
.huaban-toolbar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 画笔控制组 - 单独一行 */
.toolbar-brush-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 20px;
    padding: 8px 0;
}

/* 操作按钮组 - 始终靠右 */
.toolbar-actions {
    margin-left: auto;
}

.toolbar-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

/* 工具按钮 */
.tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #333;
    flex-shrink: 0;
}

.tool-btn:hover {
    background: #e8e8e8;
}

.tool-btn.active {
    background: linear-gradient(135deg, rgba(109, 85, 254, 0.1) 0%, rgba(109, 85, 254, 0.05) 100%);
    border-color: var(--brand-primary, #6d55fe);
    color: var(--brand-primary, #6d55fe);
}

.tool-btn svg {
    flex-shrink: 0;
}

/* 画笔样式选择器 */
.brush-style-select {
    padding: 5px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 70px;
}

.brush-style-select:hover {
    border-color: var(--brand-primary, #6d55fe);
    background: #f8f9fa;
}

.brush-style-select:focus {
    border-color: var(--brand-primary, #6d55fe);
    box-shadow: 0 0 0 3px rgba(109, 85, 254, 0.1);
}

/* 画布尺寸组 */
.canvas-size-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 自定义尺寸输入 */
.custom-size-input {
    width: 80px;
    padding: 5px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.custom-size-input:hover {
    border-color: var(--brand-primary, #6d55fe);
}

.custom-size-input:focus {
    border-color: var(--brand-primary, #6d55fe);
    box-shadow: 0 0 0 3px rgba(109, 85, 254, 0.1);
}

.size-separator {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* 应用自定义尺寸按钮 */
.apply-custom-size {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.apply-custom-size span {
    display: inline !important;
}

/* 画笔粗细滑块 */
.brush-slider {
    width: 90px;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.brush-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary, #6d55fe);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(109, 85, 254, 0.3);
}

.brush-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary, #6d55fe);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(109, 85, 254, 0.3);
}

.size-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    min-width: 40px;
}

/* 颜色选择器 */
.color-input {
    width: 50px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.color-input:hover {
    border-color: var(--brand-primary, #6d55fe);
}

.preset-colors {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.color-preset:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 背景按钮 */
.bg-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.bg-btn:hover {
    border-color: var(--brand-primary, #6d55fe);
    transform: scale(1.05);
}

.bg-btn.active {
    border-color: var(--brand-primary, #6d55fe);
    box-shadow: 0 0 0 2px rgba(109, 85, 254, 0.2);
}

/* 操作按钮 */
.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.action-btn:hover {
    border-color: var(--brand-primary, #6d55fe);
    color: var(--brand-primary, #6d55fe);
    background: rgba(109, 85, 254, 0.05);
}

.action-btn.primary {
    background: linear-gradient(135deg, #6d55fe 0%, #8572ff 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(109, 85, 254, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(109, 85, 254, 0.4);
}

.action-btn svg {
    flex-shrink: 0;
}

/* 画布区域 */
.huaban-canvas-wrapper {
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 740px;
    position: relative;
}

.huaban-canvas-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(109, 85, 254, 0.1) 0%, rgba(109, 85, 254, 0.05) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.huaban-canvas {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: crosshair;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 使用说明 */
.huaban-tips {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(109, 85, 254, 0.1);
}

.tips-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-left: 16px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tips-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--brand-primary, #6d55fe) 0%, rgba(109, 85, 254, 0.6) 100%);
    border-radius: 2px;
}

.tips-title::after {
    content: '💡';
    font-size: 20px;
    margin-left: auto;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tips-list li {
    position: relative;
    padding: 16px 16px 16px 48px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    background: linear-gradient(135deg, rgba(109, 85, 254, 0.03) 0%, rgba(109, 85, 254, 0.01) 100%);
    border-radius: 8px;
    border: 1px solid rgba(109, 85, 254, 0.08);
    transition: all 0.3s ease;
}

.tips-list li:hover {
    background: linear-gradient(135deg, rgba(109, 85, 254, 0.08) 0%, rgba(109, 85, 254, 0.03) 100%);
    border-color: rgba(109, 85, 254, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 85, 254, 0.1);
}

.tips-list li::before {
    content: '✓';
    position: absolute;
    left: 16px;
    top: 16px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--brand-primary, #6d55fe) 0%, #8572ff 100%);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(109, 85, 254, 0.3);
}

.tips-list li strong {
    color: var(--brand-primary, #6d55fe);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .huaban-toolbar {
        gap: 12px;
    }
    
    .toolbar-brush-controls {
        gap: 12px 16px;
    }
    
    /* 绘画工具组允许换行 */
    .huaban-toolbar > .toolbar-group:first-child {
        flex-wrap: wrap;
    }
    
    .toolbar-actions {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 1180px) {
    .tool-btn {
        padding: 8px 10px;
        font-size: 13px;
        gap: 4px;
    }
}

@media (max-width: 1024px) {
    .huaban-toolbar {
        gap: 10px;
    }
    
    .toolbar-group {
        gap: 6px;
    }
    
    .tool-btn {
        padding: 8px;
        font-size: 13px;
    }
    
    .tool-btn span {
        display: none;
    }
    
    .brush-style-select {
        min-width: 65px;
        font-size: 12px;
    }
    
    .brush-slider {
        width: 85px;
    }
    
    .color-preset {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 768px) {
    .huaban-section {
        padding: 30px 0 100px;
    }
    
    .huaban-toolbar {
        padding: 16px;
        gap: 12px;
    }
    
    .toolbar-brush-controls {
        gap: 10px;
        padding: 8px 0;
    }
    
    .toolbar-group {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    /* 绘画工具组在小屏时特殊处理 */
    .huaban-toolbar > .toolbar-group:first-child {
        width: 100%;
    }
    
    .huaban-toolbar > .toolbar-group:first-child .toolbar-label {
        width: 100%;
        margin-bottom: 6px;
    }
    
    .toolbar-label {
        font-size: 12px;
        flex-shrink: 0;
    }
    
    .tool-btn {
        padding: 8px;
        font-size: 13px;
        min-width: 40px;
    }
    
    .tool-btn svg {
        margin: 0;
    }
    
    .brush-style-select,
    .custom-size-input {
        font-size: 12px;
        padding: 4px 6px;
        min-width: 60px;
    }
    
    .custom-size-input {
        width: 70px;
        font-size: 12px;
        padding: 4px 6px;
    }
    
    .canvas-size-group {
        width: 100%;
    }
    
    .custom-size-inputs {
        flex-wrap: wrap;
        max-width: 100%;
    }
    
    .apply-custom-size {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .apply-custom-size span {
        display: inline !important;
    }
    
    /* 画笔粗细和透明度在小屏单独一行铺满 */
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) .toolbar-label {
        flex-shrink: 0;
        width: auto;
    }
    
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) .brush-slider {
        flex: 1;
        width: auto;
        min-width: 0;
        height: 8px;
    }
    
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) .size-value {
        flex-shrink: 0;
        width: auto;
    }
    
    .brush-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    
    .brush-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
    
    .size-value {
        font-size: 12px;
        min-width: 40px;
    }
    
    .color-input {
        width: 40px;
        height: 36px;
    }
    
    .preset-colors {
        display: grid;
        grid-template-columns: repeat(5, 26px);
        gap: 6px;
        max-width: 100%;
    }
    
    .color-preset {
        width: 26px;
        height: 26px;
    }
    
    .bg-btn {
        width: 32px;
        height: 32px;
    }
    
    .toolbar-actions {
        gap: 6px;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 6px;
        font-size: 12px;
        min-width: 0;
    }
    
    .action-btn span {
        display: none;
    }
    
    .huaban-canvas-wrapper {
        padding: 12px;
        min-height: 400px;
    }
    
    .huaban-tips {
        padding: 20px;
    }
    
    .tips-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .tips-title::after {
        font-size: 18px;
    }
    
    .tips-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tips-list li {
        font-size: 13px;
        padding: 12px 12px 12px 44px;
    }
    
    .tips-list li::before {
        width: 20px;
        height: 20px;
        font-size: 12px;
        left: 12px;
        top: 12px;
    }
}

@media (max-width: 480px) {
    .huaban-section {
        padding: 20px 0 100px;
    }
    
    .huaban-container {
        padding: 0 12px;
    }
    
    .huaban-toolbar {
        padding: 12px;
        gap: 10px;
    }
    
    .toolbar-group {
        gap: 5px;
    }
    
    .tool-btn {
        padding: 6px;
        min-width: 36px;
    }
    
    .canvas-size-group {
        width: 100%;
    }
    
    .custom-size-inputs {
        flex-wrap: wrap;
        max-width: 100%;
    }
    
    .custom-size-input {
        width: 65px;
        font-size: 12px;
        padding: 4px 6px;
    }
    
    .apply-custom-size {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .size-separator {
        font-size: 14px;
    }
    
    /* 画笔粗细和透明度在小屏单独一行铺满 */
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) .brush-slider {
        flex: 1;
        width: auto;
        min-width: 0;
        height: 8px;
    }
    
    .brush-slider::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }
    
    .brush-slider::-moz-range-thumb {
        width: 22px;
        height: 22px;
    }
    
    .size-value {
        font-size: 12px;
        min-width: 38px;
    }
    
    .color-input {
        width: 36px;
        height: 32px;
    }
    
    .preset-colors {
        grid-template-columns: repeat(5, 22px);
        gap: 4px;
    }
    
    .color-preset {
        width: 22px;
        height: 22px;
    }
    
    .bg-btn {
        width: 28px;
        height: 28px;
    }
    
    .action-btn {
        padding: 6px 4px;
    }
    
    .huaban-canvas-wrapper {
        min-height: 300px;
        padding: 10px;
    }
    
    .huaban-tips {
        padding: 16px;
    }
}

@media (max-width: 380px) {
    .huaban-toolbar {
        padding: 10px;
    }
    
    /* 画笔粗细和透明度在超小屏单独一行铺满 */
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) {
        width: 100%;
    }
    
    .toolbar-brush-controls .toolbar-group:has(.brush-slider) .brush-slider {
        flex: 1;
        height: 8px;
    }
    
    .brush-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .brush-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
    
    .preset-colors {
        grid-template-columns: repeat(4, 20px);
        gap: 4px;
    }
    
    .color-preset {
        width: 20px;
        height: 20px;
    }
    
    .tool-btn {
        padding: 5px;
        min-width: 32px;
    }
    
    .canvas-size-group {
        width: 100%;
    }
    
    .custom-size-inputs {
        flex-wrap: wrap;
        max-width: 100%;
        gap: 6px;
    }
    
    .custom-size-input {
        width: 60px;
        font-size: 11px;
        padding: 3px 5px;
    }
    
    .apply-custom-size {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .size-separator {
        font-size: 13px;
    }
}


