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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* 密码验证页面 */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.auth-box h2 {
  margin-bottom: 10px;
  color: #333;
}

.auth-box p {
  color: #666;
  margin-bottom: 20px;
}

.auth-box input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}

.auth-box input:focus {
  outline: none;
  border-color: #667eea;
}

.auth-box button {
  width: 100%;
  padding: 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.auth-box button:hover {
  background: #5a6fd6;
}

.error {
  color: #e74c3c;
  margin-top: 10px;
  font-size: 14px;
}

/* 主内容 */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 24px;
  color: #333;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stats-info {
  color: #666;
  font-size: 14px;
}

.btn-primary {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: #5a6fd6;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.back-link {
  color: #667eea;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* 状态提示 */
.status {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: none;
}

.status.show {
  display: block;
}

.status.loading {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.status.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.status.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* 搜索栏 */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
}

.search-bar input:focus {
  outline: none;
  border-color: #667eea;
}

.search-bar button {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.search-bar button:hover {
  background: #5a6fd6;
}

/* 文档列表 */
.doc-list {
  display: grid;
  gap: 12px;
}

.doc-item {
  padding: 16px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s;
  cursor: pointer;
}

.doc-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.doc-item h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 6px;
}

.doc-item .doc-meta {
  font-size: 12px;
  color: #999;
}

.doc-item .doc-snippet {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
  line-height: 1.5;
}

.doc-item .doc-snippet mark {
  background: #fff3cd;
  padding: 1px 4px;
  border-radius: 3px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding: 16px;
}

.pagination button {
  padding: 8px 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.pagination button:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination button.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 文档详情 */
.doc-detail {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.doc-detail h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 10px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.doc-detail .doc-info {
  font-size: 13px;
  color: #999;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.doc-detail .doc-body {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
}

.doc-detail .doc-body h1,
.doc-detail .doc-body h2,
.doc-detail .doc-body h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  color: #333;
}

.doc-detail .doc-body p {
  margin-bottom: 12px;
}

.doc-detail .doc-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.doc-detail .doc-body pre {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}

.doc-detail .doc-body code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.doc-detail .doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.doc-detail .doc-body th,
.doc-detail .doc-body td {
  border: 1px solid #e0e0e0;
  padding: 10px 14px;
  text-align: left;
}

.doc-detail .doc-body th {
  background: #f5f5f5;
  font-weight: 600;
}

/* 响应式 */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary {
    width: 100%;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar button {
    width: 100%;
  }
}
