/* Notion风格设计系统 - EvidenceCanvas */

:root {
  /* Notion 配色 */
  --notion-bg: #ffffff;
  --notion-bg-hover: #f7f6f3;
  --notion-bg-selected: #e3e2e0;
  --notion-bg-gray: #f1f1ef;
  --notion-bg-brown: #f4eeee;
  --notion-bg-orange: #faf3eb;
  --notion-bg-yellow: #fbf3db;
  --notion-bg-green: #edf3ec;
  --notion-bg-blue: #e7f3f8;
  --notion-bg-purple: #f6f3f9;
  --notion-bg-pink: #faf1f5;
  --notion-bg-red: #fdebec;

  /* 文字色 */
  --notion-text: #37352f;
  --notion-text-gray: #9ca3af;
  --notion-text-brown: #9f6b53;
  --notion-text-orange: #d9730d;
  --notion-text-yellow: #cb912f;
  --notion-text-green: #448361;
  --notion-text-blue: #337ea9;
  --notion-text-purple: #9065b0;
  --notion-text-pink: #c14c8a;
  --notion-text-red: #d44c47;

  /* 边框 */
  --notion-border: #e3e2e0;
  --notion-border-hover: #d3d1cb;

  /* 字体 */
  --notion-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --notion-font-mono: 'SF Mono', 'Fira Code', monospace;

  /* 间距 */
  --notion-radius: 3px;
  --notion-radius-lg: 6px;

  /* 阴影 */
  --notion-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 9px 24px;
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--notion-font);
  background: var(--notion-bg);
  color: var(--notion-text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* 侧边栏 - Notion风格 */
.notion-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  background: var(--notion-bg-gray);
  border-right: 1px solid var(--notion-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.notion-sidebar-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.notion-sidebar-header:hover {
  background: var(--notion-bg-hover);
}

.notion-sidebar-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--notion-text);
}

.notion-sidebar-section {
  padding: 6px 4px;
}

.notion-sidebar-title {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--notion-text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notion-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin: 2px 4px;
  border-radius: var(--notion-radius);
  cursor: pointer;
  transition: background 0.1s;
  color: var(--notion-text);
  text-decoration: none;
  font-size: 14px;
}

.notion-sidebar-item:hover {
  background: var(--notion-bg-hover);
}

.notion-sidebar-item.active {
  background: var(--notion-bg-selected);
  font-weight: 500;
}

.notion-sidebar-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* 主内容区 */
.notion-main {
  margin-left: 240px;
  min-height: 100vh;
}

.notion-header {
  position: sticky;
  top: 0;
  height: 45px;
  background: var(--notion-bg);
  border-bottom: 1px solid var(--notion-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 90;
}

.notion-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notion-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--notion-text-gray);
}

.notion-breadcrumb-item {
  padding: 4px 6px;
  border-radius: var(--notion-radius);
  cursor: pointer;
  transition: background 0.1s;
}

.notion-breadcrumb-item:hover {
  background: var(--notion-bg-hover);
}

.notion-breadcrumb-separator {
  color: var(--notion-text-gray);
  font-size: 12px;
}

/* 页面内容 */
.notion-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 40px;
}

.notion-page-header {
  margin-bottom: 40px;
}

.notion-page-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.notion-page-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--notion-text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.notion-page-subtitle {
  font-size: 16px;
  color: var(--notion-text-gray);
}

/* 卡片网格 */
.notion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.notion-card {
  background: var(--notion-bg);
  border: 1px solid var(--notion-border);
  border-radius: var(--notion-radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
}

.notion-card:hover {
  background: var(--notion-bg-hover);
  border-color: var(--notion-border-hover);
}

.notion-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--notion-text-gray);
  border-radius: var(--notion-radius-lg) 0 0 var(--notion-radius-lg);
  opacity: 0;
  transition: opacity 0.1s;
}

.notion-card:hover::before {
  opacity: 0.3;
}

.notion-card-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.notion-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--notion-text);
  margin-bottom: 4px;
}

.notion-card-meta {
  font-size: 12px;
  color: var(--notion-text-gray);
}

.notion-card-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--notion-border);
}

.notion-card-stat {
  font-size: 12px;
  color: var(--notion-text-gray);
}

.notion-card-stat strong {
  color: var(--notion-text);
  font-weight: 600;
}

/* 新建卡片 */
.notion-card-new {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--notion-text-gray);
}

.notion-card-new:hover {
  border-color: var(--notion-text-gray);
  color: var(--notion-text);
}

