/* 合并后的CSS样式 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #f8f9fa;
    --primary-blue: #005bac;
    --secondary-blue: #0077cc;
    --light-blue: #e6f2ff;
    --dark-blue: #003d7a;
    --accent-green: #00a896;
    --accent-orange: #ff6b35;
    --accent-purple: #6a4c93;
    --accent-teal: #118ab2;
    --accent-cyan: #06d6a0;
    --accent-red: #e63946;
    --text-dark: #333;
    --text-light: #f8f9fa;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s ease;
    font-size: clamp(14px, 2vw, 16px);
}
/* 最大化视图样式 */
.maximized-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    padding: 30px;
    box-sizing: border-box;
}

.maximized-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 20px;
}

.maximized-header h3 {
    font-size: 1.8rem;
}

.close-btn {
    background: rgba(248, 249, 251, 0.96);
    border: 1px solid rgba(107, 114, 128, 0.28);
    color: #6b7280;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.12);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f1f3f5;
    border-color: rgba(107, 114, 128, 0.45);
    color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}

.maximized-content {
    display: flex;
    height: calc(100vh - 100px);
    gap: 30px;
}

.max-right-panel {
    display: flex;
    flex-direction: column;
    flex: 0.7; /* 右侧面板整体宽度 */
    gap: 20px;
}

/* 修改1：修复3D视图显示问题 */
.max-3d-view {
    flex: 2; /* 调整3D视图宽度比例 */
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    padding: 0; /* 移除内边距避免溢出 */
    height: 100%;
    min-height: 500px;
    position: relative; /* 添加定位上下文 */
}

/* 新增：确保3D内容填满容器 */
.max-3d-view > div {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* 修改2：增加2D视图宽度比例 */
.max-2d-view {
    flex: 2; /* 显著增加2D视图宽度 */
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: var(--shadow);
}

.max-2d-view img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* 修改3：增加属性区域宽度比例 */
.max-properties {
    flex: 3; /* 调整属性区域宽度比例 */
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.max-properties .properties-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.max-properties .property-item {
    padding: 10px;
    min-height: 74px;
}

.max-properties .property-label {
    font-size: 0.75rem;
    margin-bottom: 6px;
}

.max-properties .property-value {
    font-size: 0.9rem;
}

.maximize-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(248, 249, 251, 0.96);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.28);
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.12);
    transition: all 0.2s ease;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.maximize-btn:hover {
    background: #f1f3f5;
    border-color: rgba(107, 114, 128, 0.45);
    color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}

.maximize-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.1;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .maximized-content {
        flex-direction: column;
    }
    .max-3d-view, .max-2d-view, .max-properties {
        flex: none;
        width: 100%;
        height: auto;
    }
    .max-3d-view {
        height: 50vh;
    }
    .max-2d-view {
        height: 40vh;
    }
    .max-properties {
        height: 60vh;
    }
}

/* 添加链接交互效果 */
.card-link {
    cursor: pointer; /* 确保鼠标变为手型 */
    transition: all 0.3s ease !important; /* 强制过渡效果 */
}

/* 从HTML迁移的样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff, #e1eeff);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
}

/* Page Title */
.page-title {
    text-align: center;
    margin: 2rem auto;
    position: relative;
    color: var(--dark-blue);
}

.page-title h1 {
    font-size: 2.5rem;
    font-weight: 800;
    display: inline-block;
    padding: 0 20px;
}

.page-title h1::after {
    display: none;
}

.page-title p {
    font-size: 1.3rem;
    margin-top: 30px;
    color: var(--primary-blue);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Main Content */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 40px 50px;
}

.panel-layout {
    display: grid;
    grid-template-columns: minmax(300px, 420px) 1fr;
    gap: clamp(15px, 3vw, 30px);
    min-height: calc(100vh - 260px);
}

/* Configuration Panel */
.config-panel {
    background: white;
    padding: clamp(15px, 3vw, 30px);
    border-radius: 16px;
    box-shadow: var(--shadow);
    height: auto;
    min-height: calc(100vh - 260px);
    overflow-y: auto;
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.config-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.panel-header {
    margin-bottom: 25px;
    position: relative;
}

.panel-header h2 {
    color: var(--dark-blue);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-green);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

/* 折叠面板样式 */
.collapsible-section {
    border: none;
    padding: 0;
    margin: 0;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--dark-blue);
    font-weight: bold;
    cursor: pointer;
    padding: 8px 0;
    gap: 10px;
}

.collapsible-header .collapse-icon {
    margin-left: auto;
}

.collapsible-header::-webkit-details-marker {
    display: none;
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-weight: bold;
    color: var(--primary-blue);
}

.collapsible-section[open] .collapse-icon {
    transform: rotate(90deg);
}

.collapsible-content {
    margin-top: 15px;
}

