/* ========================================
   REAI 稀土数据库 - 优化样式表
   ======================================== */

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color: #1a237e;
    --primary-light: #534bae;
    --primary-dark: #000051;
    
    /* 辅助色 */
    --secondary-color: #00bcd4;
    --secondary-light: #62efff;
    --secondary-dark: #008ba3;
    
    /* 强调色 */
    --accent-color: #ffa726;
    --accent-light: #ffd95b;
    --accent-dark: #c77800;
    
    /* 中性色 */
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    
    /* 稀土元素特殊色 */
    --rare-earth-color: #ff6b9d;
    --rare-earth-glow: rgba(255, 107, 157, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 认证页面样式 ========== */
/* ========== 认证页面样式 ========== */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* 认证页面内容包装器 - 用于居中登录/注册卡片 */
.auth-page .auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 80px 20px 20px 20px; /* 顶部留出header空间 */
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    animation: fadeInUp 0.6s ease;
}

.register-card {
    max-width: 500px;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    display: inline-block;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: rotate 20s linear infinite;
}

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

.logo-icon {
    font-size: 40px;
    color: white;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    font-size: 18px;
    z-index: 1;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--primary-light);
}

.poster-container {
    margin-top: 30px;
    text-align: center;
}

.poster-image {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.page-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}
/* ========== Dashboard 页面样式 ========== */
.dashboard-page {
    background: var(--bg-color);
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    font-size: 32px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header-title {
    font-size: 24px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.user-icon {
    font-size: 24px;
}

.username {
    font-weight: 600;
}

.btn-logout {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: white;
    color: var(--primary-color);
}

.dashboard-main {
    max-width: 1800px;
    margin: 0 auto;
    padding: 30px;
}

.section-card {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* ========== 元素周期表样式 ========== */
.legend-container {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.legend-color.lanthanide {
    background-color: rgba(255, 153, 204, 1.00);
}

.legend-color.actinide {
    background-color: rgba(255, 191, 255, 0.25);
}

#periodic-table {
    margin: 20px 0;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(18, 65px);
    grid-gap: 4px;
    justify-content: center;
    margin-top: 20px;
}

.grid-item {
    width: 65px;
    height: 65px;
}

.element {
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 6px;
    background-color: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.element:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    z-index: 10;
}

.element * {
    pointer-events: none;
}

.element .atomic-number {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 12px;
    font-weight: bold;
    color: #666;
}

.element .symbol {
    font-size: 22px;
    font-weight: bold;
    margin-top: 18px;
    display: block;
    color: #333;
}

/* 元素分类颜色 */
.alkali-metal {
    background: linear-gradient(135deg, rgba(255, 102, 102, 0.5), rgba(255, 102, 102, 0.7));
}

.alkaline-earth-metal {
    background: linear-gradient(135deg, rgba(255, 222, 173, 0.5), rgba(255, 222, 173, 0.7));
}

.actinide {
    background: linear-gradient(135deg, rgba(255, 191, 255, 0.4), rgba(255, 191, 255, 0.6));
}

.lanthanide {
    background: linear-gradient(135deg, rgba(255, 153, 204, 0.8), rgba(255, 153, 204, 1.0));
    border-color: var(--rare-earth-color);
    font-weight: 700;
}

.lanthanide:hover {
    box-shadow: 0 0 20px var(--rare-earth-glow);
}

.post-transition-metal {
    background: linear-gradient(135deg, rgba(204, 204, 204, 0.5), rgba(204, 204, 204, 0.7));
}

.metalloid {
    background: linear-gradient(135deg, rgba(204, 204, 153, 0.5), rgba(204, 204, 153, 0.7));
}

.nonmetal {
    background: linear-gradient(135deg, rgba(153, 204, 153, 0.5), rgba(153, 204, 153, 0.7));
}

.halogen {
    background: linear-gradient(135deg, rgba(192, 255, 255, 0.5), rgba(192, 255, 255, 0.7));
}

.noble-gas {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.5));
}

.transition-metal {
    background: linear-gradient(135deg, rgba(173, 216, 230, 0.5), rgba(173, 216, 230, 0.7));
}

.element.selected {
    outline: 4px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 15px rgba(26, 35, 126, 0.5);
    transform: scale(1.1);
}

/* ========== 搜索和表格样式 ========== */
.element-search-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    font-size: 18px;
}

#element-input {
    flex: 1;
    padding: 12px 12px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

#element-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.btn-search {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 188, 212, 0.4);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody tr,
tr.result-row,
.result-row {
    cursor: pointer !important;
    transition: all 0.2s ease;
}

tbody tr:hover,
tr.result-row:hover,
.result-row:hover {
    background-color: #f5f5f5 !important;
    transform: scale(1.002) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

tbody tr:nth-child(even),
tr.result-row:nth-child(even),
.result-row:nth-child(even) {
    background-color: #fafafa;
}

tbody tr:nth-child(even):hover,
tr.result-row:nth-child(even):hover,
.result-row:nth-child(even):hover {
    background-color: #f5f5f5 !important;
}

/* 分页样式 */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

#pagination button {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

#pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pagination input {
    width: 60px;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

/* 等待弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 40px;
    border-radius: 20px;
    width: 350px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content p {
    font-size: 18px;
    margin-bottom: 15px;
}

#timer {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 24px;
}

/* ========== Compound 页面样式 ========== */
.compound-page {
    background: var(--bg-color);
    min-height: 100vh;
}

.compound-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
}

