/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
header {
    text-align: center;
    padding: 30px 0 20px;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #00d4ff, #00ff88, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #888;
    font-size: 1.1rem;
}

/* 步骤卡片 */
.step {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00d4ff, #00ff88);
    color: #0f0f23;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.step-title {
    font-size: 1.2rem;
    font-weight: 600;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

.upload-area.dragover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.upload-content p {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.upload-content small {
    color: #666;
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* 下拉选择框 */
.select-input {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 140px;
}

.select-input:focus {
    outline: none;
    border-color: #00ff88;
}

.select-input option {
    background: #1a1a3e;
    color: #e0e0e0;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    color: #0f0f23;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.checkbox-label input {
    accent-color: #00ff88;
    width: 16px;
    height: 16px;
}

/* 编辑器容器 */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
}

@media (max-width: 900px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
}

.canvas-wrapper {
    background: #111;
    border-radius: 12px;
    padding: 10px;
    overflow: auto;
    max-height: 70vh;
}

#canvas {
    display: block;
    max-width: 100%;
    cursor: crosshair;
    border-radius: 8px;
}

/* 角点信息 */
.corner-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
}

.corner-info h4 {
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #aaa;
}

.corner-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.corner-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.corner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.coord-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

.coord-input:focus {
    outline: none;
    border-color: #00ff88;
}

/* 导出表单 */
.export-form {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #888;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #00ff88;
}

.export-actions {
    display: flex;
    gap: 10px;
}

/* 预览区域 */
.preview-area {
    margin-top: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.preview-area h4 {
    margin-bottom: 12px;
    color: #aaa;
}

.preview-area img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    background-image:
        linear-gradient(45deg, #333 25%, transparent 25%),
        linear-gradient(-45deg, #333 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #333 75%),
        linear-gradient(-45deg, transparent 75%, #333 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: #555;
    font-size: 0.9rem;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    margin-top: 16px;
    color: #aaa;
}