* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Arial', sans-serif;
    overflow: hidden;
    background: #f5f5f5;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* 主标题现在在canvas中绘制 */

#canvas-container {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#canvas-container.dragging {
    cursor: grabbing;
}

#quantum-map {
    display: block;
}

/* 详情面板 */
.detail-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 450px;
    max-height: calc(100vh - 60px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.detail-panel.hidden {
    transform: translateX(500px);
    opacity: 0;
    pointer-events: none;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 24px;
    font-weight: bold;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.panel-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.detail-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    color: #667eea;
    font-size: 15px;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.detail-section h3::before {
    content: '▸';
    margin-right: 6px;
    color: #667eea;
}

.detail-section p {
    color: #555;
    line-height: 1.8;
    font-size: 14px;
}

.detail-section div {
    color: #555;
    line-height: 1.9;
    font-size: 14px;
}

/* 作者特殊样式 */
#detail-author {
    color: #764ba2;
    font-style: italic;
    font-weight: 500;
}

/* 故事介绍特殊样式 */
#detail-story {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* 数学公式样式优化 */
.detail-section .MathJax {
    font-size: 1.1em !important;
}

.detail-section mjx-container {
    margin: 10px 0;
}

.detail-section strong {
    color: #667eea;
    font-weight: 600;
}

.circuit-diagram {
    background: #e8eaf6;
    padding: 20px;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    flex-direction: column;
    position: relative;
}

.circuit-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 4px;
    display: none;
}

.circuit-image:first-of-type {
    display: block;
}

.no-circuit-image {
    color: #999;
    text-align: center;
    font-size: 14px;
    line-height: 1.8;
}

.no-circuit-image small {
    font-size: 11px;
    color: #bbb;
    display: block;
    margin-top: 8px;
}

/* 图片来源网址 */
.image-source {
    margin-top: 10px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.image-source .source-link {
    color: #0066cc;
    text-decoration: none;
    display: inline-block;
    max-width: calc(100% - 80px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: baseline;
}

.image-source .source-link:hover {
    text-decoration: underline;
}

/* 控制说明 */
.controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.controls-hint p {
    font-size: 14px;
    color: #666;
}

/* 滚动条样式 */
.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