/* 确保与其他标签对齐 */
.collapsible-header label {
    margin-bottom: 0;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.property-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-item label {
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0;
}

.property-item input {
    width: 100%;
    padding: 12px;
}

label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--dark-blue);
    gap: 10px;
}

input, select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #dde7f0;
    border-radius: 10px;
    transition: var(--transition);
    background: var(--light-blue);
    color: var(--text-dark);
    font-size: 1.1rem;
}

input:focus, select:focus {
    border-color: var(--secondary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 119, 204, 0.2);
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: flex-start !important;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    flex: 1;
    box-shadow: 0 4px 12px rgba(0, 91, 172, 0.25);
}

.btn-primary:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 168, 150, 0.25);
}

.btn-secondary:hover {
    background: #00957d;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* 统一操作按钮样式 */
form#configForm .btn-group .btn.action-btn {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 48px !important;
    padding: 0 12px !important;
    margin: 0 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    flex-shrink: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    gap: 8px !important;
}

form#configForm .btn-group:first-of-type .btn.action-btn:first-child {
    margin-left: 0 !important;
}

form#configForm .btn-group:first-of-type .btn.action-btn:last-child {
    margin-right: 0 !important;
}

form#configForm .btn-group {
    justify-content: flex-start !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

/* Progress Bar */
.progress-container {
    margin: 30px 0;
    background: #e0e7ff;
    border-radius: 10px;
    height: 22px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--accent-green), var(--accent-cyan));
    transition: width 0.3s ease;
    border-radius: 10px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to right, 
        rgba(255,255,255,0.2) 0%, 
        rgba(255,255,255,0.6) 50%, 
        rgba(255,255,255,0.2) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Visualization Panel */
.visualization-panel {
    background: white;
    padding: clamp(15px, 3vw, 30px);
    border-radius: 16px;
    box-shadow: var(--shadow);
    height: auto;
    min-height: calc(100vh - 260px);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.visualization-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

#moleculeContainer {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    overflow-y: auto;
    padding: 20px;
    background: var(--light-blue);
    border-radius: 12px;
}

/* 优化布局：分子卡片和属性卡片分离 */
.molecule-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.molecule-card {
    width: 100%;
    height: clamp(250px, 40vh, 350px);
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.molecule-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.molecule-view {
    width: 100%;
    height: 100%;
    position: relative;
}

.properties-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    transition: var(--transition);
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.property-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #f5f9ff;
    border-radius: 10px;
    transition: var(--transition);
    min-height: 80px;
}

.property-item:hover {
    transform: translateY(-3px);
    background: #e1eeff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.property-label {
    color: var(--dark-blue);
    font-weight: 600;
    font-size: 0.66rem;
    margin-bottom: 3px;
    text-align: center;
    line-height: 1.3;
}

.property-value.color-green { color: #2ecc71; }
.property-value.color-yellow { color: #f39c12; }
.property-value.color-red { color: #e74c3c; }
.property-value {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.78rem;
}

.property-value.null-value {
    color: #95a5a6;
    font-style: italic;
}

.placeholder {
    text-align: center;
    color: #95a5a6;
    padding: 50px;
    grid-column: 1 / -1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.placeholder i {
    font-size: 64px;
    color: var(--primary-blue);
    margin-bottom: 25px;
    opacity: 0.8;
}

.placeholder h3 {
    color: var(--dark-blue);
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 700;
}

.placeholder p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Error Handling */
.error-message {
    color: var(--accent-red);
    padding: 18px;
    background: #fff0f1;
    border-radius: 10px;
    margin-top: 25px;
    display: none;
    border: 1px solid var(--accent-red);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Card Indicators */
.info-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 3;
    background-color: var(--primary-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.refresh-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 3;
    background-color: var(--accent-green);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background-color: #00957d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 280px;
    background-color: var(--dark-blue);
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark-blue) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .panel-layout {
        grid-template-columns: 1fr;
    }

    .config-panel, .visualization-panel {
        height: auto;
    }
}

@media (max-width: 1000px) {
    #moleculeContainer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .properties-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .page-title h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .container {
        padding: 0 15px 30px;
    }

    .placeholder {
        padding: 20px;
    }

    .placeholder i {
        font-size: clamp(36px, 10vw, 48px);
    }

    .placeholder h3 {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }

    .placeholder p {
        font-size: clamp(1rem, 3vw, 1.1rem);
    }

    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .properties-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
}

.dot {
    width: 14px;
    height: 14px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: pulse 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.7; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* Property icons */
.property-icon {
    font-size: 0.8rem;
    margin-bottom: 3px;
    color: var(--accent-teal);
}

/* 添加新的样式 */
.molecule-display {
    display: flex;
    height: 100%;
}

.molecule-2d {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-right: 1px solid #dde7f0;
    padding: 15px;
}

.molecule-2d img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

.molecule-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.molecule-card-content {
    flex: 1;
    display: flex;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
