* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f6f9;
  color: #333;
  min-height: 100vh;
}

/* Header */
header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -.5px;
}

.auth-subtitle {
  text-align: center;
  font-size: 13px;
  color: #8e8e93;
  margin-top: -20px;
  margin-bottom: 28px;
  letter-spacing: .3px;
}

.btn-group {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .15s, transform .1s;
}

.btn:hover { opacity: .85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-text  { background: #4a90e2; color: #fff; }
.btn-link  { background: #27ae60; color: #fff; }
.btn-image { background: #e67e22; color: #fff; }
.btn-cancel { background: #eee; color: #555; }
.btn-save   { background: #4a90e2; color: #fff; }

/* Memo grid */
main {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.memo-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  transition: box-shadow .2s;
}
.memo-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.12); }

/* 卡片头部：标签在左，编辑/删除按钮在右 */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.card-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.btn-delete, .btn-edit {
  background: none;
  border: none;
  color: #c7c7cc;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
  transition: color .15s, background .15s;
}
.btn-delete:hover { color: #ff3b30; background: #fff1f0; }
.btn-edit:hover   { color: #007aff; background: #f0f6ff; }

.memo-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}

.tag-text  { background: #dbeafe; color: #1d4ed8; }
.tag-link  { background: #dcfce7; color: #166534; }
.tag-image { background: #ffedd5; color: #9a3412; }

.memo-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a1a2e;
}

.memo-content {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  word-break: break-word;
}

.memo-content a {
  color: #4a90e2;
  text-decoration: none;
}

.memo-content a:hover { text-decoration: underline; }

.memo-content img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 6px;
}

.memo-time {
  font-size: 11px;
  color: #aaa;
  margin-top: 12px;
}

.btn-delete {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

/* Empty state */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #bbb;
  padding: 80px 0;
  font-size: 16px;
}

/* Modal */
.hidden { display: none !important; }

#modal-overlay,
#changepw-overlay,
#phd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

.modal h2 {
  margin-bottom: 20px;
  font-size: 18px;
}

.modal label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  margin-top: 14px;
}

.modal input[type="text"],
.modal input[type="url"],
.modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}

.modal input:focus,
.modal textarea:focus { border-color: #4a90e2; }

.modal textarea { resize: vertical; }

#img-preview {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* Header right section */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.username-label {
  font-size: 14px;
  font-weight: 600;
  color: #4a90e2;
}

.btn-user-action {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.btn-user-action:hover { background: #f0f0f0; border-color: #bbb; }
.btn-logout { color: #e74c3c; border-color: #fbb; }
.btn-logout:hover { background: #fdecea; border-color: #e74c3c; }

/* Auth page */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f4f6f9;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 40px;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}

.auth-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid #eee;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: #aaa;
  cursor: pointer;
  transition: color .15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.auth-tab.active { color: #4a90e2; border-bottom-color: #4a90e2; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: #4a90e2; }

.btn-auth {
  width: 100%;
  padding: 12px;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity .15s;
}
.btn-auth:hover { opacity: .88; }

.auth-err {
  color: #e74c3c;
  font-size: 13px;
  margin: 8px 0 4px;
}

.hint {
  font-weight: 400;
  color: #aaa;
  font-size: 12px;
}

/* 博士定位按钮 */
.btn-phd-match {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-phd-match:hover { opacity: .85; }
.btn-phd-match:disabled { opacity: .5; cursor: default; }

/* 博士定位结果面板 */
.phd-panel {
  margin-top: 12px;
  border: 1px solid #c6f6d5;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
.phd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f0fff4;
  cursor: pointer;
  font-weight: 600;
  color: #276749;
}
.phd-header:hover { background: #dcffe4; }
.phd-toggle { font-size: 12px; color: #48bb78; }
.phd-list { padding: 0 8px 8px; max-height: 600px; overflow-y: auto; }
.phd-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 4px;
}
.phd-item:last-child { border-bottom: none; }
.phd-rank {
  font-size: 11px;
  font-weight: 700;
  color: #38a169;
  margin-bottom: 5px;
  letter-spacing: .3px;
}
.phd-row {
  margin-bottom: 3px;
  line-height: 1.5;
  color: #333;
}
.phd-source {
  margin-top: 4px;
  font-size: 11px;
  color: #aaa;
}
.phd-region {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.phd-region-eu { background: #ebf8ff; color: #2b6cb0; }
.phd-region-us { background: #f0fff4; color: #276749; }
.phd-region-cn { background: #fff5f5; color: #c53030; }
.btn-phd-rematch {
  display: block;
  margin: 6px 8px 8px;
  padding: 4px 12px;
  background: none;
  border: 1px solid #9ae6b4;
  border-radius: 4px;
  color: #276749;
  font-size: 11px;
  cursor: pointer;
}
.btn-phd-rematch:hover { background: #f0fff4; }
.btn-phd-rematch:disabled { opacity: .5; cursor: default; }

/* ── Apple 风格操作栏 ─────────────────────────── */
.phd-actions {
  border-top: 1px solid #f2f2f7;
  background: #fafafa;
  border-radius: 0 0 8px 8px;
}

/* 全宽主操作行 */
.phd-action-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #3c3c43;
  background: none;
  border: none;
  border-bottom: 1px solid #f2f2f7;
  cursor: pointer;
  transition: background .12s;
  box-sizing: border-box;
}
.phd-action-primary svg { color: #8e8e93; }
.phd-action-primary:hover { background: #f2f2f7; }
.phd-action-primary:disabled { opacity: .4; cursor: default; }

/* 4 格等宽图标网格 */
.phd-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px 10px;
  gap: 2px;
}
.phd-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  font-size: 10px;
  font-weight: 500;
  color: #3c3c43;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.phd-icon-btn svg { color: #8e8e93; }
.phd-icon-btn:hover { background: #f2f2f7; }
.phd-icon-btn:disabled { opacity: .4; cursor: default; }
.phd-icon-share { color: #007aff; }
.phd-icon-share svg { color: #007aff; }
.phd-icon-share:hover { background: #f0f6ff; }

/* 复制成功提示 */
#copy-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  pointer-events: none;
}
#copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 分享弹窗 */
.share-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
}
.share-box {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  width: 480px;
  max-width: calc(100vw - 32px);
  z-index: 201;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.share-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 14px;
}
.share-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
  background: #f9f9f9;
  cursor: text;
  outline: none;
}
.share-input:focus { border-color: #4a90e2; }
.share-btns {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}
.share-copy-btn {
  padding: 8px 18px;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.share-copy-btn:hover { opacity: .88; }
.share-close-btn {
  padding: 8px 16px;
  background: #eee;
  color: #555;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.share-close-btn:hover { background: #e0e0e0; }

/* ═══════════════════════════════════════════
   RESPONSIVE DESIGN — 5 breakpoints
   xs  < 480px   (手机竖屏)
   sm  480–767px (手机横屏/小屏)
   md  768–1023px (iPad/平板)
   lg  1024–1439px (笔记本)
   xl  ≥ 1440px  (桌面宽屏)
═══════════════════════════════════════════ */

/* ════════════════════════════════════════════════════
   响应式断点系统
   xs  ≤ 479px   手机竖屏（iPhone SE / Android 小屏）
   sm  480–767px  大屏手机竖屏 / 手机横屏
   md  768–1023px iPad 竖屏 / 小平板
   lg  1024–1279px iPad 横屏 / 笔记本小屏
   xl  1280–1439px 笔记本标准屏 / Windows
   2xl ≥ 1440px  Mac / 宽屏显示器
   ════════════════════════════════════════════════════ */

/* ── xs 手机竖屏 (≤ 479px) ── */
@media (max-width: 479px) {
  /* Header：Logo + 按钮同行，user-info 第二行 */
  header {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  header h1 { font-size: 17px; flex-shrink: 0; }

  .header-right {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }

  /* 新建按钮组：三列均分 */
  .btn-group {
    display: flex;
    gap: 6px;
    width: 100%;
  }
  .btn-group .btn {
    flex: 1;
    padding: 9px 4px;
    font-size: 12px;
    text-align: center;
    min-height: 40px;
  }

  /* 用户操作行：用户名靠左，三个按钮靠右 */
  .user-info {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    flex-wrap: wrap;
  }
  .username-label { flex: 1; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-user-action { padding: 7px 9px; font-size: 11px; min-height: 34px; flex-shrink: 0; }

  /* 卡片列表：单列 */
  main {
    padding: 12px 14px 90px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Modal：从底部弹出，全宽 */
  #modal-overlay,
  #changepw-overlay,
  #phd-modal-overlay {
    align-items: flex-end;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 22px 18px 28px;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* PHD 操作按钮 */
  .phd-action-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .phd-icon-btn { font-size: 9px; padding: 7px 2px; min-height: 48px; }

  /* PHD 模式选择弹窗：竖向卡片 */
  .phd-opt-row { flex-direction: column; }
  .phd-mode-btn, .phd-prec-btn { padding: 11px 12px; }
}

/* ── sm 大屏手机竖屏 / 手机横屏 (480–767px) ── */
@media (min-width: 480px) and (max-width: 767px) {
  header { padding: 12px 20px; }
  header h1 { font-size: 18px; }
  .header-right { gap: 10px; }
  .btn-group { gap: 8px; }
  .btn { padding: 8px 13px; font-size: 13px; }
  .btn-user-action { padding: 7px 11px; font-size: 12px; }
  .username-label { font-size: 13px; }

  main {
    padding: 14px 18px 80px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Modal：居中弹出（非底部），宽度自适应 */
  .modal { width: calc(100vw - 40px); max-width: 460px; border-radius: 14px; }
  .phd-opt-row { flex-direction: column; }
}

/* ── md iPad 竖屏 / 小平板 (768–1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
  header { padding: 14px 28px; }
  header h1 { font-size: 20px; }
  .btn { padding: 8px 16px; font-size: 13px; }
  .btn-user-action { font-size: 13px; padding: 7px 13px; }
  .username-label { font-size: 14px; }

  main {
    padding: 20px 28px 32px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }

  /* Modal：居中，固定宽 */
  .modal { width: 540px; border-radius: 14px; }
  .phd-modal { max-width: 560px; }
}

/* ── lg iPad 横屏 / 笔记本小屏 (1024–1279px) ── */
@media (min-width: 1024px) and (max-width: 1279px) {
  header { padding: 15px 32px; }
  main {
    padding: 22px 32px;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
  }
  .modal { width: 540px; }
}

/* ── xl 笔记本标准屏 / Windows (1280–1439px) ── */
@media (min-width: 1280px) and (max-width: 1439px) {
  header { padding: 15px 40px; }
  main {
    padding: 24px 40px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
  }
}

/* ── 2xl Mac / 宽屏显示器 (≥ 1440px) ── */
@media (min-width: 1440px) {
  header { padding: 16px 56px; }
  main {
    padding: 28px 56px 40px;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
    max-width: 1840px;
    margin: 0 auto;
  }
  .modal { width: 560px; }
}

/* ── 手机横屏专项（高度 ≤ 500px 时） ── */
@media (orientation: landscape) and (max-height: 500px) {
  header { padding: 7px 20px; }
  header h1 { font-size: 16px; }
  .btn { padding: 6px 12px; font-size: 12px; }
  main { padding: 10px 20px 60px; gap: 10px; }

  /* 横屏手机 Modal：居中弹出，不从底部 */
  #modal-overlay,
  #changepw-overlay,
  #phd-modal-overlay { align-items: center; }
  .modal {
    border-radius: 14px;
    max-height: 85vh;
    width: calc(100vw - 48px);
    max-width: 520px;
    overflow-y: auto;
  }
}

/* ── 博士定位模式选择 Modal（组件样式，非断点） ── */
.phd-modal { max-width: 520px; }
.phd-opt-group { margin-top: 20px; }
.phd-opt-label { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 4px; }
.phd-opt-desc { font-size: 12px; color: #999; margin-bottom: 10px; }
.phd-opt-row { display: flex; gap: 10px; }
.phd-mode-btn,
.phd-prec-btn {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.phd-mode-btn:hover, .phd-prec-btn:hover { border-color: #4a90e2; background: #f0f6ff; }
.phd-mode-btn.active, .phd-prec-btn.active { border-color: #4a90e2; background: #ebf3ff; }
.phd-opt-icon { font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.phd-mode-btn b, .phd-prec-btn b { display: block; font-size: 13px; color: #222; margin-bottom: 3px; }
.phd-mode-btn small, .phd-prec-btn small { display: block; font-size: 11px; color: #888; line-height: 1.5; }

/* ── 触屏设备：统一加大点击目标（Apple HIG 44px 标准） ── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-user-action { min-height: 40px; }
  .btn-delete, .btn-edit { padding: 7px 9px; font-size: 18px; min-width: 36px; min-height: 36px; }
  .phd-action-primary { min-height: 44px; }
  .phd-icon-btn { min-height: 52px; }
}

/* ── iOS 安全区（刘海屏 / 灵动岛 / 底部 Home Bar） ── */
@supports (padding: max(0px)) {
  header {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  main {
    padding-bottom: max(32px, calc(env(safe-area-inset-bottom) + 20px));
  }
  /* 手机底部弹出 Modal 需留出 Home Bar 空间 */
  @media (max-width: 479px) {
    .modal {
      padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
    }
  }
}

/* ── 防滚动条抖动（Mac / Windows Chrome / Firefox） ── */
html { scrollbar-gutter: stable; }

/* ── 博士定位地区选择按钮 ── */
.phd-region-row { flex-wrap: wrap; }
.phd-region-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .15s, background .15s;
}
.phd-region-btn:hover { border-color: #4a90e2; background: #f0f6ff; }
.phd-region-btn.active { border-color: #4a90e2; background: #ebf3ff; font-weight: 600; }
.phd-region-btn .phd-opt-icon { font-size: 16px; }

/* ── 结构化博士申请背景模板 ── */
.phd-profile-builder {
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0 14px;
  background: #fafafa;
  max-height: 56vh;
  overflow-y: auto;
}
.phd-profile-section {
  border-top: 1px solid #ededf2;
  padding-top: 12px;
  margin-top: 12px;
}
.phd-profile-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #333;
}
.phd-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.phd-profile-builder label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 8px;
}
.phd-profile-builder input[type="text"],
.phd-profile-builder select,
.phd-profile-builder textarea {
  width: 100%;
  margin-top: 4px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  background: white;
  box-sizing: border-box;
}
.phd-profile-builder textarea {
  resize: vertical;
}
.phd-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-bottom: 10px;
}
.phd-check-grid label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  line-height: 1.4;
}
@media (max-width: 640px) {
  .phd-form-grid,
  .phd-check-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 博士定位来源链接 ── */
.source-links {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.source-link {
    font-size: 12px;
    color: #555;
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}
.source-link:hover {
    color: #222;
    border-color: #888;
    background: #f5f5f5;
}
.source-disclaimer {
    font-size: 11px;
    color: #aaa;
    margin-left: 4px;
}

.phd-progress {
    margin: 8px 0 4px;
    padding: 8px 12px;
    background: #f0f7ff;
    border: 1px solid #c3dafe;
    border-radius: 8px;
    font-size: 13px;
    color: #3b5bdb;
    transition: opacity 0.4s;
}
.phd-progress.hidden {
    display: none;
}

/* ── 顶部功能模块按钮 ── */
.btn-phd     { background: #4F46E5; color: white; }
.btn-research{ background: #059669; color: white; }
.btn-idea    { background: #DC2626; color: white; }
.btn-phd:hover      { background: #4338CA; }
.btn-research:hover { background: #047857; }
.btn-idea:hover     { background: #B91C1C; }
