/**
 * RolePilot 文档页面样式
 * 任务管理面板互动演示
 */

/* ========== 变量 ========== */
:root {
  --doc-bg: #0d1117;
  --doc-panel-bg: #161b22;
  --doc-sidebar-bg: #1c2128;
  --doc-border: #30363d;
  --doc-primary: #00f3ff;
  --doc-secondary: #ff6b6b;
  --doc-text: #e6edf3;
  --doc-text-dim: #8b949e;
  --doc-accent: #238636;
  --doc-idea-bg: #1a3a5c;
  --doc-font: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, monospace;
}

/* ========== 基础重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--doc-font);
  background: var(--doc-bg);
  color: var(--doc-text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ========== 噪点层 ========== */
.doc-noise {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.02;
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)"/%3E%3C/svg%3E');
}

/* ========== 顶部导航 ========== */
.doc-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 30px;
  background: var(--doc-panel-bg);
  border-bottom: 1px solid var(--doc-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.doc-logo {
  color: var(--doc-text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.doc-logo:hover {
  color: var(--doc-primary);
}

.doc-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--doc-text);
}

.doc-shortcut {
  margin-left: auto;
  padding: 4px 12px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--doc-primary);
  border-radius: 4px;
  font-size: 12px;
  color: var(--doc-primary);
}

/* ========== Tab 导航 ========== */
.doc-tabs {
  display: flex;
  gap: 0;
  padding: 0 30px;
  background: var(--doc-panel-bg);
  border-bottom: 1px solid var(--doc-border);
}

.doc-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--doc-text-dim);
  font-family: var(--doc-font);
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.doc-tab:hover {
  color: var(--doc-text);
}

.doc-tab.active {
  color: var(--doc-primary);
}

.doc-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--doc-primary);
}

/* ========== 主内容区 ========== */
.doc-main {
  display: flex;
  gap: 30px;
  padding: 30px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ========== 模拟面板容器 ========== */
.doc-panel-wrapper {
  flex: 1;
  min-width: 0;
}

.doc-panel {
  display: flex;
  background: var(--doc-panel-bg);
  border: 1px solid var(--doc-border);
  border-radius: 8px;
  overflow: hidden;
  height: calc(100vh - 180px);
  min-height: 500px;
}

/* ========== 左侧栏 ========== */
.panel-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--doc-sidebar-bg);
  border-right: 1px solid var(--doc-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 搜索栏 */
.sidebar-search {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--doc-border);
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--doc-panel-bg);
  border: 1px solid var(--doc-border);
  border-radius: 4px;
  color: var(--doc-text);
  font-family: var(--doc-font);
  font-size: 12px;
}

.search-input::placeholder {
  color: var(--doc-text-dim);
}

.search-input:focus {
  outline: none;
  border-color: var(--doc-primary);
}

.search-more {
  padding: 8px 12px;
  background: var(--doc-panel-bg);
  border: 1px solid var(--doc-border);
  border-radius: 4px;
  color: var(--doc-text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.search-more:hover {
  border-color: var(--doc-primary);
  color: var(--doc-primary);
}

/* 侧边栏项目 */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
  background: rgba(0, 243, 255, 0.1);
  border-left: 2px solid var(--doc-primary);
}

.sidebar-item.drag-over {
  background: rgba(0, 243, 255, 0.2);
  border: 1px dashed var(--doc-primary);
}

.item-color {
  width: 3px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
}

.item-name {
  flex: 1;
  font-size: 13px;
  color: var(--doc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-badge {
  padding: 2px 6px;
  background: var(--doc-secondary);
  border-radius: 10px;
  font-size: 10px;
  color: white;
  min-width: 18px;
  text-align: center;
}

/* 分组标题 */
.sidebar-group {
  margin-top: 8px;
}

.group-title {
  padding: 8px 12px 4px;
  font-size: 11px;
  color: var(--doc-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== 右侧内容区 ========== */
.panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 内容头部 */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--doc-border);
}

.content-title {
  font-size: 16px;
  font-weight: 600;
}

/* 开关按钮 */
.content-toggle {
  position: relative;
  width: 40px;
  height: 20px;
  cursor: pointer;
}

.toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--doc-border);
  border-radius: 10px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--doc-text);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-checkbox:checked + .toggle-slider {
  background: var(--doc-primary);
}

.toggle-checkbox:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ========== 气泡列表 ========== */
.bubble-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* 日期分隔 */
.bubble-date {
  text-align: center;
  font-size: 12px;
  color: var(--doc-text-dim);
  margin: 16px 0 12px;
  position: relative;
}

.bubble-date::before,
.bubble-date::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--doc-border);
}

