* { margin: 0; padding: 0; box-sizing: border-box; } /* CSS变量 - 浅色主题 */ :root { --bg-color: #f5f5f5; --card-bg: #ffffff; --text-primary: #2d3748; --text-secondary: #4a5568; --border-color: #e2e8f0; --header-bg: #4a5568; --header-text: #ffffff; --primary-btn: #667eea; --primary-btn-hover: #5a67d8; --danger-btn: #e53e3e; --danger-btn-hover: #c53030; --nav-active: #667eea; --nav-text: #718096; } /* 深色主题 */ body.dark-theme { --bg-color: #1a202c; --card-bg: #2d3748; --text-primary: #f7fafc; --text-secondary: #e2e8f0; --border-color: #4a5568; --header-bg: #2d3748; --header-text: #ffffff; --primary-btn: #667eea; --primary-btn-hover: #5a67d8; --danger-btn: #fc8181; --danger-btn-hover: #f56565; --nav-active: #667eea; --nav-text: #a0aec0; } body { font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; } .phone-container { width: 375px; height: 812px; background: #ffffff; border-radius: 40px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); position: relative; overflow: hidden; border: 8px solid #000; } .screen { position: absolute; top: 0; left: 0; width: 100%; height: calc(100% - 60px); background: #f5f5f5; display: none; flex-direction: column; } .screen.active { display: flex; } header { background: #4a5568; color: white; padding: 20px; text-align: center; position: relative; } header h1 { font-size: 20px; font-weight: bold; } .back-btn { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); background: none; border: none; color: white; font-size: 24px; cursor: pointer; } main { flex: 1; padding: 20px; overflow-y: auto; } .canvas-container { position: relative; display: flex; justify-content: center; align-items: center; margin-bottom: 20px; } #avatarCanvas { border: 4px solid #e2e8f0; border-radius: 12px; background: white; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .canvas-overlay { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); } .customization-panel { background: white; border-radius: 12px; padding: 16px; margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); } .customization-panel h3 { margin-bottom: 16px; color: #2d3748; font-size: 16px; } .option-group { margin-bottom: 16px; } .option-group:last-child { margin-bottom: 0; } .option-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #4a5568; font-size: 14px; } .color-themes, .style-options, .detail-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; } .seed-input-group { display: flex; flex-direction: column; gap: 0.5rem; } .seed-input-group input { padding: 0.5rem; border: 1px solid var(--border-color); border-radius: 4px; background-color: var(--input-bg); color: var(--text-primary); font-size: 1rem; } .seed-input-group button.action-btn.small { padding: 0.375rem 0.75rem; font-size: 0.875rem; } .theme-btn, .style-btn, .detail-btn { padding: 8px 12px; border: 2px solid #e2e8f0; border-radius: 8px; background: white; cursor: pointer; font-size: 14px; transition: all 0.2s; } .theme-btn:hover, .style-btn:hover, .detail-btn:hover { background: #edf2f7; border-color: #cbd5e0; } .theme-btn.active, .style-btn.active, .detail-btn.active { background: #667eea; color: white; border-color: #667eea; } .bottom-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; } .action-btn { padding: 12px; border: none; border-radius: 8px; font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s; } .action-btn.primary { background: #667eea; color: white; } .action-btn.primary:hover { background: #5a67d8; } .action-btn:hover { background: #e2e8f0; } .action-btn.danger { background: #e53e3e; color: white; } .action-btn.danger:hover { background: #c53030; } .favorites-grid, .history-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; } .history-actions { display: flex; justify-content: center; padding: 1rem; gap: 1rem; } .favorite-item { position: relative; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.2s; } .favorite-item:hover { border-color: #667eea; transform: scale(1.05); } .favorite-item img { width: 100%; height: auto; display: block; } .remove-favorite { position: absolute; top: 4px; right: 4px; background: rgba(255, 0, 0, 0.8); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; cursor: pointer; display: flex; justify-content: center; align-items: center; } .settings-panel { background: white; border-radius: 12px; padding: 16px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); } .setting-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #e2e8f0; } .setting-item:last-child { border-bottom: none; } .setting-item label { font-weight: bold; color: #4a5568; } .setting-item select, .setting-item input { padding: 6px 10px; border: 2px solid var(--border-color); border-radius: 6px; font-size: 14px; background: var(--card-bg); color: var(--text-primary); } .bottom-nav { position: absolute; bottom: 0; left: 0; width: 100%; height: 60px; background: white; border-top: 1px solid #e2e8f0; display: flex; } .nav-btn { flex: 1; background: none; border: none; font-size: 14px; font-weight: bold; color: #718096; cursor: pointer; transition: all 0.2s; } .nav-btn:hover { background: #f7fafc; } .nav-btn.active { color: #667eea; border-top: 3px solid #667eea; } /* 响应式设计 */ @media (max-width: 400px) { .phone-container { width: 100%; height: 100vh; border-radius: 0; border: none; } body { padding: 0; } } /* 滚动条样式 */ main::-webkit-scrollbar { width: 4px; } main::-webkit-scrollbar-track { background: var(--border-color); } main::-webkit-scrollbar-thumb { background: var(--text-secondary); border-radius: 2px; } main::-webkit-scrollbar-thumb:hover { background: var(--text-primary); } /* 编辑界面样式 */ .edit-tools { background: var(--card-bg); border-radius: 12px; padding: 16px; margin-top: 20px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); } #colorPicker { width: 100%; height: 40px; border: 2px solid var(--border-color); border-radius: 6px; cursor: pointer; } .tool-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .tool-btn { padding: 8px 12px; border: 2px solid var(--border-color); border-radius: 8px; background: var(--card-bg); color: var(--text-primary); cursor: pointer; font-size: 14px; transition: all 0.2s; } .tool-btn:hover { background: var(--border-color); border-color: var(--primary-btn); } .tool-btn.active { background: var(--primary-btn); color: white; border-color: var(--primary-btn); } .edit-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; } /* 编辑画布样式 */ #editCanvas { border: 4px solid var(--border-color); border-radius: 12px; background: white; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); cursor: crosshair; }