/* 留学申请助手 — 精致版视觉 */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.08), 0 12px 32px rgba(79, 70, 229, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 头部 ---------- */
.app-header {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
  color: #fff;
  padding: 28px 20px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.app-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 20% 0%, rgba(255,255,255,0.14), transparent 60%),
              radial-gradient(500px 180px at 85% 100%, rgba(245,158,11,0.18), transparent 60%);
  pointer-events: none;
}
.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  position: relative;
}
.app-header .subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.82;
  letter-spacing: 1px;
  position: relative;
}

/* ---------- Tab ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
}
.tab:hover { color: var(--text-2); background: #f1f5f9; }
.tab.active {
  color: var(--primary-dark);
  font-weight: 700;
  background: var(--primary-soft);
}

/* ---------- 布局 ---------- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 14px 64px;
}
.panel { display: none; animation: fadeUp 0.25s ease; }
.panel.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 搜索栏 ---------- */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.search-bar select,
.search-bar input[type="search"],
.search-bar input[type="text"] {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.search-bar select:focus,
.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: #fff;
}
.search-bar input { flex: 1; min-width: 140px; }

/* ---------- 按钮 ---------- */
.btn {
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--text-2);
  transition: all 0.18s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.btn.primary:hover { box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45); }
.btn.danger { color: #dc2626; border-color: #fecaca; background: #fff7f7; }
.btn.danger:hover { background: #fef2f2; }
.btn.ghost { border: none; background: none; color: var(--primary); padding: 8px 4px; box-shadow: none; }
.btn.ghost:hover { background: var(--primary-soft); box-shadow: none; transform: none; }
.btn.small { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }

/* ---------- 卡片 ---------- */
.cards { display: grid; gap: 14px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card h3 { margin: 2px 0 4px; font-size: 17px; font-weight: 700; letter-spacing: 0.3px; }
.card .uni {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.card .meta b { color: var(--text-2); font-weight: 600; }
.card .actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.card a.link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 0;
}
.card a.link:hover { text-decoration: underline; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.st-preparing { background: #eef2ff; color: #4338ca; }
.st-submitted { background: #e0f2fe; color: #0369a1; }
.st-interview { background: #fef3c7; color: #92400e; }
.st-offer { background: #d1fae5; color: #065f46; }
.st-rejected { background: #fee2e2; color: #991b1b; }
.doc-todo { background: #f1f5f9; color: #475569; }
.doc-ready { background: #fef3c7; color: #92400e; }
.doc-submitted { background: #d1fae5; color: #065f46; }

/* ---------- 匹配分数 ---------- */
.score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: var(--primary-dark);
  font-weight: 800;
  border-radius: 10px;
  padding: 5px 14px;
  font-size: 14px;
  margin-bottom: 10px;
}
.score::before { content: "✦"; font-size: 12px; }
.reasons { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.reasons li { margin: 2px 0; }

/* ---------- 标题 ---------- */
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
  border-radius: 2px;
  letter-spacing: 0.5px;
}
.section-title:first-child { margin-top: 0; }

/* ---------- Deadline ---------- */
.deadline-list { display: grid; gap: 10px; margin-bottom: 8px; }
.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s;
}
.deadline-item.done { opacity: 0.5; }
.deadline-item.done .dl-title { text-decoration: line-through; }
.deadline-item input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.dl-info { flex: 1; min-width: 0; }
.dl-title { font-weight: 600; }
.dl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dl-date { font-size: 13px; white-space: nowrap; font-weight: 600; color: var(--text-2); }
.dl-date.urgent { color: #dc2626; }
.dl-date.soon { color: #d97706; }
.kind-tag {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border-radius: 7px;
  padding: 2px 9px;
  white-space: nowrap;
}

/* ---------- 材料 ---------- */
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.doc-item:last-child { border-bottom: none; }
.doc-item .doc-name { flex: 1; font-weight: 500; }
.doc-item .doc-due { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.form-row input, .form-row select, .form-row textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: #fff;
}
.form-row textarea { width: 100%; min-height: 72px; resize: vertical; }

.detail-head { margin-bottom: 14px; }
.detail-head .uni { color: var(--primary); font-weight: 700; font-size: 13px; letter-spacing: 0.5px; }
.detail-head h2 { margin: 6px 0 10px; font-size: 20px; font-weight: 700; }

/* ---------- 状态 ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
  font-size: 14px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.loading { text-align: center; color: var(--muted); padding: 32px; font-size: 14px; }
.loading::after { content: "…"; animation: dots 1.2s steps(3) infinite; }
@keyframes dots { 0% { content: ""; } 33% { content: "·"; } 66% { content: "··"; } 100% { content: "···"; } }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- 登录 ---------- */
.muted { color: var(--muted); font-size: 14px; }
.auth-card {
  max-width: 440px;
  margin: 48px auto;
  text-align: center;
  padding: 36px 28px !important;
}
.auth-card h2 { margin: 0 0 8px; font-size: 20px; }
.auth-card .form-row { justify-content: center; margin-top: 20px; }

/* ---------- 响应式 ---------- */
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .app-header h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  main { padding: 14px 10px 48px; }
  .card { padding: 16px; }
  .search-bar { padding: 10px; }
}
