* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.property-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.property-selector label {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.property-select {
    background: white;
    border: 2px solid white;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.property-select:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.property-select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.control-btn.active {
    background: white;
    color: #667eea;
}

main {
    padding: 40px 20px;
    background: #f8f9fa;
}

.periodic-table {
    display: grid;
    gap: 3px;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.element-cell {
    position: relative;
    width: 70px;
    height: 80px;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.empty-cell {
    visibility: hidden;
    width: 70px;
    height: 80px;
}

.element-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: #667eea;
}

.element-cell.radioactive {
    border: 3px solid #ff6b6b;
    animation: pulse 2s infinite;
}

.element-cell.radioactive::after {
    content: '☢';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 14px;
    color: #ff6b6b;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 107, 107, 0);
    }
}

.element-number {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 10px;
    font-weight: bold;
    color: #666;
}

.element-symbol {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-top: 8px;
}

.element-name {
    font-size: 9px;
    color: #666;
    margin-top: 2px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.element-detail {
    position: fixed;
    top: 0;
    right: 0;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    padding: 30px;
}

.element-detail.hidden {
    transform: translateX(100%);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #ee5a52;
    transform: rotate(90deg);
}

#detailContent {
    margin-top: 20px;
}

.detail-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.detail-symbol {
    font-size: 72px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.detail-name {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.detail-number {
    font-size: 18px;
    color: #666;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.electron-config {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.electron-config-visual {
    margin: 20px 0;
    text-align: center;
}

.electron-shell {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.shell-label {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 16px;
}

.subshells {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.subshell {
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: 1px solid #90caf9;
}

.properties-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.property-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.property-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.property-value {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

footer {
    background: #f8f9fa;
    padding: 30px;
    border-top: 2px solid #e9ecef;
}

.legend h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.legend-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.legend-item.active {
    background: #e3f2fd;
    border: 2px solid #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.legend-item.active h4 {
    color: #667eea;
    font-weight: bold;
}

.legend-item h4 {
    font-size: 14px;
    color: #667eea;
    margin-bottom: 10px;
}

.legend-color-scale {
    height: 20px;
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-range {
    font-size: 11px;
    color: #666;
}

.legend-radioactive {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff5f5;
    border-radius: 6px;
    border: 2px solid #ff6b6b;
}

.radioactive-icon {
    font-size: 24px;
    color: #ff6b6b;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .element-cell {
        width: 60px;
        height: 70px;
        font-size: 11px;
    }
    
    .element-symbol {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .element-detail {
        width: 100%;
    }
    
    .element-cell {
        width: 50px;
        height: 60px;
        font-size: 10px;
    }
    
    .element-symbol {
        font-size: 16px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
}


