/* AI 画室 H5 —— 移动优先，微信/Safari 兼容 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 关键：作者样式会压过浏览器默认的 [hidden]{display:none}，
   没有 !important 时 .screen{display:flex} 会让 hidden 失效、三屏同显 */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #f8f9ff 0%, #eef1fb 100%);
  color: #23263b;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.screen { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); flex: 1; display: flex; flex-direction: column; }

/* ---- 首页 ---- */
.hero { text-align: center; padding: 34px 0 26px; }
.logo { font-size: 56px; line-height: 1; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-8px);} }
.hero h1 { font-size: 30px; margin-top: 12px; letter-spacing: 2px; }
.sub { color: #7a7f9a; margin-top: 10px; line-height: 1.7; font-size: 15px; }

.entries { display: flex; flex-direction: column; gap: 16px; }
.entry {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: #fff; border: none; border-radius: 20px; padding: 20px 22px;
  box-shadow: 0 6px 24px rgba(70, 90, 200, .10);
  text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.entry:active { transform: scale(.97); box-shadow: 0 2px 10px rgba(70,90,200,.12); }
.entry-icon { font-size: 34px; }
.entry-title { font-size: 19px; font-weight: 700; margin-top: 6px; }
.entry-desc { font-size: 13px; color: #8a8fa8; }

/* ---- 访问码 ---- */
.code-card {
  background: #fff; border-radius: 20px; padding: 22px;
  box-shadow: 0 6px 24px rgba(70,90,200,.10); margin-bottom: 20px;
}
.code-card h2 { font-size: 17px; }
.code-hint { color: #9a9eb8; font-size: 13px; margin: 8px 0 14px; }
.code-row { display: flex; gap: 10px; }
#code-input {
  flex: 1; border: 2px solid #e4e7f5; border-radius: 12px; padding: 12px 14px;
  font-size: 20px; letter-spacing: 8px; text-align: center; font-weight: 700;
  font-family: inherit; min-width: 0;
}
#code-input:focus { outline: none; border-color: #5b6cf0; }
.code-row .btn { flex: 0 0 auto; padding: 12px 22px; }
.code-error { color: #e05b5b; font-size: 13px; margin-top: 10px; }

.recent-wrap { margin-top: 28px; }
.recent-wrap h2 { font-size: 15px; color: #7a7f9a; margin-bottom: 10px; }
.recent-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.recent-list img {
  width: 88px; height: 117px; object-fit: cover; border-radius: 12px;
  background: #fff; box-shadow: 0 3px 10px rgba(70,90,200,.10); flex-shrink: 0;
}

/* ---- 顶栏 ---- */
.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.back { background: none; border: none; font-size: 16px; color: #5a5f7d; padding: 6px 4px; cursor: pointer; }
.bar-title { font-size: 17px; font-weight: 700; }

/* ---- 输入屏 ---- */
.photo-preview {
  background: #fff; border-radius: 18px; min-height: 300px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(70,90,200,.08); overflow: hidden; margin-bottom: 16px;
}
.photo-preview img { width: 100%; max-height: 420px; object-fit: contain; }
.photo-preview .hint { color: #a0a4bd; font-size: 14px; line-height: 1.9; text-align: center; }

.btn-row { display: flex; gap: 12px; margin: 14px 0; }
.btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 14px; padding: 14px 18px; font-size: 16px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn.big { width: 100%; margin-top: 4px; padding: 16px; font-size: 17px; }
.btn.primary { background: linear-gradient(135deg, #5b6cf0, #7a5cf0); color: #fff; box-shadow: 0 6px 18px rgba(91,108,240,.35); }
.btn.secondary { background: #fff; color: #5b6cf0; box-shadow: 0 3px 12px rgba(70,90,200,.12); }
.btn:disabled { opacity: .45; pointer-events: none; }

textarea {
  width: 100%; border: none; border-radius: 16px; padding: 16px; font-size: 16px;
  background: #fff; box-shadow: 0 4px 18px rgba(70,90,200,.08); resize: none;
  font-family: inherit; line-height: 1.6; min-height: 110px;
}
textarea:focus { outline: 2px solid #b9c0ff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip {
  background: #fff; border: 1px solid #dfe3f5; color: #5a5f7d;
  border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.chip:active { background: #eef0ff; }

/* ---- 结果屏 ---- */
.progress-card {
  background: #fff; border-radius: 20px; padding: 36px 24px; text-align: center;
  box-shadow: 0 6px 24px rgba(70,90,200,.10); margin-top: 8vh;
}
.spinner {
  width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid #e4e7f8; border-top-color: #5b6cf0; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg);} }
.stage-text { font-size: 18px; font-weight: 700; min-height: 26px; }
.progress-track { height: 8px; background: #edeffa; border-radius: 99px; margin: 18px 12px 10px; overflow: hidden; }
#progress-bar { height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, #5b6cf0, #9a5cf0); transition: width .8s ease; }
.elapsed { color: #9a9eb8; font-size: 13px; }
.tip { color: #b0b4cc; font-size: 13px; margin-top: 20px; }

.view-toggle { display: flex; background: #e9ebf7; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tab { flex: 1; border: none; background: none; padding: 10px; border-radius: 9px;
  font-size: 15px; font-weight: 600; color: #7a7f9a; cursor: pointer; }
.tab.active { background: #fff; color: #5b6cf0; box-shadow: 0 2px 8px rgba(70,90,200,.15); }

.stage-box { background: #fff; border-radius: 18px; padding: 10px;
  box-shadow: 0 4px 18px rgba(70,90,200,.08); }
.artwork { width: 100%; border-radius: 12px; display: block; background: #fff; }
#anim-box svg { width: 100%; height: auto; display: block; }

.prompt-line { color: #9a9eb8; font-size: 13px; margin-top: 12px; line-height: 1.6; }
.error-line { color: #e05b5b; font-size: 14px; margin-top: 12px; line-height: 1.6; word-break: break-all; }
