:root {
    --bg-dark: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #e0e0e0;
    --accent-cyan: #00f3ff;
    --accent-pink: #ff00aa;
    --valence-color: #ff0055;
    --inner-color: #00a8ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-animation {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background:
        radial-gradient(circle at 50% 50%, rgba(20, 30, 50, 0.5) 0%, transparent 50%),
        linear-gradient(0deg, rgba(0,243,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,243,255,0.03) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
}

/* === 导航栏区域 === */
.control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    margin-bottom: 15px;
    z-index: 100;
    width: 100%;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
}

.title-box h1 {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #fff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.github-silent-link {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.3s, opacity 0.3s;
  z-index: 10;
}
.github-silent-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.mode-group {
    display: flex;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #aaa;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.mode-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.mode-btn.active {
    background: var(--accent-cyan);
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.language-toggle {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 8px 0;
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #aaa;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.lang-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.lang-btn.active {
    background: var(--accent-cyan);
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.search-box {
    width: 100%;
    max-width: 280px;
}

.search-box input {
    background: rgba(0,0,0,0.3);
    border: 1px solid #444;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    outline: none;
    width: 100%;
    font-size: 14px;
}

/* === 周期表容器 === */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
}

.periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 68px);
    grid-template-rows: repeat(10, 76px);
    gap: 5px;
    margin: 0 auto 30px;
    transition: 0.5s;
    width: max-content;
}

.element {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2px;
    opacity: 0;
    transform: scale(0.8);
}

.element.visible { opacity: 1; transform: scale(1); }

.element:hover {
    transform: scale(1.15) !important;
    z-index: 100;
    box-shadow: 0 0 25px rgba(0,0,0,0.8);
    border-color: #fff;
}

.element .atomic-number {
    position: absolute;
    top: 4px;
    left: 5px;
    font-size: 10px;
    opacity: 0.6;
}

.element .symbol {
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.1;
    margin-top: 4px;
    font-family: Arial, sans-serif;
}

.element .name {
    font-size: 11px;
    opacity: 0.95;
    margin-top: 0px;
    font-weight: 500;
}

.element .detail-val {
    position: absolute; bottom: 3px; right: 5px;
    font-size: 9px;
    color: var(--accent-cyan);
    display: none;
    font-weight: bold;
}

.element.placeholder {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.01);
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.element.placeholder .range-num {
    font-size: 11px;
    color: var(--accent-cyan);
    font-weight: bold;
}

.element.placeholder .name {
    font-size: 11px;
    opacity: 0.8;
    margin: 0;
}

.element.placeholder:hover {
    background: rgba(255, 255, 255, 0.08);
    border-style: solid;
    transform: scale(1.05) !important;
}

.periodic-table.heatmap-active .element {
    border-color: rgba(0,0,0,0.2);
}
.periodic-table.heatmap-active .element .detail-val { display: block; }

/* === 图例区域 === */
.legend-wrapper {
    width: 100%;
    padding: 0 10px;
    margin-bottom: 15px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 1000px;
    margin: 0 auto;
}

.legend-item {
    font-size: 12px;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 15px;
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.3s;
}

.legend-item:hover { background: rgba(255,255,255,0.1); }
.legend-item.active {
    background: rgba(255,255,255,0.2);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.legend-color { width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; flex-shrink: 0; }

/* === 弹窗样式 === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.3s;
    padding: 10px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.hologram-card {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1a20, #0a0a10);
    border: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 60px rgba(0, 243, 255, 0.1);
    border-radius: 16px;
    display: flex;
    overflow: hidden;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    z-index: 2000;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}
.close-btn:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: rotate(90deg);
}

.atom-visualizer {
    width: 30%;
    min-width: 250px;
    background: radial-gradient(circle at center, rgba(0,243,255,0.05), transparent 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 800px;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: relative;
    cursor: grab;
    user-select: none;
}

.atom-visualizer:active { cursor: grabbing; }

.expand-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 36px;
    height: 36px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    color: var(--accent-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.expand-btn:hover {
    background: rgba(0, 243, 255, 0.2);
    border-color: var(--accent-cyan);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.expand-btn svg { width: 18px; height: 18px; }

.visualizer-hint {
    position: absolute;
    bottom: 15px;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    pointer-events: none;
}

.atom-container {
    width: 200px; height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
}

.nucleus {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 12px; height: 12px; background: #fff; border-radius: 50%;
    box-shadow: 0 0 20px #fff; z-index: 20;
    transform-style: preserve-3d;
}

.orbit-ring {
    position: absolute; top: 50%; left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    transform-style: preserve-3d;
}

.electron {
    position: absolute; top: 50%; left: 50%;
    border-radius: 50%;
    transform-origin: 0 0;
}

.electron.inner {
    width: 5px; height: 5px;
    background: var(--inner-color);
    box-shadow: 0 0 5px var(--inner-color);
}

.electron.valence {
    width: 8px; height: 8px;
    background: var(--valence-color);
    box-shadow: 0 0 12px var(--valence-color);
    z-index: 10;
}

.electron.expanded.inner {
    width: 8px; height: 8px;
    box-shadow: 0 0 10px var(--inner-color);
}

.electron.expanded.valence {
    width: 12px; height: 12px;
    box-shadow: 0 0 20px var(--valence-color);
}

/* === 信息面板 === */
.info-panel {
    flex: 1;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}

.header-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-right: 40px;
}

