/* ============================================================
   MyRAG 公共样式：统一视觉、响应式适配
   所有页面共享：渐变背景、卡片、按钮、表单、消息、通用布局
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", system-ui, -apple-system, Arial, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 20%, rgba(120,160,255,0.18) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(100,200,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 10%, rgba(180,140,240,0.12) 0%, transparent 40%),
    #f7f9fc;
  color: #1f2937;
}

/* ---------- 卡片 ---------- */
.card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(20, 80, 180, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 28px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1677ff 0%, #4080ff 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.26s ease;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.32);
  background: linear-gradient(135deg, #0e66e8 0%, #3374ee 100%);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled {
  background: #b4b8c2;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-block { width: 100%; }

/* 入口链接组（首页风格按钮） */
.link-group a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 148px;
  padding: 15px 24px;
  background: linear-gradient(135deg, #1677ff 0%, #4080ff 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.28s ease;
  border: none;
}
.link-group a:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(22, 119, 255, 0.32);
  background: linear-gradient(135deg, #0e66e8 0%, #3374ee 100%);
}
.link-group a:active { transform: translateY(1px); }
.link-group a.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}
/* 已登录：注册/登录按钮变灰 */
.link-group a.logged-out {
  background: linear-gradient(135deg, #9aa3b2 0%, #b6bdca 100%);
  box-shadow: none;
  cursor: pointer;
}
.link-group a.logged-out:hover {
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, #8a93a5 0%, #a6aebd 100%);
}

/* ---------- 表单 ---------- */
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d2d6dc;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  transition: border 0.22s ease, box-shadow 0.22s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.15);
}
textarea { resize: vertical; }
label { display: block; margin-bottom: 6px; font-weight: 500; color: #2d3748; font-size: 15px; }

/* ---------- 消息 ---------- */
.msg-box { margin-top: 12px; color: #cf1322; font-size: 14px; min-height: 20px; text-align: center; }
.msg-ok { color: #52c41a; }

/* ---------- 链接 ---------- */
.link { color: #1677ff; text-decoration: none; }
.link:hover { text-decoration: underline; }
.nav-links a { color: #1677ff; text-decoration: none; margin-right: 12px; }
.nav-links a:hover { text-decoration: underline; }

/* ---------- 页面头 ---------- */
.page-header { margin-bottom: 26px; }
.page-header h2 { font-size: 28px; color: #111827; margin-bottom: 12px; }

/* ---------- 表格 ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f5;
  text-align: left;
}
th { background: #f5f7fa; color: #374151; font-weight: 600; }
tr:hover td { background: #f8faff; }

/* ---------- 状态/结果区 ---------- */
.status-line { margin-top: 14px; font-size: 14px; color: #475569; min-height: 20px; }
.result-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
  min-height: 200px;
  font-size: 15px;
  line-height: 1.75;
  color: #2a2a2a;
  white-space: pre-wrap;
}

/* ---------- 页面标题区（全站统一：渐变卡片 + 图标标题 + 返回按钮 + 副标题） ---------- */
.page-header {
  max-width: 1200px;
  margin: 0 auto 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(22, 119, 255, 0.08) 0%, rgba(64, 128, 255, 0.04) 100%);
  border: 1px solid rgba(22, 119, 255, 0.12);
  border-radius: 14px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-row h2 {
  font-size: 26px;
  color: #111827;
  margin: 0;
  letter-spacing: 0.5px;
}

.header-icon {
  margin-right: 8px;
  font-size: 24px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  background: #fff;
  border: 1px solid #d2d6dc;
  border-radius: 999px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.24s ease;
}
.back-btn:hover {
  border-color: #1677ff;
  color: #1677ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.18);
}

.header-desc {
  margin-top: 10px;
  font-size: 13px;
  color: #6b7280;
}

/* ---------- 页面页脚（版权条：固定于视口正下方） ---------- */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  text-align: center;
  font-size: 12px;
  color: #8a93a5;
  line-height: 1;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}
.site-footer a {
  color: #7b8794;
  text-decoration: none;
  margin: 0 4px;
}
.site-footer a:hover {
  color: #1677ff;
  text-decoration: underline;
}

/* ---------- 响应式：手机适配 ---------- */
@media (max-width: 768px) {
  .page-header { padding: 14px 16px; }
  .header-row { flex-direction: column; align-items: flex-start; }
  .back-btn { align-self: flex-start; }
}

@media (max-width: 640px) {
  .card { border-radius: 16px; }
  .page-header h2 { font-size: 22px; }
  .link-group { flex-direction: column; align-items: stretch; }
  .link-group a { width: 100%; min-width: 0; }
  .btn { width: 100%; }
  th, td { padding: 8px 8px; font-size: 13px; }
  body { padding: 14px 12px; }
}
