/* 元素周期表样式 */

.periodic-container {
    max-width: 1400px;
    margin: 0 auto;
}

.periodic-controls {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.periodic-table {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.periodic-main {
    min-width: 900px;
}

.periodic-cell {
    aspect-ratio: 1;
    min-width: 45px;
    min-height: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 2px;
}

.periodic-cell.empty {
    background: transparent;
    cursor: default;
}

.periodic-cell.element {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.periodic-cell.element:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.element-number {
    font-size: 0.6rem;
    position: absolute;
    top: 2px;
    left: 4px;
    opacity: 0.8;
}

.element-symbol {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.element-name {
    font-size: 0.55rem;
    margin-top: 1px;
    opacity: 0.9;
}

/* 镧系锕系行 */
.lanthanides-row,
.actinides-row {
    margin-top: 10px;
    display: flex;
    gap: 2px;
    align-items: center;
}

.series-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
    padding-right: 8px;
}

.lanthanides-row .periodic-cell,
.actinides-row .periodic-cell {
    min-width: 40px;
    min-height: 40px;
    font-size: 0.9rem;
}

/* 元素详情 */
.element-detail {
    margin-top: 1.5rem;
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    max-width: 400px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-symbol {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.detail-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-body {
    display: grid;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
}

/* 元素类别颜色 */
.periodic-cell.alkali { background: #ff6b6b !important; }
.periodic-cell.alkaline { background: #ffa94d !important; }
.periodic-cell.transition { background: #ffd43b !important; color: #333 !important; }
.periodic-cell.metal { background: #69db7c !important; color: #333 !important; }
.periodic-cell.metalloid { background: #4dabf7 !important; }
.periodic-cell.nonmetal { background: #748ffc !important; }
.periodic-cell.halogen { background: #cc5de8 !important; }
.periodic-cell.noble { background: #f06595 !important; }
.periodic-cell.lanthanide { background: #20c997 !important; }
.periodic-cell.actinide { background: #38d9a9 !important; }

/* 图例 */
.periodic-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* 教学表格 */
.demo-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.demo-table th,
.demo-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.demo-table th {
    background: var(--primary-color);
    color: white;
}

.demo-table tr:last-child td {
    border-bottom: none;
}

/* 计算器表格 */
.calc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.calc-table th,
.calc-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.calc-table th {
    background: var(--background);
    font-weight: 500;
}

.result-grid {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.result-summary {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius);
    text-align: center;
    font-size: 1.1rem;
}

/* 演示步骤样式 */
.demo-step {
    animation: stepFadeIn 0.3s ease;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.step-body {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.step-equation {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.25rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.success-message {
    color: var(--success-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* 反馈样式 */
.feedback-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: var(--radius);
}

.feedback-icon {
    font-size: 2rem;
}

.feedback-card.correct .feedback-icon {
    color: var(--success-color);
}

.feedback-card.wrong .feedback-icon {
    color: var(--danger-color);
}

.feedback-text strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feedback-text p {
    margin: 0.25rem 0;
}

.feedback-text .hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 箭头样式 */
.arrow-up {
    color: #f44336;
}

.arrow-down {
    color: #2196F3;
}

/* 提示样式 */
.hint {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .periodic-cell {
        min-width: 35px;
        min-height: 35px;
    }
    
    .element-symbol {
        font-size: 0.9rem;
    }
    
    .element-name {
        display: none;
    }
    
    .element-number {
        font-size: 0.5rem;
    }
}

@media (max-width: 768px) {
    .periodic-table {
        padding: 0.75rem;
    }
    
    .periodic-cell {
        min-width: 28px;
        min-height: 28px;
    }
    
    .element-symbol {
        font-size: 0.75rem;
    }
    
    .element-number {
        display: none;
    }
}