.big-symbol {
    font-size: 52px;
    font-weight: 700;
    color: var(--accent-cyan);
    line-height: 1;
    font-family: Arial, sans-serif;
}

.header-details {
    flex: 1;
    min-width: 0;
}

.big-name {
    font-size: 22px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 8px;
}

.en-name {
    font-size: 14px;
    color: #888;
    margin-left: 8px;
    font-weight: normal;
}

.header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag, .phase-tag, .block-tag {
    padding: 4px 10px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
}

.phase-tag {
    background: rgba(255,255,255,0.05);
}

.block-tag {
    background: rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.3);
    color: var(--accent-cyan);
    font-weight: bold;
}

/* === 简介 === */
.summary-box {
    background: rgba(255,255,255,0.02);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid rgba(0, 243, 255, 0.3);
}

.summary-box p {
    font-size: 13px;
    line-height: 1.6;
    color: #bbb;
}

/* === 标签页导航 === */
.tab-nav {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #888;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.3s;
    font-weight: 500;
}

.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.tab-btn.active {
    background: var(--accent-cyan);
    color: #000;
    font-weight: bold;
}

/* === 标签页内容 === */
.tab-content {
    flex: 1;
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* === 信息区块 === */
.info-section {
    margin-bottom: 18px;
}

.info-section h3 {
    font-size: 12px;
    color: var(--accent-cyan);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 5px;
}

/* === 电子排布 === */
.config-box {
    background: rgba(0, 243, 255, 0.05);
    padding: 12px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.config-text {
    font-size: 14px;
    color: #e0e0e0;
    letter-spacing: 1px;
    word-break: break-all;
    line-height: 1.5;
}

.config-semantic {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.config-shell {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* === 属性网格 === */
.props-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.props-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.prop-item {
    background: rgba(255,255,255,0.02);
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid rgba(0, 243, 255, 0.3);
}

.prop-item label {
    font-size: 10px;
    color: #888;
    display: block;
    margin-bottom: 3px;
}

.prop-item span {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

/* === 化合价标签 === */
.valence-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.valence-tag {
    background: linear-gradient(135deg, rgba(255,0,85,0.2), rgba(255,0,170,0.1));
    border: 1px solid rgba(255,0,85,0.4);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 14px;
    color: #ff6699;
    font-weight: 600;
}

/* === 同位素标签 === */
.isotope-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.isotope-tag {
    background: rgba(0, 168, 255, 0.1);
    border: 1px solid rgba(0, 168, 255, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #66ccff;
}

.isotope-tag .mass-num {
    font-size: 9px;
    vertical-align: super;
}

.isotope-stable {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
    color: #66ff99;
}

/* === 外观文本 === */
.appearance-text {
    font-size: 14px;
    color: #ccc;
    line-height: 1.5;
}

/* === 电离能列表 === */
.ionization-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.ionization-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
}

.ion-label {
    font-size: 12px;
    color: #888;
}

.ion-value {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

/* === 历史信息 === */
.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.history-item label {
    font-size: 12px;
    color: #888;
}

.history-item span {
    font-size: 13px;
    color: #fff;
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 6px;
    transition: 0.3s;
}

.source-link:hover {
    background: rgba(0, 243, 255, 0.2);
}

/* === 媒体加载按钮 === */
.media-container {
    min-height: 100px;
}

.load-media-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 25px;
    background: rgba(255,255,255,0.02);
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    transition: 0.3s;
}

.load-media-btn:hover {
    background: rgba(0, 243, 255, 0.05);
    border-color: rgba(0, 243, 255, 0.3);
    color: var(--accent-cyan);
}

.load-media-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.load-media-btn.disabled:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.1);
    color: #888;
}

.load-media-btn.loading {
    pointer-events: none;
    border-color: rgba(0, 243, 255, 0.5);
    color: var(--accent-cyan);
}

.load-media-btn.loading svg {
    animation: spin 1s linear infinite;
}

.load-media-btn.error {
    border-color: rgba(255, 100, 100, 0.4);
    color: #ff6666;
    cursor: not-allowed;
}

.load-media-btn.error:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255, 100, 100, 0.4);
    color: #ff6666;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.image-display {
    text-align: center;
}

.image-display img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0,0,0,0.2);
}

