*{box-sizing:border-box}
body{margin:0;font-family:Arial,"Microsoft YaHei",sans-serif;background:#faf5f7;color:#333;-webkit-text-size-adjust:100%}
header{padding:14px 14px;background:#fff;border-bottom:1px solid #efdde5;position:sticky;top:0;z-index:10}
h1{font-size:19px;margin:0;color:#c87592}
h2{font-size:16px;color:#c87592;margin:8px 0 12px}
p{margin:6px 0;color:#888;font-size:13px}
.layout{display:flex;flex-direction:column;gap:12px;padding:12px;max-width:760px;margin:0 auto}
.panel,.preview,.excelPanel{background:#fff;border:1px solid #efdde5;border-radius:16px;padding:14px;box-shadow:0 6px 16px rgba(0,0,0,.04);width:100%}
.panel{order:1;height:auto;overflow:visible}
.preview{order:2;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:auto;position:sticky;top:76px;z-index:5}
.excelPanel{order:3;overflow:hidden}
.excelHeader{display:flex;align-items:center;justify-content:space-between;gap:10px}
label{display:block;margin-top:12px;margin-bottom:6px;font-size:14px;color:#555}
input,select,button{width:100%;min-height:46px;border:1px solid #ddd;border-radius:12px;padding:0 12px;background:#fff;font-size:16px}
input[type=file]{height:auto;padding:10px;font-size:14px}
button{margin-top:10px;background:#f3bfd0;color:#fff;border:0;font-weight:700;cursor:pointer;min-height:46px}
.primary{background:#c87592}
.danger{background:#999;width:auto;min-width:78px;min-height:40px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.dataBox{margin-top:14px;padding:12px;background:#fff6f9;border:1px solid #f2d8e2;border-radius:12px;line-height:1.9;font-size:15px}
.note{font-size:12.5px;line-height:1.55;color:#888}
hr{border:0;border-top:1px solid #eee;margin:18px 0}
canvas{width:100%;max-width:100%;height:auto;background:#fff;border-radius:14px;box-shadow:0 8px 20px rgba(0,0,0,.08);touch-action:none}
.tableWrap{overflow:auto;border:1px solid #eee;border-radius:12px;max-height:360px;-webkit-overflow-scrolling:touch}
table{border-collapse:collapse;width:100%;min-width:520px;font-size:14px}
th,td{border-bottom:1px solid #eee;border-right:1px solid #f2f2f2;padding:9px 10px;text-align:center;white-space:nowrap}
th{background:#fff6f9;color:#9b4e6a;position:sticky;top:0}
td[contenteditable=true]{background:#fffdfd;cursor:text}
td[contenteditable=true]:focus{outline:2px solid #f3bfd0;background:#fff6f9}

@media (min-width: 900px){
  .layout{display:grid;grid-template-columns:350px minmax(420px,1fr);grid-template-rows:auto auto;max-width:1180px}
  .panel{grid-row:1/3;order:unset;height:calc(100vh - 112px);overflow:auto}
  .preview{order:unset;position:static;min-height:620px}
  .excelPanel{order:unset;height:auto}
}

@media (max-width: 520px){
  header{padding:12px}
  h1{font-size:17px}
  header p{font-size:12px}
  .layout{padding:10px;gap:10px}
  .panel,.preview,.excelPanel{padding:12px;border-radius:14px}
  .preview{top:68px}
  input,select,button{font-size:16px;min-height:45px}
  .grid2{gap:8px}
  .dataBox{font-size:14px}
}

.installTip{
  max-width:760px;
  margin:10px auto 0;
  padding:10px 12px;
  background:#fff6f9;
  border:1px solid #f2d8e2;
  border-radius:14px;
  color:#9b4e6a;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:13px;
}
.installTip button{
  width:auto;
  min-height:36px;
  padding:0 12px;
  margin:0;
  background:#c87592;
  white-space:nowrap;
}
@media (max-width:520px){
  .installTip{margin:8px 10px 0;align-items:flex-start;flex-direction:column}
  .installTip button{width:100%}
  .preview{position:relative;top:auto}
}