.bubble-date::before { left: 0; }
.bubble-date::after { right: 0; }

/* 气泡基础样式 */
.bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--doc-sidebar-bg);
  border: 1px solid var(--doc-border);
  border-radius: 8px;
  margin-bottom: 8px;
  position: relative;
  cursor: grab;
  transition: all 0.2s;
}

.bubble:hover {
  border-color: var(--doc-primary);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.bubble.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.bubble.drag-over {
  border-color: var(--doc-primary);
  border-style: dashed;
}

/* 待办气泡 */
.bubble-todo .bubble-text {
  flex: 1;
  font-size: 14px;
}

.bubble-todo.completed .bubble-text {
  text-decoration: line-through;
  color: var(--doc-text-dim);
}

/* 复选框 */
.bubble-checkbox {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.bubble-checkbox input {
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-mark {
  position: absolute;
  top: 0; left: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--doc-border);
  border-radius: 4px;
  transition: all 0.2s;
}

.bubble-checkbox:hover .checkbox-mark {
  border-color: var(--doc-primary);
}

.bubble-checkbox input:checked + .checkbox-mark {
  background: var(--doc-primary);
  border-color: var(--doc-primary);
}

.bubble-checkbox input:checked + .checkbox-mark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--doc-bg);
  font-size: 12px;
  font-weight: bold;
}

/* 想法气泡 */
.bubble-idea {
  background: var(--doc-idea-bg);
  border-color: rgba(0, 243, 255, 0.3);
}

.bubble-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.bubble-idea .bubble-text {
  flex: 1;
  font-size: 14px;
}

/* 气泡操作按钮 */
.bubble-actions {
  display: none;
  gap: 4px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--doc-panel-bg);
  padding: 4px;
  border-radius: 4px;
  border: 1px solid var(--doc-border);
}

.bubble:hover .bubble-actions {
  display: flex;
}

.action-btn {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}


/* ========== 进度条 ========== */
.content-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--doc-border);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--doc-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--doc-accent), #2ea043);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--doc-text-dim);
  min-width: 80px;
}

.progress-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.progress-toggle:hover {
  opacity: 1;
}

/* ========== 底部输入区 ========== */
.content-input {
  padding: 16px 20px;
}

/* 类型切换 */
.input-types {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.type-btn {
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--doc-text-dim);
  font-family: var(--doc-font);
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.type-btn:hover {
  color: var(--doc-text);
}

.type-btn.active {
  color: var(--doc-primary);
}

.type-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--doc-primary);
}

.type-divider {
  width: 1px;
  height: 20px;
  background: var(--doc-border);
  margin: 0 8px;
}

.create-btn {
  color: var(--doc-text-dim);
}

.create-btn:hover {
  color: var(--doc-primary);
}

/* 输入框行 */
.input-row {
  display: flex;
  gap: 12px;
}

.input-field {
  flex: 1;
  padding: 12px 16px;
  background: var(--doc-sidebar-bg);
  border: 1px solid var(--doc-border);
  border-radius: 8px;
  color: var(--doc-text);
  font-family: var(--doc-font);
  font-size: 14px;
  transition: border-color 0.2s;
}

.input-field::placeholder {
  color: var(--doc-text-dim);
}

.input-field:focus {
  outline: none;
  border-color: var(--doc-primary);
}

.input-submit {
  padding: 12px 24px;
  background: var(--doc-primary);
  border: none;
  border-radius: 8px;
  color: var(--doc-bg);
  font-family: var(--doc-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.input-submit:hover {
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
  transform: translateY(-1px);
}

/* ========== 右侧说明面板 ========== */
.doc-guide {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guide-content {
  background: var(--doc-panel-bg);
  border: 1px solid var(--doc-border);
  border-radius: 8px;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.guide-section {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.guide-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--doc-text);
}

.guide-desc {
  font-size: 14px;
  color: var(--doc-text-dim);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* 步骤列表 */
.guide-steps {
  margin-bottom: 20px;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.step-num {
  width: 24px;
  height: 24px;
  background: var(--doc-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--doc-bg);
  flex-shrink: 0;
}

.step-text {
  font-size: 14px;
  color: var(--doc-text);
  padding-top: 2px;
}

/* 提示框 */
.guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid rgba(0, 243, 255, 0.3);
  border-radius: 8px;
}

.tip-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.tip-text {
  font-size: 13px;
  color: var(--doc-primary);
}

/* 使用场景 */
.guide-usage h4 {
  font-size: 14px;
  color: var(--doc-text);
  margin-bottom: 8px;
}

.guide-usage ul {
  list-style: none;
  padding-left: 0;
}

.guide-usage li {
  font-size: 13px;
  color: var(--doc-text-dim);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.guide-usage li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--doc-primary);
}

/* 操作列表 */
.guide-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--doc-sidebar-bg);
  border-radius: 6px;
}

.action-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.action-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--doc-text);
  min-width: 70px;
}

