/* CSS - Solarized Light Theme */
:root {
    /* Solarized Light Palette */
    --base3: #fdf6e3;  /* Background */
    --base2: #eee8d5;  /* Lighter Background (for nodes, modals) */
    --base00: #657b83; /* Text */
    --base01: #586e75; /* Darker Text */
    --yellow: #b58900;
    --orange: #cb4b16;
    --red: #dc322f;
    --magenta: #d33682;
    --violet: #6c71c4;
    --blue: #268bd2;
    --cyan: #2aa198;
    --green: #859900;

    /* Mapping to theme variables */
    --primary-color: var(--blue);
    --secondary-color: var(--violet);
    --background-color: var(--base3);
    --text-color: var(--base00);
    --node-bg-color: var(--base2);
    --node-glow-color: rgba(38, 139, 210, 0.4);
    --line-color: rgba(108, 113, 196, 0.6);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

#header {
    text-align: center;
    padding: 15px;
    background: linear-gradient(to bottom, rgba(238, 232, 213, 0.8), rgba(238, 232, 213, 0));
    flex-shrink: 0;
    border-bottom: 1px solid var(--base2);
}

h1 {
    margin: 0;
    color: var(--primary-color);
    text-shadow: none;
}

#network-container {
    position: relative;
    width: 100%;
    flex-grow: 1; 
}

#network-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.line {
    stroke-width: 2;
    transition: all 0.5s ease;
}
.line-unlocked {
    stroke: var(--line-color);
}
.line-preview {
    stroke: var(--line-color);
    stroke-opacity: 0.5;
    stroke-dasharray: 5, 5;
}


.node {
    position: absolute;
    width: 110px;
    height: 110px;
    background-color: var(--node-bg-color);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    /* 修改：垂直排列图标和文字 */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translate(-50%, -50%);
    padding: 5px;
    box-sizing: border-box;
    color: var(--base01);
    animation: none;
}

/* 修改：调整图标样式 */
.node i {
    font-size: 36px; /* 稍微缩小图标为文字留出空间 */
    color: var(--primary-color);
    transition: all 0.3s ease;
    margin-bottom: 5px; /* 在图标和文字之间增加间距 */
}

/* 新增：节点内文字的样式 */
.node .node-name {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
    color: var(--base01);
}

.node:hover {
    transform: translate(-50%, -50%) scale(1.15);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.node:hover i {
    color: var(--secondary-color);
}

.node.unlocked-fully {
    border-color: var(--secondary-color);
    opacity: 0.8;
    cursor: default;
}

/* 问题模态框 */
.modal {
    display: none; 
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(101, 123, 131, 0.5);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--background-color);
    padding: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    animation: fadeIn 0.5s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#question-text, #knowledge-text-display {
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--base01);
    text-align: left;
}

#learning-view h3 {
        color: var(--base01);
        margin-top: 0;
}

#question-counter {
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

#answer-input {
    width: calc(100% - 24px);
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px solid var(--base2);
    background-color: var(--base2);
    color: var(--text-color);
    font-size: 1em;
    text-align: center;
}

#answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--node-glow-color);
}

.modal-buttons button, .modal-buttons a {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin: 5px 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

#submit-answer, #start-quiz-btn {
    background-color: var(--primary-color);
    color: var(--base3);
}

#video-link {
    background-color: var(--cyan);
    color: var(--base3);
}

#submit-answer:hover, #start-quiz-btn:hover, #video-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#close-modal {
    background-color: var(--base2);
    color: var(--base00);
}

#close-modal:hover {
    background-color: #93a1a1;
    color: var(--base3);
}

#feedback-message {
    margin-top: 15px;
    color: var(--red);
    height: 20px;
    font-weight: bold;
    transition: opacity 0.3s;
}

/* 开发者模式下坐标显示的样式 */
.node-coords {
    position: absolute;
    bottom: -20px; /* 显示在节点下方 */
    font-size: 12px;
    color: #657b83; /* 醒目的颜色 */
    /*background-color: rgba(0, 0, 0, 0.5);*/
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap; /* 防止换行 */
    pointer-events: none; /* 确保不会干扰鼠标事件 */
}

/* 节点被拖动时的样式 */
.node.dragging {
    cursor: grabbing;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.node-level-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f6cd3f;
  color: #fdf6e3;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}
