* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
       background: #fdf6ec; color: #333; }
/* 定高 62px：.workbench 的高度 calc(100vh - 62px) 依赖它，改动需两处同步 */
.topbar { display: flex; justify-content: space-between; align-items: center;
          height: 62px; padding: 0 24px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.logo { font-size: 22px; font-weight: 700; text-decoration: none; color: #ff7043; }
.topbar-right { display: flex; gap: 12px; align-items: center; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 999px;
       border: none; cursor: pointer; font-size: 16px; text-decoration: none;
       text-align: center; }
.btn-primary { background: #ff7043; color: #fff; }
.btn-ghost { background: transparent; color: #666; }
.btn-voice { background: #fff; color: #ff7043; border: 2px solid #ff7043;
             flex-shrink: 0; }
.btn-voice.rec { background: #ff5252; border-color: #ff5252; color: #fff;
                 animation: voice-pulse 1s infinite; }
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.page { max-width: 1080px; margin: 0 auto; padding: 24px; }
.hero { text-align: center; padding: 32px 0 8px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; }
.hero p { color: #8d6e63; margin: 0 0 20px; }
.search-box { max-width: 560px; margin: 0 auto 12px; position: relative; }
.search-box input { width: 100%; padding: 14px 20px; border-radius: 999px;
                    border: 2px solid #ffe0b2; font-size: 17px; outline: none; }
.search-box input:focus { border-color: #ff7043; }
.similar-bar { max-width: 560px; margin: 0 auto 20px; }
.similar-chip { display: inline-flex; align-items: center; gap: 6px;
                background: #fff3e0; border: 1px solid #ffe0b2;
                border-radius: 999px; padding: 6px 14px; margin: 4px;
                font-size: 14px; }
.similar-chip a { color: #e65100; text-decoration: none; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
             gap: 20px; margin-top: 12px; }
.game-card { background: #fff; border-radius: 20px; overflow: hidden;
             box-shadow: 0 4px 14px rgba(0,0,0,.08); transition: transform .15s; }
.game-card:hover { transform: translateY(-4px); }
.game-card .thumb { height: 130px; display: flex; align-items: center;
                    justify-content: center; font-size: 56px; }
.game-card .body { padding: 14px 16px; }
.game-card h3 { margin: 0 0 6px; font-size: 18px; }
.game-card .desc { color: #8d6e63; font-size: 14px; height: 40px;
                   overflow: hidden; }
.game-card .meta { display: flex; justify-content: space-between;
                   align-items: center; margin-top: 10px; }
.badge { background: #e8f5e9; color: #2e7d32; font-size: 12px;
         border-radius: 999px; padding: 3px 10px; }
.card-actions { display: flex; gap: 8px; }
.card-actions a, .card-actions button { font-size: 13px; padding: 6px 12px;
                                        border-radius: 999px; cursor: pointer;
                                        text-decoration: none; border: 1px solid #ffccbc;
                                        background: #fff; color: #d84315; }
.empty { text-align: center; color: #a1887f; padding: 60px 0; }
.auth-card { max-width: 380px; margin: 48px auto; background: #fff;
             border-radius: 20px; padding: 32px; display: flex;
             flex-direction: column; gap: 14px;
             box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.auth-card h1 { margin: 0; text-align: center; }
.auth-card input { padding: 12px 16px; border-radius: 12px;
                   border: 2px solid #ffe0b2; font-size: 16px; outline: none; }
.auth-card input:focus { border-color: #ff7043; }
.auth-card .hint { color: #8d6e63; font-size: 14px; text-align: center; margin: 0; }
.auth-card .error { color: #d84315; font-size: 14px; text-align: center; margin: 0; }
[x-cloak] { display: none !important; }
/* 创作页/游玩页去掉 .page 的 padding，工作台正好占满视口剩余高度，输入区不会被顶出首屏 */
.page:has(.workbench), .page:has(.play-wrap) { padding: 0; }
.workbench { display: flex; gap: 0;
             height: calc(100vh - 62px);
             height: calc(100dvh - 62px); } /* dvh：Android 带地址栏时 100vh 偏大，会截掉底部输入区 */
.wb-chat { width: 42%; min-width: 320px; display: flex;
           flex-direction: column; border-right: 2px solid #ffe0b2;
           background: #fffdf8; }
.wb-preview { flex: 1; display: flex; flex-direction: column;
              background: #eceff1; position: relative; }
.wb-preview iframe { flex: 1; width: 100%; border: none; background: #fff; }
.wb-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex;
           flex-direction: column; gap: 12px; }
.msg { max-width: 88%; border-radius: 16px; padding: 10px 14px;
       font-size: 15px; line-height: 1.5; white-space: pre-wrap;
       word-break: break-word; }
.msg.user { align-self: flex-end; background: #ff7043; color: #fff;
            border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #fff;
                 border: 1px solid #ffe0b2; border-bottom-left-radius: 4px; }
.wb-input { display: flex; gap: 8px; padding: 12px;
            border-top: 2px solid #ffe0b2; }
.wb-input textarea { flex: 1; padding: 10px 14px; border-radius: 14px;
                     border: 2px solid #ffe0b2; font-size: 16px;
                     resize: none; height: 56px; outline: none;
                     font-family: inherit; }
.wb-input textarea:focus { border-color: #ff7043; }
.wb-toolbar { display: flex; gap: 8px; align-items: center;
              padding: 8px 12px; background: #fff;
              border-bottom: 1px solid #e0e0e0; flex-shrink: 0; }
.wb-status { color: #8d6e63; font-size: 14px; flex: 1;
             display: inline-flex; align-items: center; gap: 6px; }
.spinner { width: 14px; height: 14px; border: 3px solid #ffe0b2;
           border-top-color: #ff7043; border-radius: 50%;
           animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.wb-preview-empty { position: absolute; inset: 0; display: flex;
                    flex-direction: column; align-items: center;
                    justify-content: center; color: #90a4ae; gap: 8px; }
@media (max-width: 720px) and (orientation: portrait) {
  .workbench { flex-direction: column-reverse; height: auto; }
  .wb-chat { width: 100%; height: 45vh; border-right: none;
             border-top: 2px solid #ffe0b2; }
  .wb-preview { height: 45vh; }
}

.play-wrap { display: flex; flex-direction: column;
             height: calc(100vh - 62px);
             height: calc(100dvh - 62px); }
.play-head { display: flex; align-items: center; gap: 16px; padding: 10px 0;
             flex-shrink: 0; }
.play-head h1 { flex: 1; margin: 0; font-size: 22px; }
.play-frame { flex: 1; background: #fff; border-radius: 16px; overflow: hidden;
              box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.play-frame:fullscreen { border-radius: 0; }
.play-frame iframe { width: 100%; height: 100%; border: none; }

.progress-bubble { display: inline-flex; align-items: center; gap: 10px;
                   color: #8d6e63; background: #fff8f0; font-size: 14px; }
