/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #1a2a6c, #2c3e50);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* 应用包装器 */
.app-wrapper {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 应用头部 */
.app-header {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.app-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* 应用容器 */
.app-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

/* 绘图画板面板 */
.drawing-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.tool-group, .action-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tool-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

/* 画布容器 */
.canvas-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#drawing-board {
    width: 100%;
    height: 500px;
    display: block;
    background: white;
    cursor: crosshair;
}

/* 画布边框 */
.canvas-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.frame-corner {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255, 255, 255, 0.7);
}

.top-left {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}

.top-right {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
}

.bottom-left {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
}

.bottom-right {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}

/* 使用说明面板 */
.instructions-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.instructions-list {
    list-style: none;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.instruction-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.instruction-icon {
    font-size: 1.5rem;
}

.instruction-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* 应用底部 */
.app-footer {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 模板选择器 */
.template-select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.template-select:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.template-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-wrapper {
        margin: 10px;
        border-radius: 15px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .app-subtitle {
        font-size: 1rem;
    }
    
    .app-container {
        padding: 15px;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: center;
    }
    
    .tool-group, .action-group {
        width: 100%;
        justify-content: center;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    #drawing-board {
        height: 400px;
    }
    
    .frame-corner {
        width: 20px;
        height: 20px;
    }
    
    .top-left {
        top: 10px;
        left: 10px;
    }
    
    .top-right {
        top: 10px;
        right: 10px;
    }
    
    .bottom-left {
        bottom: 10px;
        left: 10px;
    }
    
    .bottom-right {
        bottom: 10px;
        right: 10px;
    }
    
    .panel-title {
        font-size: 1.5rem;
    }
    
    .instruction-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .app-wrapper {
        border-radius: 10px;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
    
    .app-header {
        padding: 15px;
    }
    
    .app-container {
        padding: 10px;
    }
    
    .drawing-panel, .instructions-panel {
        padding: 15px;
    }
    
    .tool-group, .action-group {
        flex-direction: column;
        width: 100%;
    }
    
    .tool-item {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 10px;
    }
    
    #drawing-board {
        height: 300px;
    }
    
    .instruction-item {
        padding: 10px;
        gap: 10px;
    }
    
    .instruction-icon {
        font-size: 1.2rem;
    }
    
    .instruction-text {
        font-size: 0.9rem;
    }
}