.image-caption {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    line-height: 1.4;
}

.model-viewer {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
}

.no-data {
    color: #666;
    font-size: 13px;
}

/* === 放大原子视图弹窗 === */
.expanded-atom-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.expanded-atom-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.expanded-atom-card {
    width: 90vw;
    height: 90vh;
    max-width: 900px;
    max-height: 700px;
    background: linear-gradient(135deg, #0a0a15, #151520);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 
        0 0 80px rgba(0, 243, 255, 0.15),
        inset 0 0 60px rgba(0, 243, 255, 0.02);
}

.expanded-atom-header {
    padding: 20px 60px 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.expanded-atom-symbol {
    font-size: 42px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    color: var(--accent-cyan);
}

.expanded-atom-name {
    font-size: 20px;
    color: #888;
}

.expanded-atom-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    cursor: grab;
    user-select: none;
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.03), transparent 60%);
    position: relative;
    overflow: hidden;
}

.expanded-atom-wrapper:active { cursor: grabbing; }

.expanded-atom-container {
    width: 500px;
    height: 500px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
}

.expanded-atom-container .nucleus {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 40px #fff, 0 0 80px rgba(255, 255, 255, 0.5);
}

.expanded-atom-container .orbit-ring {
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.2);
}

.expanded-atom-info {
    padding: 15px 25px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

.shell-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.shell-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.shell-legend-item.valence {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid rgba(255, 0, 85, 0.3);
    color: #ff6699;
}

.shell-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.shell-dot.inner {
    background: var(--inner-color);
    box-shadow: 0 0 6px var(--inner-color);
}

.shell-dot.valence {
    background: var(--valence-color);
    box-shadow: 0 0 8px var(--valence-color);
}

.expanded-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* === 移动端横屏提示 === */
.rotate-hint {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(0, 243, 255, 0.1);
    border-bottom: 1px solid var(--accent-cyan);
    padding: 8px 15px;
    text-align: center;
    font-size: 12px;
    color: var(--accent-cyan);
    z-index: 99;
}

/* === 平板适配 === */
@media(max-width: 900px) {
    .hologram-card {
        flex-direction: column;
        max-height: 95vh;
    }
    .atom-visualizer {
        width: 100%;
        min-width: auto;
        height: 180px;
        border-right: none;
        border-bottom: 1px solid #333;
        flex-shrink: 0;
    }
    .atom-container { width: 160px; height: 160px; }
    .props-grid { grid-template-columns: repeat(2, 1fr); }
    .props-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .info-panel { padding: 15px 20px; }
    .big-symbol { font-size: 40px; }
    .big-name { font-size: 18px; }
    
    .expanded-atom-card { width: 95vw; height: 85vh; }
    .expanded-atom-container { width: 350px; height: 350px; }
}

/* === 手机端适配 === */
@media(max-width: 600px) {
    .rotate-hint { display: block; }
    
    .control-panel {
        padding: 10px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .title-box { text-align: center; }
    .title-box h1 { font-size: 18px; }
    
    .mode-group { justify-content: center; padding: 3px; gap: 3px; }
    .mode-btn { padding: 6px 8px; font-size: 11px; }
    
    .search-box { max-width: 100%; }
    .search-box input { padding: 12px 15px; font-size: 16px; }
    
    .table-wrapper { padding: 5px; }
    
    .periodic-table {
        grid-template-columns: repeat(18, 52px);
        grid-template-rows: repeat(10, 60px);
        gap: 3px;
    }
    
    .element .atomic-number { font-size: 8px; top: 2px; left: 3px; }
    .element .symbol { font-size: 18px; margin-top: 2px; }
    .element .name { font-size: 9px; }
    .element .detail-val { font-size: 7px; bottom: 2px; right: 3px; }
    .element:hover { transform: scale(1.1) !important; }
    
    .legend-wrapper { padding: 0 5px; margin-bottom: 10px; }
    .legend { gap: 5px; }
    .legend-item { font-size: 10px; padding: 5px 8px; }
    .legend-color { width: 8px; height: 8px; margin-right: 4px; }
    
    .modal-overlay { padding: 0; align-items: flex-end; }
    
    .hologram-card {
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 16px 16px 0 0;
    }
    
    .close-btn {
        top: 10px; right: 10px;
        width: 40px; height: 40px;
        background: rgba(0,0,0,0.8);
    }
    
    .expand-btn { top: 10px; left: 10px; width: 32px; height: 32px; }
    .expand-btn svg { width: 16px; height: 16px; }
    
    .atom-visualizer { height: 160px; min-height: 160px; }
    .atom-container { width: 140px; height: 140px; }
    .visualizer-hint { font-size: 11px; bottom: 8px; }
    
    .info-panel {
        padding: 12px 15px;
        padding-bottom: 80px;
    }
    
    .header-row { margin-bottom: 10px; padding-bottom: 10px; gap: 10px; padding-right: 0; }
    .big-symbol { font-size: 36px; }
    .big-name { font-size: 16px; margin-bottom: 6px; }
    .en-name { font-size: 12px; }
    .header-meta { gap: 5px; }
    .category-tag, .phase-tag, .block-tag { font-size: 10px; padding: 3px 8px; }
    
    .summary-box { padding: 10px 12px; margin-bottom: 12px; }
    .summary-box p { font-size: 12px; }
    
    .tab-nav { margin-bottom: 12px; }
    .tab-btn { padding: 6px 8px; font-size: 11px; }
    
    .info-section { margin-bottom: 15px; }
    .info-section h3 { font-size: 11px; margin-bottom: 8px; }
    
    .config-box { padding: 10px 12px; }
    .config-text { font-size: 12px; }
    
    .props-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .props-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .prop-item { padding: 6px 8px; }
    .prop-item label { font-size: 9px; }
    .prop-item span { font-size: 12px; }
    
    .valence-tags, .isotope-tags { gap: 6px; }
    .valence-tag { font-size: 12px; padding: 3px 10px; }
    .isotope-tag { font-size: 10px; padding: 3px 8px; }
    
    .load-media-btn { padding: 20px; }
    .model-viewer { height: 220px; }
    
    .expanded-atom-card {
        width: 100%; height: 100dvh;
        max-width: none; max-height: none;
        border-radius: 0;
    }
    .expanded-atom-header { padding: 15px 50px 15px 15px; }
    .expanded-atom-symbol { font-size: 32px; }
    .expanded-atom-name { font-size: 16px; }
    .expanded-atom-container { width: 280px; height: 280px; }
    .expanded-atom-info { padding: 12px 15px 20px; flex-direction: column; gap: 10px; }
    .shell-legend { gap: 8px; }
    .shell-legend-item { font-size: 11px; padding: 3px 8px; }
}

/* === 超小屏幕 === */
@media(max-width: 400px) {
    .periodic-table {
        grid-template-columns: repeat(18, 44px);
        grid-template-rows: repeat(10, 52px);
        gap: 2px;
    }
    .element .atomic-number { font-size: 7px; }
    .element .symbol { font-size: 15px; }
    .element .name { font-size: 8px; }
    .mode-btn { padding: 5px 6px; font-size: 10px; }
    .legend-item { font-size: 9px; padding: 4px 6px; }
    .props-grid { grid-template-columns: 1fr; }
    .props-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .expanded-atom-container { width: 240px; height: 240px; }
}

/* === 横屏模式 === */
@media(max-height: 500px) and (orientation: landscape) {
    .rotate-hint { display: none; }
    .control-panel { padding: 8px 15px; flex-direction: row; }
    
    .hologram-card {
        flex-direction: row;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .atom-visualizer { width: 30%; height: 100%; min-width: 180px; }
    .info-panel { padding: 12px 15px; }
    .header-row { margin-bottom: 8px; padding-bottom: 8px; }
    .big-symbol { font-size: 28px; }
    .big-name { font-size: 14px; }
    .summary-box { margin-bottom: 10px; padding: 8px 10px; }
    .tab-nav { margin-bottom: 10px; }
    .info-section { margin-bottom: 10px; }
    .props-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    
    .expanded-atom-card {
        flex-direction: row;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .expanded-atom-container { width: 300px; height: 300px; }
}
