:root{
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand2: #1d4ed8;
  --okbg: #ecfdf5;
  --ok: #065f46;
  --warnbg: #fff7ed;
  --warn: #9a3412;
}

body{
  margin: 0;
  min-height: calc(100vh - 96px);
  padding: 48px 0;
  overflow-x: hidden;
  background: var(--bg);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
}

.container{
  width: min(860px, 92vw);
  background: var(--card);
  border-radius: 22px;
  padding: 40px 44px;
  box-shadow: 0 20px 55px rgba(17,24,39,.10);
}

/* 顶栏 */
.topbar{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar h1{
  margin: 0;
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:flex-start;
}

/* 语言切换 */
.lang-switch{
  display:flex;
  gap: 8px;
}

.lang-btn{
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  font-weight: 650;
  cursor: pointer;
}

.lang-btn.active{
  background: var(--brand) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* step 容器 */
section{
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  padding: 22px 24px;
  margin: 18px 0;
}

section h2{
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

section p{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* 表单与字段 */
.field{
  width: 100%;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

input[type="file"]{
  width: 100%;
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  margin: 10px 0;
}

.actions{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* 按钮 */
button{
  background: var(--brand) !important;
  border: none;
  border-radius: 12px !important;
  padding: 10px 16px !important;
  font-weight: 650;
  cursor: pointer;
}

button:hover{
  background: var(--brand2) !important;
}

button:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* 上传 form（Step5） */
#upload-form{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 16px;
}

/* 知情同意 / 提示卡片 */
.consent-card{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  margin-top: 12px;
}

.consent-toolbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(245,247,251,.6);
}

.consent-title{
  font-weight: 650;
  color: var(--text);
  font-size: 14px;
}

.consent-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  text-decoration:none;
  font-weight: 650;
  font-size: 13px;
}

.btn-link:hover{
  background: var(--brand2);
}

/* 同意书正文容器 */
#consent-text{
  max-height: 35vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
  line-height: 1.7;
  background: #fff;
}

.consent-text p{
  margin: 6px 0;
  color: var(--text);
}

.consent-confirm{
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
}

/* 结果区 */
.preview-img{
  display: block;
  max-width: 60%;
  max-height: 60%;
  width: auto;
  margin: 10px auto;
  border-radius: 14px !important;
  border: 1px solid var(--line) !important;
}

.result-box{
  border-radius: 16px !important;
  text-align: center;
  border: 1px solid var(--line);
  padding: 16px;
}

.result-box.safe{
  background: var(--okbg) !important;
  color: var(--ok) !important;
  border-color: rgba(6,95,70,.25) !important;
}

.result-box.danger{
  background: var(--warnbg) !important;
  color: var(--warn) !important;
  border-color: rgba(154,52,18,.25) !important;
}

/* 页脚 */
.site-footer{
  width: 100%;
  margin-top: 24px;
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
}

.footer-content{
  width: min(860px, 92vw);
  margin: 0 auto;
}

.site-footer a{
  color: var(--brand);
  text-decoration: none;
}

.site-footer a:hover{
  text-decoration: underline;
}

.footer-block{
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.footer-title{
  font-weight: 600;
  margin-bottom: 6px;
}

.footer-list{
  margin: 0;
  padding-left: 16px;
  line-height: 1.6;
}

.footer-label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.footer-emails{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-emails a{
  font-size: 13px;
}

section[data-step="5"] .consent-text{
  padding: 16px 18px;
  line-height: 1.7;
}

section[data-step="5"] .consent-text p{
  color: var(--muted);
  margin: 6px 0;
}

#ultra-panel > summary{
  cursor: pointer;
  list-style: none;
}
#ultra-panel > summary::-webkit-details-marker{
  display: none;
}

/* ===== Compact mode (global) ===== */
:root{
  --compact-scale: .92;   /* 改这里：.90 更小，.95 更大 */
}

body{
  font-size: 14px; /* 原来默认可能更大，先稳住 */
}

.container{
  transform: scale(var(--compact-scale));
  transform-origin: top center;
}

/* 缩放后会占用空间变小，用负 margin 拉回来一点，避免下面空太多 */
.container{
  margin-top: -18px;
}

/* 同时把整体上下留白缩一点 */
body{
  padding: 32px 0;
  min-height: calc(100vh - 64px);
}