/* 按钮 */
.notion-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: var(--notion-radius);
  cursor: pointer;
  transition: all 0.1s;
  border: none;
  background: transparent;
  color: var(--notion-text);
}

.notion-btn:hover {
  background: var(--notion-bg-hover);
}

.notion-btn-primary {
  background: var(--notion-text);
  color: white;
}

.notion-btn-primary:hover {
  background: #2d2c2a;
}

/* 工作区布局 */
.notion-workspace {
  display: flex;
  height: calc(100vh - 45px);
}

.notion-canvas-area {
  flex: 1;
  background: var(--notion-bg-gray);
  display: flex;
  flex-direction: column;
}

.notion-canvas-toolbar {
  height: 44px;
  background: var(--notion-bg);
  border-bottom: 1px solid var(--notion-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}

.notion-canvas-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.notion-canvas-wrapper {
  background: white;
  border-radius: var(--notion-radius-lg);
  box-shadow: var(--notion-shadow);
}

/* 右侧面板 */
.notion-panel {
  width: 320px;
  background: var(--notion-bg);
  border-left: 1px solid var(--notion-border);
  display: flex;
  flex-direction: column;
}

.notion-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--notion-border);
}

.notion-panel-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--notion-text-gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
}

.notion-panel-tab:hover {
  color: var(--notion-text);
  background: var(--notion-bg-hover);
}

.notion-panel-tab.active {
  color: var(--notion-text);
  border-bottom-color: var(--notion-text);
  font-weight: 500;
}

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

/* 列表项 */
.notion-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--notion-radius);
  cursor: pointer;
  transition: background 0.1s;
}

.notion-list-item:hover {
  background: var(--notion-bg-hover);
}

.notion-list-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.notion-list-content {
  flex: 1;
  min-width: 0;
}

.notion-list-title {
  font-size: 14px;
  color: var(--notion-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notion-list-meta {
  font-size: 12px;
  color: var(--notion-text-gray);
}

/* 空状态 */
.notion-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--notion-text-gray);
}

.notion-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.notion-empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--notion-text);
  margin-bottom: 4px;
}

.notion-empty-hint {
  font-size: 14px;
}

/* 模态框 */
.notion-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.notion-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.notion-modal {
  background: var(--notion-bg);
  border-radius: var(--notion-radius-lg);
  box-shadow: var(--notion-shadow);
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.notion-modal-overlay.active .notion-modal {
  transform: scale(1);
}

.notion-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--notion-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notion-modal-title {
  font-size: 16px;
  font-weight: 600;
}

.notion-modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--notion-radius);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--notion-text-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notion-modal-close:hover {
  background: var(--notion-bg-hover);
  color: var(--notion-text);
}

.notion-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 120px);
}

/* 上传区域 */
.notion-upload-area {
  border: 2px dashed var(--notion-border);
  border-radius: var(--notion-radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.1s;
}

.notion-upload-area:hover {
  border-color: var(--notion-text-gray);
  background: var(--notion-bg-hover);
}

.notion-upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.notion-upload-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

.notion-upload-hint {
  font-size: 13px;
  color: var(--notion-text-gray);
}

/* 浮动按钮 */
.notion-float-btn {
  position: fixed;
  right: 360px;
  bottom: 100px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--notion-text);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--notion-shadow);
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notion-float-btn:hover {
  transform: scale(1.05);
  background: #2d2c2a;
}

/* 时间线 */
.notion-timeline {
  height: 80px;
  background: var(--notion-bg);
  border-top: 1px solid var(--notion-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}

.notion-timeline-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--notion-text-gray);
  white-space: nowrap;
}

.notion-timeline-scroll {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.notion-timeline-item {
  flex-shrink: 0;
  width: 80px;
  padding: 8px;
  background: var(--notion-bg-gray);
  border-radius: var(--notion-radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.1s;
}

.notion-timeline-item:hover {
  background: var(--notion-bg-hover);
}

.notion-timeline-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.notion-timeline-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--notion-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notion-timeline-date {
  font-size: 10px;
  color: var(--notion-text-gray);
}

/* 响应式 */
@media (max-width: 768px) {
  .notion-sidebar {
    width: 0;
    overflow: hidden;
  }

  .notion-main {
    margin-left: 0;
  }

  .notion-page {
    padding: 40px 20px;
  }

  .notion-page-title {
    font-size: 28px;
  }

  .notion-grid {
    grid-template-columns: 1fr;
  }

  .notion-panel {
    width: 100%;
    position: fixed;
    right: -100%;
    top: 45px;
    bottom: 0;
    transition: right 0.3s;
  }

  .notion-panel.open {
    right: 0;
  }
}
