/* Knowledge Star Map with Task System - Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 100%);
  color: #fff;
  overflow: hidden;
  height: 100vh;
}

/* 星光背景 */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 主应用容器 */
#app {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  z-index: 1;
  overflow: hidden;
}

/* 控制面板 */
#control-panel, .control-panel {
  width: 350px;
  background: rgba(26, 26, 62, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex !important; /* 确保显示 */
  flex-direction: column;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  z-index: 10;
  position: relative;
  height: 100vh;
}

.panel-header {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h1 {
  font-size: 20px;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#user-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

#user-info span {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
}

#user-info button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

#user-info button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.panel-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* 表单部分 */
.form-section, .info-section, .task-section, .notes-section, .admin-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.form-section h3, .info-section h3, .task-section h3, .notes-section h3, .admin-section h3 {
  margin-bottom: 15px;
  color: #a78bfa;
  font-size: 16px;
}

input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  font-size: 14px;
}

input[type="text"]::placeholder, 
input[type="password"]::placeholder, 
textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  margin-right: 10px;
  margin-bottom: 10px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

.error-message {
  color: #f87171;
  font-size: 14px;
  margin-top: 5px;
}

.warning {
  color: #fbbf24;
  font-size: 14px;
  margin-top: 5px;
}

/* Cytoscape容器 */
#cy {
  flex: 1;
  background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0e27 100%);
  position: relative;
  min-height: 100vh;
}

/* 节点信息 */
#node-details p, #task-details p {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

#node-details strong, #task-details strong {
  color: #a78bfa;
}

/* 任务提交 */
#task-submission {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#task-submission h4 {
  margin-bottom: 10px;
  color: #60a5fa;
  font-size: 14px;
}

/* 管理员面板 */
.admin-section button {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
}

/* 模态框 */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  animation: fadeIn 0.3s;
}

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

.modal-content {
  background: linear-gradient(135deg, #1a1a3e 0%, #2d2d5e 100%);
  margin: 5% auto;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover,
.close:focus {
  color: #fff;
}

#modal-body h2 {
  margin-bottom: 20px;
  color: #a78bfa;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table th {
  background: rgba(102, 126, 234, 0.3);
  padding: 10px;
  text-align: left;
  font-weight: 600;
}

table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

table button {
  padding: 5px 10px;
  font-size: 12px;
  margin: 0;
}

/* 提交列表 */
.submissions-list {
  margin-top: 20px;
}

.submission-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.submission-item h4 {
  color: #60a5fa;
  margin-bottom: 10px;
}

.submission-item p {
  margin-bottom: 8px;
  font-size: 14px;
}

.submission-item input[type="number"],
.submission-item input[type="text"] {
  width: auto;
  display: inline-block;
  margin-right: 10px;
  padding: 5px 10px;
}

.submission-item button {
  padding: 5px 15px;
  font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  #control-panel {
    width: 100%;
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  #app {
    flex-direction: column;
  }
  
  #cy {
    height: 60vh;
  }
  
  .modal-content {
    width: 95%;
    margin: 2% auto;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.7);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
}

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

/* 任务状态标记 */
.task-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 5px;
}

.task-badge.not-started {
  background: #6b7280;
  color: white;
}

.task-badge.submitted {
  background: #3b82f6;
  color: white;
}

.task-badge.completed {
  background: #10b981;
  color: white;
}

.task-badge.rejected {
  background: #ef4444;
  color: white;
}