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

body {
  font:
    14px 'Lucida Grande',
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.6;
  padding: 20px;
  background-color: #f5f5f5;
}

a {
  color: #00b7ff;
  text-decoration: none;
}

/* 禁用移动端点击高亮 */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ========== 标签过滤器 ========== */
.tag-filter {
  margin: 20px 0;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 5px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.tag-filter a {
  display: inline-block;
  margin: 0 5px 5px 0;
  padding: 5px 10px;
  background-color: #e9ecef;
  color: #495057;
  text-decoration: none;
  border-radius: 3px;
  min-height: 44px;
  min-width: 44px;
  line-height: 1.2;
}

.tag-filter a.active,
.tag-filter a:hover {
  background-color: #007bff;
  color: white;
}

/* ========== 文档卡片 ========== */
.document-item {
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 15px;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.document-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
  gap: 8px;
}

.document-tag {
  background-color: #007bff;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8em;
}

.document-date {
  color: #6c757d;
  font-size: 0.9em;
}

.document-content {
  margin-bottom: 15px;
  line-height: 1.6;
  word-break: break-word;
}

.document-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85em;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  body {
    font-size: 13px;
    padding: 10px;
  }

  .tag-filter {
    margin: 10px 0;
    padding: 8px;
  }

  .tag-filter a {
    padding: 4px 8px;
    font-size: 0.85rem;
    margin: 0 3px 5px 0;
  }

  .document-item {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
  }

  .document-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .document-tag {
    padding: 3px 6px;
    font-size: 0.75rem;
  }

  .document-date {
    font-size: 0.8rem;
  }

  .document-content {
    font-size: 0.9rem;
  }

  .document-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .btn-small {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }
}

/* ========== 超小屏幕 ========== */
@media (max-width: 480px) {
  body {
    font-size: 12px;
    padding: 5px;
  }

  .document-item {
    padding: 10px;
  }

  .document-actions {
    flex-direction: column;
  }

  .btn-small {
    width: 100%;
  }

  .tag-filter a {
    padding: 3px 6px;
    font-size: 0.8rem;
  }
}

/* ========== 平滑滚动 ========== */
html {
  scroll-behavior: smooth;
}
