/* ==========================================================
   患者投稿页面样式
   主题：温馨 · 暖意 · 自适应
   如需调整配色，改 :root 中的变量即可
   ========================================================== */
:root {
  --bg: #FDF6EF;              /* 奶油底色 */
  --bg-deep: #FBEADD;
  --card: #FFFFFF;
  --primary: #E8855B;         /* 蜜桃橙 */
  --primary-deep: #D96A42;
  --primary-soft: #F7C9B2;
  --accent: #F2A98C;          /* 浅杏 */
  --gold: #F3C07C;            /* 暖金点缀 */
  --rose: #E89A84;
  --ink: #5C4637;             /* 暖棕正文 */
  --ink-soft: #8A7567;
  --line: #F3E2D3;
  --shadow: 0 10px 30px rgba(214, 130, 90, .14);
  --shadow-soft: 0 4px 14px rgba(214, 130, 90, .10);
  --radius: 18px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -80px, #FBE6D3 0%, rgba(251,230,211,0) 60%),
    radial-gradient(900px 420px at -10% 10%, #FBEEDA 0%, rgba(251,238,218,0) 55%),
    var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { display: inline-flex; }
.brand-name { font-size: 19px; font-weight: 700; color: var(--primary-deep); letter-spacing: .5px; }
.topbar-tag {
  font-size: 13px; color: var(--primary-deep);
  background: #FFEADD; border: 1px solid #F7C9B2;
  padding: 4px 14px; border-radius: 999px;
}

/* ---------- 欢迎横幅 ---------- */
.hero { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #FBD9B6 0%, #F6B18B 48%, #EF9A7C 100%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.28) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  opacity: .5;
}
.sun {
  position: absolute; right: 6%; top: 14%;
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFEFC9, #FFD98A 70%);
  box-shadow: 0 0 40px rgba(255, 214, 130, .75);
  opacity: .9;
}
.blob { position: absolute; border-radius: 50%; opacity: .34; }
.b1 { width: 220px; height: 220px; left: -70px; bottom: -90px; background: #F9C59E; }
.b2 { width: 150px; height: 150px; right: 16%; bottom: -60px; background: #FFDDC2; }
.b3 { width: 90px; height: 90px; left: 26%; top: -40px; background: #FDE2C8; }

.hero-inner {
  position: relative; max-width: 1080px; margin: 0 auto;
  padding: 74px 20px 80px; text-align: center; color: #5C3A28;
}
.hero-kicker {
  font-size: 13px; letter-spacing: 5px; margin-bottom: 14px;
  color: #8C5B3F; font-weight: 600;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.hero-sub { margin-top: 16px; font-size: clamp(15px, 2.4vw, 17px); color: #7A4F38; }
.br-pc { display: inline; }

/* ---------- 主体布局 ---------- */
.layout {
  max-width: 1080px; margin: -34px auto 0; padding: 0 20px 60px;
  display: grid; grid-template-columns: 340px 1fr; gap: 26px; align-items: start;
  position: relative; z-index: 2;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #F7E6D6;
}

/* ---------- 左栏 ---------- */
.intro-card { padding: 26px 24px; }
.intro-card h2 { font-size: 20px; color: var(--primary-deep); margin-bottom: 12px; }
.intro-card h3 { font-size: 15px; color: var(--ink); margin: 18px 0 10px; }
.intro-card p { font-size: 14.5px; color: var(--ink-soft); }

.type-list { list-style: none; margin: 4px 0 18px; }
.type-list li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink); padding: 5px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot1 { background: #F6A98C; }
.dot2 { background: #F3C07C; }
.dot3 { background: #E9967E; }
.dot4 { background: #EFB495; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFF6EE; border: 1px solid #F6DECB;
  border-radius: 12px; padding: 12px 13px; margin-top: 12px;
  color: var(--ink-soft); font-size: 13.5px;
}
.notice svg { flex: none; color: var(--primary); margin-top: 3px; }
.notice-soft { background: #FFFBF3; border-color: #F2E4C8; }
.notice-soft svg { color: #C99A4A; }

/* ---------- 表单 ---------- */
.form-card { padding: 30px 30px 26px; }
.form-title { font-size: 22px; color: var(--primary-deep); }
.form-tip { font-size: 13px; color: var(--ink-soft); margin: 2px 0 20px; }
.req { color: #D9574B; }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label {
  display: block; font-size: 14.5px; font-weight: 600; color: var(--ink);
  margin-bottom: 7px;
}
.field label em { font-style: normal; font-weight: 400; color: var(--ink-soft); font-size: 12.5px; }
.field input[type="text"],
.field select,
.field textarea {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: #FFFDFB; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 133, 91, .15);
}
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23D96A42' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.field textarea { resize: vertical; min-height: 130px; }
.counter { text-align: right; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* 上传区 */
.dropzone {
  border: 2px dashed #EDC3A8; border-radius: 14px; background: #FFFAF4;
  padding: 26px 16px; text-align: center; cursor: pointer; transition: all .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #FFF3E8; }
.dropzone.dragover { transform: scale(1.01); }
.dropzone-icon { color: var(--primary); display: flex; justify-content: center; }
.dropzone-text { font-size: 14.5px; color: var(--ink); margin-top: 6px; }
.dropzone-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.preview-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.preview-item {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #F7EFE6;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-item .del {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px;
  border-radius: 50%; border: none; cursor: pointer;
  background: rgba(60, 40, 28, .62); color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.preview-item .del:hover { background: #D9574B; }
.upload-error { color: #D9574B; font-size: 13px; margin-top: 8px; }

/* 勾选项 */
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); margin: 12px 0; cursor: pointer; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--primary-deep); cursor: pointer; }
.check span { line-height: 1.5; }

/* 提交按钮 */
.submit-btn {
  width: 100%; margin-top: 6px;
  border: none; cursor: pointer; border-radius: 999px; padding: 14px;
  font-family: inherit; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 2px;
  background: linear-gradient(135deg, #F2A98C 0%, #E8855B 45%, #D96A42 100%);
  box-shadow: 0 8px 20px rgba(217, 106, 66, .32);
  transition: transform .15s, box-shadow .2s, filter .2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(217,106,66,.4); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { filter: grayscale(.25) brightness(.98); cursor: not-allowed; }
.btn-spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-msg { margin-top: 14px; padding: 11px 14px; border-radius: 10px; font-size: 14px; }
.form-msg.error { background: #FDEAE7; color: #C23B30; border: 1px solid #F6C8C1; }
.form-msg.success { background: #EAF7EC; color: #2E7D4F; border: 1px solid #BFE5CB; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 26px 20px; text-align: center; }
.footer p { font-size: 14px; color: var(--primary-deep); font-weight: 600; }
.footer-sub { font-size: 13px; color: var(--ink-soft); font-weight: 400; margin-top: 4px; }

/* ---------- 成功弹层 ---------- */
.success-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(92, 62, 42, .42); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.success-mask[hidden] { display: none; }
.success-box {
  background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(120,70,40,.3);
  max-width: 380px; width: 100%; padding: 36px 28px 30px; text-align: center;
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-icon { margin-bottom: 10px; }
.success-box h3 { font-size: 20px; color: var(--primary-deep); margin-bottom: 8px; }
.success-box p { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 20px; line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; margin-top: -26px; }
  .hero-inner { padding: 56px 20px 66px; }
  .br-pc { display: none; }
}

@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-card { padding: 22px 18px 20px; }
  .intro-card { padding: 22px 18px; }
  .preview-list { grid-template-columns: repeat(3, 1fr); }
  .topbar-tag { display: none; }
  .brand-name { font-size: 17px; }
  .layout { padding: 0 14px 40px; }
  .hero-inner { padding: 48px 14px 58px; }
}

/* ==========================================================
   分享功能样式
   ========================================================== */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.share-top-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #F0C9B2; background: #FFF7F0; color: var(--primary-deep);
  font-size: 13px; font-family: inherit; cursor: pointer;
  padding: 5px 13px; border-radius: 999px; transition: all .2s;
}
.share-top-btn:hover { background: #FFEBDD; transform: translateY(-1px); }

/* 右下角悬浮分享按钮 */
.share-float-btn {
  position: fixed; right: 22px; bottom: 26px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #F2A98C 0%, #E8855B 50%, #D96A42 100%);
  box-shadow: 0 8px 22px rgba(217, 106, 66, .4);
  transition: transform .2s, box-shadow .2s;
}
.share-float-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 28px rgba(217,106,66,.5); }
.share-float-btn:active { transform: translateY(0) scale(.98); }

/* 分享弹层 */
.share-mask {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(92, 62, 42, .42); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.share-mask[hidden] { display: none; }
.share-box {
  position: relative; background: #fff; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(120,70,40,.3);
  max-width: 340px; width: 100%; padding: 28px 24px 22px; text-align: center;
  animation: pop .3s ease;
}
.share-close {
  position: absolute; top: 10px; right: 14px; border: none; background: none;
  font-size: 22px; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: 4px;
}
.share-close:hover { color: var(--ink); }
.share-box h3 { font-size: 18px; color: var(--primary-deep); margin-bottom: 4px; }
.share-tip { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.share-qr {
  display: inline-flex; padding: 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
}
.share-qr canvas, .share-qr img, .share-qr svg { display: block; }
.share-link-row { display: flex; gap: 8px; margin-top: 16px; }
.share-link-row input {
  flex: 1; min-width: 0; font-size: 13px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 10px; background: #FFFDFB;
}
.share-copy-btn {
  flex: none; border: none; cursor: pointer; border-radius: 9px; padding: 0 16px;
  background: linear-gradient(135deg, #F2A98C, #D96A42); color: #fff;
  font-size: 14px; font-family: inherit; font-weight: 600; transition: filter .2s;
}
.share-copy-btn:hover { filter: brightness(1.06); }
.share-hint { margin-top: 10px; font-size: 12.5px; color: #2E7D4F; }
.share-hint[hidden] { display: none; }
