/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
}

.header h1 i {
    color: #3498db;
    margin-right: 0.5rem;
}

.header-controls {
    display: flex;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #e0a800);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    color: white;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 1rem;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 工具栏样式 */
.toolbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    height: fit-content;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.tool-section {
    margin-bottom: 2rem;
}

.tool-section h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.tool-section h3 i {
    color: #3498db;
    margin-right: 0.5rem;
}

/* 原子调色板 */
.atom-palette {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.atom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
}

.atom-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.8);
}

.atom-item.selected {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.atom-sphere {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-bottom: 0.3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.atom-item span {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
}

/* 化学键工具 */
.bond-tools {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bond-btn {
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #2c3e50;
}

.bond-btn:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.bond-btn.active {
    background: #3498db;
    color: white;
}

/* 预设分子 */
.preset-molecules {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.preset-btn {
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preset-btn:hover {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    transform: translateY(-2px);
}

.preset-btn span {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.preset-btn small {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.2rem;
}

/* 画布区域 */
.canvas-area {
    display: flex;
    flex-direction: column;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#molecular-canvas {
    display: block;
    cursor: crosshair;
    background: #f8f9fa;
    border-radius: 12px;
}

.canvas-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    pointer-events: none;
}

.info-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 250px;
}

.info-panel h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.info-panel p {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 属性面板 */
.properties-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    height: fit-content;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.property-section {
    margin-bottom: 2rem;
}

.property-section h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.property-section h3 i {
    color: #3498db;
    margin-right: 0.5rem;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.property-item:last-child {
    border-bottom: none;
}

.property-item label {
    font-weight: 500;
    color: #2c3e50;
}

.property-item span {
    color: #7f8c8d;
    font-weight: 600;
}

/* 显示选项 */
.display-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.8rem;
    transform: scale(1.2);
    cursor: pointer;
}

/* 视觉控制 */
.visual-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
}

.control-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ecf0f1;
    outline: none;
    cursor: pointer;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.action-buttons .btn {
    justify-content: center;
    padding: 0.8rem;
}

/* 状态栏 */
.status-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 280px 1fr 260px;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .toolbar,
    .properties-panel {
        order: 2;
        max-height: 300px;
    }
    
    .canvas-area {
        order: 1;
        min-height: 400px;
    }
    
    .atom-palette {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .preset-molecules {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 拖拽状态 */
.dragging {
    opacity: 0.7;
    transform: scale(1.1);
    z-index: 1000;
    pointer-events: none;
}

/* 高亮状态 */
.highlight {
    border-color: #f39c12 !important;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5) !important;
}

/* 加载状态 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 