/* 许峰声呐AI工作室 · 从业者专属个人主页（3套专业行业模板） */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --ink: #111827;
  --ink-secondary: #4b5563;
  --ink-muted: #6b7280;
  --primary: #111827;
  --primary-fg: #ffffff;
  --accent: #1d4ed8;
  --alert: #c8322b;
  --confirm: #15803d;
  --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.12);
}

/* 模板 2：水下工程与商业打捞画册风（深炭工业质感） */
body[data-template="salvage"] {
  --bg: #0c0f15;
  --surface: #141923;
  --surface-subtle: #1b2230;
  --border: #263042;
  --border-strong: #37445c;
  --ink: #f3f4f6;
  --ink-secondary: #cbd5e1;
  --ink-muted: #8b9bb4;
  --primary: #f3f4f6;
  --primary-fg: #0c0f15;
  --accent: #60a5fa;
  --alert: #f87171;
  --confirm: #4ade80;
}

/* 模板 3：技术专家与教研档案风（温润纸感杂志排版） */
body[data-template="expert"] {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-subtle: #f2f0ea;
  --border: #e3dfd5;
  --border-strong: #cfc9bc;
  --ink: #18181b;
  --ink-secondary: #44403c;
  --ink-muted: #78716c;
  --primary: #1c1917;
  --primary-fg: #fafaf9;
  --accent: #1e40af;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 13.5px; -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }

/* 顶栏 */
.prof-header {
  height: 58px; padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.prof-header-inner {
  max-width: 1180px; height: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.head-left, .head-right { display: flex; align-items: center; gap: 10px; }
.prof-logo { height: 26px; width: auto; display: block; object-fit: contain; }

.btn {
  border: 1px solid transparent; border-radius: 7px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.14s, border-color 0.14s, opacity 0.14s; white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-subtle); }
.btn-ghost { background: transparent; color: var(--ink-secondary); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-subtle); color: var(--ink); }
.btn-danger { background: transparent; color: var(--alert); border-color: rgba(200, 50, 43, 0.35); }
.btn-danger:hover:not(:disabled) { background: rgba(200, 50, 43, 0.08); }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 5px; }

/* 主容器 */
.prof-main { max-width: 1180px; margin: 0 auto; padding: 22px 24px 64px; display: flex; flex-direction: column; gap: 20px; }

/* 顶部个人名片封面卡片 */
.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.hero-cover {
  height: 230px; position: relative; background: #0e1117; overflow: hidden;
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-cover-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 14, 20, 0.12) 0%, rgba(11, 14, 20, 0.65) 100%);
}
.tpl-pill {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  background: rgba(15, 23, 42, 0.72); color: #f3f4f6;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px;
  padding: 4px 11px; font-size: 11px; font-weight: 500;
}

.hero-body {
  padding: 14px 28px 24px; position: relative;
}
.hero-identity-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.hero-avatar-group { display: flex; align-items: flex-start; gap: 18px; }
.prof-avatar-wrap {
  position: relative; margin-top: -54px; flex-shrink: 0;
}
.prof-avatar {
  width: 92px; height: 92px; border-radius: 16px; flex-shrink: 0;
  background: #111827; color: #ffffff; border: 4px solid var(--surface);
  font-size: 32px; font-weight: 700; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}
.prof-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit-overlay {
  position: absolute; inset: 4px; border-radius: 12px;
  background: rgba(15, 23, 42, 0.68); color: #ffffff;
  font-size: 12px; font-weight: 600; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.prof-avatar-wrap:hover .avatar-edit-overlay { opacity: 1; }

.hero-name-block { padding-top: 2px; }
.hero-name-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hero-name-line h1 { margin: 0; font-size: 23px; font-weight: 700; color: var(--ink); }
.verified-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(21, 128, 61, 0.12); color: var(--confirm); border: 1px solid rgba(21, 128, 61, 0.3);
}
.hero-org-line {
  margin-top: 4px; font-size: 13px; color: var(--ink-secondary);
}
.hero-headline {
  margin: 0 0 14px; font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.6;
}
.coop-row { display: flex; flex-wrap: wrap; gap: 7px; }
.coop-pill {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 6px;
  background: var(--surface-subtle); color: var(--ink-secondary); border: 1px solid var(--border);
}

