/* style.css */
body {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    user-select: none;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}

.input_video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* 镜像翻转 */
    z-index: 1;
    opacity: 0.8; /* 稍微暗一点，让画的线更清楚 */
}

canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: scaleX(-1); /* 同样镜像翻转以匹配视频 */
}

.drawing_canvas {
    z-index: 2;
}

.cursor_canvas {
    z-index: 3;
    pointer-events: none;
}

/* 加载层 */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 100;
    transition: opacity 0.5s;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sub-text {
    font-size: 14px;
    color: #aaa;
    margin-top: 5px;
}

/* 工具栏 */
.toolbar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10;
    display: flex;
    gap: 15px;
    align-items: center;
    color: white;
    max-width: 90vw;
    overflow-x: auto;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #555;
}

.status-indicator.active {
    background-color: #00ff00;
    box-shadow: 0 0 5px #00ff00;
}

.divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.2);
}

.tool-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 10px;
    border-radius: 10px;
    cursor: default; /* 主要是显示状态，不一定需要点击切换，因为手势会自动切换 */
    transition: all 0.3s;
    opacity: 0.5;
}

.tool-btn.active {
    background: rgba(255,255,255,0.1);
    opacity: 1;
}

.tool-btn .icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.tool-btn .label {
    font-size: 10px;
}

.action-btn {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: #b71c1c;
}

.color-picker-wrapper {
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
}

#color-picker {
    width: 200%;
    height: 200%;
    transform: translate(-25%, -25%);
    cursor: pointer;
    padding: 0;
    border: none;
}

.quick-colors {
    display: flex;
    gap: 5px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.5);
    cursor: pointer;
    transition: transform 0.2s;
}

.color-dot:hover {
    transform: scale(1.2);
}

.label-small {
    font-size: 12px;
    color: #aaa;
}

input[type="range"] {
    width: 80px;
}