.action-desc {
  font-size: 12px;
  color: var(--doc-text-dim);
}

/* 结构列表 */
.guide-structure {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.structure-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--doc-sidebar-bg);
  border-radius: 6px;
}

.structure-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.structure-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--doc-text);
  min-width: 60px;
}

.structure-desc {
  font-size: 12px;
  color: var(--doc-text-dim);
}

/* 拖拽说明 */
.guide-drag {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.drag-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--doc-sidebar-bg);
  border-radius: 6px;
}

.drag-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--doc-primary);
  min-width: 80px;
}

.drag-desc {
  font-size: 12px;
  color: var(--doc-text-dim);
}

/* ========== 快捷键参考 ========== */
.guide-shortcuts {
  background: var(--doc-panel-bg);
  border: 1px solid var(--doc-border);
  border-radius: 8px;
  padding: 16px;
}

.shortcuts-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--doc-text);
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
}

.shortcut-item kbd {
  padding: 3px 8px;
  background: var(--doc-sidebar-bg);
  border: 1px solid var(--doc-border);
  border-radius: 4px;
  font-family: var(--doc-font);
  font-size: 11px;
  color: var(--doc-primary);
}

.shortcut-item span {
  color: var(--doc-text-dim);
}

/* ========== Toast 提示 ========== */
.doc-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--doc-primary);
  color: var(--doc-bg);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.doc-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========== 模态框 ========== */
.doc-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.doc-modal.show {
  display: flex;
}

.modal-content {
  width: 400px;
  background: var(--doc-panel-bg);
  border: 1px solid var(--doc-border);
  border-radius: 12px;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--doc-border);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--doc-text-dim);
  font-size: 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--doc-text);
}

.modal-body {
  padding: 20px;
}

.modal-field {
  margin-bottom: 16px;
}

.modal-field label {
  display: block;
  font-size: 13px;
  color: var(--doc-text-dim);
  margin-bottom: 8px;
}

.modal-input,
.modal-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--doc-sidebar-bg);
  border: 1px solid var(--doc-border);
  border-radius: 6px;
  color: var(--doc-text);
  font-family: var(--doc-font);
  font-size: 14px;
}

.modal-input:focus,
.modal-select:focus {
  outline: none;
  border-color: var(--doc-primary);
}

.modal-select {
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--doc-border);
}

.modal-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-family: var(--doc-font);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-cancel {
  background: var(--doc-sidebar-bg);
  color: var(--doc-text-dim);
}

.modal-cancel:hover {
  background: var(--doc-border);
  color: var(--doc-text);
}

.modal-confirm {
  background: var(--doc-primary);
  color: var(--doc-bg);
  font-weight: 500;
}

.modal-confirm:hover {
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .doc-main {
    flex-direction: column;
  }
  
  .doc-guide {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .guide-content {
    flex: 1;
    min-width: 300px;
  }
  
  .guide-shortcuts {
    width: 100%;
  }
  
  .guide-shortcuts .shortcut-item {
    display: inline-flex;
    margin-right: 20px;
  }
}

@media (max-width: 768px) {
  .doc-header {
    padding: 12px 16px;
  }
  
  .doc-title {
    font-size: 16px;
  }
  
  .doc-tabs {
    padding: 0 16px;
    overflow-x: auto;
  }
  
  .doc-tab {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
  }
  
  .doc-main {
    padding: 16px;
  }
  
  .doc-panel {
    flex-direction: column;
    height: auto;
  }
  
  .panel-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--doc-border);
  }
  
  .input-types {
    justify-content: center;
  }
  
  .type-divider {
    display: none;
  }
  
  .bubble-actions {
    position: static;
    transform: none;
    display: flex;
    margin-top: 8px;
    background: none;
    border: none;
    padding: 0;
  }
}