/* 模板 3（技术专家风）顶部平台实绩背书条 */
.expert-cred-strip {
  display: none;
  grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 16px 24px; background: var(--surface-subtle); border-top: 1px solid var(--border);
}
body[data-template="expert"] .expert-cred-strip { display: grid; }
@media (max-width: 720px) { .expert-cred-strip { grid-template-columns: repeat(2, 1fr); } }
.ec-num { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ec-lbl { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

/* 主内容双栏布局 */
.prof-grid {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start;
}
@media (max-width: 900px) { .prof-grid { grid-template-columns: 1fr; } }
.prof-col { display: flex; flex-direction: column; gap: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-head h2 { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.card-sub { font-size: 11.5px; color: var(--ink-muted); }

.bio-text {
  margin: 0; font-size: 13.5px; line-height: 1.78; color: var(--ink-secondary); white-space: pre-wrap;
}

/* 优势与装备标签 */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.strength-tag {
  padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-subtle); color: var(--ink); border: 1px solid var(--border);
}
.equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.equip-item {
  padding: 11px 13px; border-radius: 8px; background: var(--surface-subtle);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px;
}
.equip-item strong { font-size: 13px; color: var(--ink); }
.equip-item span { font-size: 11.5px; color: var(--ink-muted); }

/* 履历与代表合作项目时间线 */
.timeline-list { display: flex; flex-direction: column; gap: 14px; }
.tl-item {
  padding: 14px 16px; border-radius: 9px; background: var(--surface-subtle);
  border: 1px solid var(--border); border-left: 3px solid var(--ink);
  display: flex; flex-direction: column; gap: 6px;
}
.tl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.tl-period { font-size: 11.5px; color: var(--ink-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tl-role { font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.tl-desc { font-size: 12.5px; color: var(--ink-secondary); line-height: 1.65; white-space: pre-wrap; }

/* 200MB 实拍图片与视频作品墙 */
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px;
}
.media-card {
  border-radius: 9px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-subtle); cursor: pointer; display: flex; flex-direction: column;
  transition: border-color 0.14s, transform 0.14s;
}
.media-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.media-thumb {
  aspect-ratio: 16 / 10; background: #0c0e12; position: relative; overflow: hidden;
}
.media-thumb img, .media-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.media-type-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(15, 23, 42, 0.8); color: #ffffff;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
}
.media-cap {
  padding: 9px 11px; font-size: 12px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 右栏平台实绩与联系卡 */
.stat-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat-mini {
  padding: 12px 8px; border-radius: 8px; background: var(--surface-subtle); border: 1px solid var(--border);
}
.stat-mini strong { display: block; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-mini span { font-size: 11px; color: var(--ink-muted); }

.contact-box {
  padding: 13px 14px; border-radius: 8px; background: var(--surface-subtle);
  border: 1px solid var(--border); font-size: 12.5px; line-height: 1.65; color: var(--ink-secondary);
}

/* 存储配额条 */
.quota-bar-wrap {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border-radius: 8px; background: var(--surface-subtle); border: 1px solid var(--border);
}
.quota-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-secondary); }
.quota-track { height: 7px; border-radius: 99px; background: var(--border); overflow: hidden; }
.quota-fill { height: 100%; width: 0%; background: var(--ink); transition: width 0.25s; }

/* 弹窗与编辑器 */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.62); backdrop-filter: blur(3px); }
.modal-dialog {
  position: relative; z-index: 2; width: min(760px, 95vw); max-height: 90vh;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-md);
}
.modal-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }

/* 3套模板选择卡片 */
.tpl-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .tpl-picker { grid-template-columns: 1fr; } }
.tpl-option {
  border: 1.5px solid var(--border); border-radius: 9px; padding: 12px;
  cursor: pointer; background: var(--surface-subtle); text-align: left; color: var(--ink);
  display: flex; flex-direction: column; gap: 4px;
}
.tpl-option.active { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08); }
.tpl-option strong { font-size: 13px; }
.tpl-option span { font-size: 11.5px; color: var(--ink-muted); line-height: 1.45; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.field input[type="text"], .field textarea, .field select {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong);
  border-radius: 7px; font-size: 13px; font-family: inherit;
  color: var(--ink); background: var(--surface);
}
.field textarea { min-height: 76px; resize: vertical; line-height: 1.55; }

.proj-editor-row {
  padding: 12px; border-radius: 8px; background: var(--surface-subtle);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
}

.media-mgr-list { display: flex; flex-direction: column; gap: 8px; }
.media-mgr-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 8px; background: var(--surface-subtle); border: 1px solid var(--border);
}
.media-mgr-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.media-mgr-thumb { width: 52px; height: 38px; border-radius: 5px; object-fit: cover; background: #0c0e12; flex-shrink: 0; }

.alert-err {
  padding: 9px 12px; border-radius: 7px; font-size: 12.5px;
  background: rgba(200, 50, 43, 0.1); color: var(--alert); border: 1px solid rgba(200, 50, 43, 0.3);
}
.empty-muted { font-size: 12.5px; color: var(--ink-muted); padding: 12px 0; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 95;
  background: var(--primary); color: var(--primary-fg); padding: 9px 18px;
  border-radius: 7px; font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-md);
}
.poster-style-picker {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px;
  background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 9px;
}
.poster-style-btn {
  border: none; background: transparent; color: var(--ink-secondary);
  padding: 6px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background 0.14s, color 0.14s;
}
.poster-style-btn:hover { color: var(--ink); }
.poster-style-btn.active {
  background: var(--primary); color: var(--primary-fg);
}
.poster-bg-picker-wrap {
  width: 100%; display: flex; flex-direction: column; gap: 6px;
}
.poster-bg-label {
  font-size: 11.5px; color: var(--ink-muted); text-align: center;
}
.poster-bg-picker {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  flex-wrap: wrap;
}
.poster-bg-thumb {
  width: 58px; height: 40px; border-radius: 6px; padding: 0; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: #0f172a;
  transition: border-color 0.14s, transform 0.14s;
}
.poster-bg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-bg-thumb:hover { transform: translateY(-1px); border-color: var(--ink-muted); }
.poster-bg-thumb.active { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.14); }