.compound-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* 左侧边栏 */
.compound-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card, .control-card, .viewer-card {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* viewer-card 减小内边距 */
.viewer-card .card-body {
    padding: 10px;
}

/* info-card 确保内容不溢出 */
.info-card .card-body {
    padding: 15px;
    overflow: hidden;
}

/* 基本信息网格 */
.basic-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.info-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    min-width: 0;
    overflow: hidden;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 控制面板 */
.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.control-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-checkbox:hover {
    background: #e9ecef;
}

.control-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-item label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.control-select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.control-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--primary-light), var(--secondary-color));
    outline: none;
    cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 测量按钮 */
.measure-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 15px;   
}

.btn-measure {
    padding: 10px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-measure:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.3);
}

.btn-clear {
    font-size: 15px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn-clear:hover {
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.measure-panel {
    display: none;
    margin-top: 15px;
}

.measure-input-group {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.measure-input-group strong {
    color: var(--primary-color);
    font-size: 15px;
}

.measure-input-group input {
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
}

.btn-calc {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-calc:hover {
    background: var(--primary-light);
}

.measure-result {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary-color);
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-action {
    padding: 12px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.btn-action:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.download-group {
    display: flex;
    gap: 10px;
}

.download-group .control-select {
    flex: 1;
}

.download-group .btn-action {
    flex: 1;
}

/* 3D查看器 */
.compound-viewer-section {
    display: flex;
    flex-direction: column;
}

.viewer-container {
    position: relative;
    width: 100%;
    height: 700px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.viewer-3d {
    width: 100%;
    height: 100%;
    position: relative;
}

#viewer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.measure-instructions {
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 15px;
    color: #856404;
}

/* 属性选项卡 */
.properties-section {
    margin-top: 30px;
}

.tabs-container {
    margin-top: 20px;
}

.tabs-header {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    padding-bottom: 0;
}

.tab-button {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 17px;
}

.tab-button:hover {
    color: var(--primary-color);
    background: #f8f9fa;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #f0f7ff;
}

.tabs-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.property-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.property-table tr:first-child td {
    border-top: 1px solid var(--border-color);  /* 只添加这3行 */
}

.property-detail {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.property-label {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    width: 200px;           /* 新增:设置第一列宽度为300px */
    min-width: 200px;       /* 新增:确保最小宽度 */
    font-weight: 600;       /* 新增:加粗字体 */
    background: #f8f9fa;    /* 新增:背景色 */
    padding: 8px;          /* 新增:内边距 */
}

.property-value {
    font-size: 17px;
    font-weight: 450;
    color: var(--text-primary);
    word-break: break-all;
}

.property-table tr:hover {
    background: #f9fafb;  /* 鼠标悬停高亮 */
}

.property-description {
    margin-top: 10px;
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 详情表格 */
.compound-details {
    margin-top: 20px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.details-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-weight: 600;
    background: #f8f9fa;
    color: var(--primary-color);
    width: 350px;
    font-size: 16px;
}

.detail-value {
    color: var(--text-primary);
    font-size: 15px;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .compound-container {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 1200px) {
    .compound-container {
        grid-template-columns: 1fr;
    }
    
    .compound-sidebar {
        order: 2;
    }
    
    .compound-viewer-section {
        order: 1;
    }
}

@media (max-width: 768px) {
    .dashboard-main,
    .compound-main {
        padding: 15px;
    }
    
    .header-container {
        padding: 10px 15px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .grid-container {
        grid-template-columns: repeat(18, 50px);
        grid-gap: 2px;
    }
    
    .grid-item {
        width: 50px;
        height: 50px;
    }
    
    .element .symbol {
        font-size: 18px;
    }
}

/* 高级搜索表单样式 */
#aligned-container {
    width: 100%;
}

#search-form {
    max-width: 800px;
    margin: 0 auto;
}

.criterion {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.criterion select,
.criterion input[type="text"] {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.criterion select {
    width: 150px;
}

.criterion input[type="text"] {
    flex: 1;
}

.remove-criterion {
    width: 40px;
    height: 40px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-criterion:hover {
    background: #c0392b;
}

#add-criterion {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    display: block;
    margin: 15px auto;
    transition: all 0.3s ease;
}

#add-criterion:hover {
    background: var(--secondary-dark);
    transform: rotate(90deg);
}

#search-form button[type="submit"] {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: block;
    margin: 20px auto 0;
    transition: all 0.3s ease;
}

#search-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 35, 126, 0.4);
}

/* 过滤器样式 */
#filter-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

#filter-container label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#filter-container label:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

#filter-container input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#filter-container input[type="radio"]:checked + * {
    font-weight: 700;
}

/* ==========================================
   Compound Page v2.4 - 三栏布局样式
   ========================================== */

/* 主容器 - 三栏布局 */
.compound-main-v2 {
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: calc(100vh - 60px);
}

.compound-container-v2 {
    display: grid;
    grid-template-columns: 380px 1fr 280px;
    gap: 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* 左侧边栏 - 基本信息（窄） */
.compound-sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 中间区域 - 3D可视化（宽） */
.compound-viewer-center {
    display: flex;
    flex-direction: column;
}

/* 右侧边栏 - 3D控制面板（窄） */
.compound-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ==========================================
   3D Viewer 容器样式
   ========================================== */

.viewer-container-v2 {
    position: relative;
    width: 100%;
    height: 600px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.viewer-3d {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* ==========================================
   浮动操作按钮样式
   ========================================== */

.viewer-floating-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #667eea;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.floating-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.floating-btn:active {
    transform: translateY(0) scale(0.98);
}

.floating-btn i {
    transition: transform 0.3s ease;
}

.floating-btn:hover i {
    transform: scale(1.1);
}

/* 收藏按钮激活状态 */
.floating-btn.favorited {
    background: #ffd700;
    color: white;
}

.floating-btn.favorited i {
    font-weight: 900;
}

/* ==========================================
   下载菜单样式
   ========================================== */

.download-menu {
    position: absolute;
    top: 240px;
    right: 20px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 101;
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.download-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 140px;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
}

.download-option:hover {
    background: #667eea;
    color: white;
}

.download-option i {
    font-size: 16px;
}

/* ==========================================
   控制面板优化样式
   ========================================== */

.compound-sidebar-right .control-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.compound-sidebar-right .card-body {
    padding: 1.5rem;
    max-height: 620px;
    overflow-y: auto;
}

/* 滚动条样式 */
.compound-sidebar-right .card-body::-webkit-scrollbar {
    width: 6px;
}

.compound-sidebar-right .card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.compound-sidebar-right .card-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.compound-sidebar-right .card-body::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* 控制组样式优化 */
.control-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.control-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group-title i {
    font-size: 18px;
}

/* 复选框样式 */
.control-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 15px;
    color: #555;
    transition: color 0.2s ease;
}

.control-checkbox:hover {
    color: #667eea;
}

.control-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

/* 控制项样式 */
.control-item {
    margin-bottom: 1rem;
}

.control-item label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.control-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-select:hover {
    border-color: #667eea;
}

.control-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-slider::-webkit-slider-thumb:hover {
    background: #5568d3;
    transform: scale(1.2);
}

.control-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.slider-value {
    display: inline-block;
    margin-left: 8px;
    font-size: 15px;
    color: #888;
    font-weight: 500;
}

/* 测量按钮样式 */
.measure-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-measure {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #555;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-measure:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

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

.btn-measure.btn-clear {
    grid-column: span 2;
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.btn-measure.btn-clear:hover {
    background: #ee5a52;
    border-color: #ee5a52;
}

/* 测量输入面板 */
.measure-panel {
    margin-top: 1rem;
}

.measure-input-group {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.measure-input-group.active {
    display: flex;
}

.measure-input-group strong {
    font-size: 15px;
    color: #667eea;
    font-weight: 600;
}

.measure-inputs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.measure-inputs input {
    flex: 1;
    min-width: 50px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    text-align: center;
}

.measure-inputs input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-calc {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: #667eea;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-calc:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.measure-result {
    display: block;
    padding: 8px;
    background: white;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #667eea;
    text-align: center;
    min-height: 32px;
    line-height: 16px;
}

/* ==========================================
   响应式设计
   ========================================== */

@media (max-width: 1400px) {
    .compound-container-v2 {
        grid-template-columns: 260px 1fr 300px;
        gap: 1rem;
    }
    
    .viewer-container-v2 {
        height: 500px;
    }
}

@media (max-width: 1200px) {
    .compound-container-v2 {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .compound-sidebar-left,
    .compound-sidebar-right {
        max-width: 100%;
    }
    
    .viewer-container-v2 {
        height: 450px;
    }
    
    .viewer-floating-buttons {
        top: 15px;
        right: 15px;
    }
    
    .floating-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .compound-main-v2 {
        padding: 1rem;
    }
    
    .viewer-container-v2 {
        height: 350px;
    }
    
    .viewer-floating-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .floating-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .download-menu {
        top: 60px;
    }
}

/* ==========================================
   测量说明样式
   ========================================== */

.measure-instructions {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    color: #667eea;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 50;
    max-width: 300px;
    display: none;
}

.measure-instructions.active {
    display: block;
    animation: fadeInDown 0.3s ease;
}

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

/* ==========================================
   全屏模式样式
   ========================================== */

.viewer-container-v2.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
}

.viewer-container-v2.fullscreen .floating-btn {
    background: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   加载动画
   ========================================== */

.viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.viewer-loading i {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

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

.viewer-loading p {
    margin-top: 1rem;
    font-size: 14px;
    opacity: 0.9;
}
