/* =========================================
 * 化学分子模型页面统一样式
 * 用于所有 *_model.html 文件
 * ========================================= */

/* 基础页面样式 */
body {
    margin: 0;
    background: var(--ui-background-dark, #141414);
    color: var(--ui-text-on-dark, #eee);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    overflow: hidden;
}

canvas {
    display: block;
}

/* 左上角信息栏统一样式 */
#info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: color-mix(in srgb, var(--ui-panel-bg-color, #000) 55%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-radius: 10px;
    max-width: 520px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#info:hover {
    background: color-mix(in srgb, var(--ui-panel-bg-color, #000) 65%, transparent);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#info h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ui-text-on-dark, #eee);
    letter-spacing: 0.5px;
}

#info p {
    font-size: 14px;
    margin: 6px 0;
    color: rgba(238, 238, 238, 0.9);
    line-height: 1.5;
}

/* QA 验证区域样式 */
#qa {
    margin-top: 10px;
}

.qa-item {
    font-size: 14px;
    margin: 6px 0;
    color: rgba(238, 238, 238, 0.9);
    line-height: 1.5;
}

/* 图例样式 */
.legend {
    margin-top: 10px;
}

.legend h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 8px 0 8px 0;
    color: var(--ui-text-on-dark, #eee);
}

.legend ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    font-size: 13px;
}

.color-box {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid var(--ui-legend-border, #555);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* 右上角按钮统一样式 */
.controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.controls button {
    background: var(--ui-button-bg, #2b2b2b);
    color: var(--ui-button-text, #fff);
    border: 1px solid var(--ui-border-default, #444);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.controls button:hover {
    background: var(--ui-button-hover-bg, #3a3a3a);
    border-color: #666;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.controls button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* 加载提示样式 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--ui-text-on-dark, #eee);
    font-size: 18px;
    font-weight: 500;
    background: color-mix(in srgb, var(--ui-panel-bg-color, #000) 70%, transparent);
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 响应式设计 - 移动设备优化 */
@media (max-width: 768px) {
    #info {
        max-width: calc(100vw - 40px);
        font-size: 13px;
    }

    #info h2 {
        font-size: 16px;
    }

    #info p {
        font-size: 13px;
    }

    .legend h3 {
        font-size: 14px;
    }

    .legend li {
        font-size: 12px;
    }

    .controls {
        flex-direction: column;
        gap: 6px;
    }

    .controls button {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    #info {
        top: 8px;
        left: 8px;
        padding: 10px 12px;
    }

    .controls {
        top: 8px;
        right: 8px;
    }
}
