:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #222;
  background: #f3f3f1;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid #555; outline-offset: 2px; }
a { color: inherit; }

.app-shell { width: min(100%, 680px); min-height: 100vh; margin: 0 auto; background: #fff; box-shadow: 0 0 0 1px #e7e7e5; }
.work-area { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 64px; flex: 0 0 64px; padding: 0 30px; border-bottom: 1px solid #ececea; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-brand { font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.topbar-status { display: flex; align-items: center; gap: 11px; color: #777; font-size: 12px; white-space: nowrap; }
#topbar-count { border-left: 1px solid #ddd; padding-left: 11px; color: #333; font-weight: 600; }
.screen { width: 100%; flex: 1; padding: 36px 30px 70px; }

.page-kicker { margin-bottom: 11px; color: #777; font-size: 12px; }
.page-title { margin: 0 0 9px; font-size: 30px; font-weight: 650; letter-spacing: -.035em; line-height: 1.35; }
.page-title em { color: inherit; font-style: normal; font-weight: inherit; }
.page-copy { margin: 0 0 29px; color: #777; font-size: 14px; line-height: 1.75; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; font-size: 14px; font-weight: 600; }
.muted, .soft-note { color: #888; font-size: 12px; font-weight: 400; line-height: 1.7; }
.soft-note { margin: 16px 0 0; }
.text-link { padding: 8px 0; border: 0; background: none; color: #555; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

.button { min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #222; border-radius: 8px; background: #222; color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.button:hover:not(:disabled) { background: #444; border-color: #444; }
.button.full { width: 100%; }
.button.secondary { background: #fff; color: #222; border-color: #d4d4d2; }
.button.secondary:hover:not(:disabled) { background: #f7f7f6; border-color: #aaa; }
.button.ghost { background: none; border-color: transparent; color: #666; }
.button.ghost:hover:not(:disabled) { background: #f5f5f3; border-color: transparent; }
.button.small { min-height: 42px; padding: 0 12px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.actions .button { flex: 1 1 150px; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field textarea, .chat-input { width: 100%; min-width: 0; border: 1px solid #d8d8d6; border-radius: 8px; background: #fff; color: #222; padding: 12px 13px; font-size: 14px; outline: none; }
.field input:focus, .field textarea:focus, .chat-input:focus { border-color: #555; }
.field input::placeholder, .field textarea::placeholder, .chat-input::placeholder { color: #aaa; }
.field textarea { min-height: 100px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row input { flex: 1; }
.auth-art { display: none; }
.auth-form { max-width: 100%; }
.auth-form .button.full { margin: 20px 0 8px; }

.chat-topline { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid #e8e8e6; border-radius: 9px 9px 0 0; background: #fafafa; }
.agent-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e9e9e7; color: #444; font-size: 12px; font-weight: 600; }
.chat-topline strong { display: block; font-size: 13px; font-weight: 600; }
.chat-topline span:last-child { display: block; margin-top: 2px; color: #999; font-size: 11px; }
.conversation { min-height: 300px; max-height: 440px; overflow-y: auto; padding: 17px; border: 1px solid #e8e8e6; border-top: 0; background: #fff; display: flex; flex-direction: column; gap: 13px; }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.bubble-row.user { align-self: flex-end; flex-direction: row-reverse; }
.mini-avatar { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: grid; place-items: center; background: #eee; color: #666; font-size: 11px; }
.bubble-row.user .mini-avatar { background: #e6e6e4; }
.bubble { padding: 10px 12px; border-radius: 9px 9px 9px 2px; background: #f3f3f2; font-size: 13px; line-height: 1.65; }
.bubble-row.user .bubble { border-radius: 9px 9px 2px 9px; background: #262626; color: #fff; }
.typing { display: inline-flex; gap: 3px; }.typing i { width: 5px; height: 5px; border-radius: 50%; background: #888; animation: bounce 1s infinite alternate; }.typing i:nth-child(2) { animation-delay: .2s; }.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { to { opacity: .35; transform: translateY(-4px); } }
.chat-controls { padding: 15px; border: 1px solid #e8e8e6; border-top: 0; border-radius: 0 0 9px 9px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { padding: 8px 12px; border: 1px solid #dcdcd9; border-radius: 100px; background: #fff; color: #444; font-size: 12px; }
.chip:hover { background: #f3f3f2; }
.chat-entry { display: flex; gap: 8px; }.chat-entry .button { flex: 0 0 66px; }
.summary-card { margin-top: 18px; padding: 18px; border: 1px solid #e8e8e6; border-radius: 9px; background: #fafafa; }
.summary-card h3 { margin: 0 0 11px; font-size: 14px; }.summary-card p { margin: 5px 0; color: #777; font-size: 12px; line-height: 1.65; }.summary-card strong { color: #333; }.summary-card .button { margin-top: 15px; }

.story-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 16px; border: 1px solid #e8e8e6; border-radius: 8px; overflow: hidden; }
.story-point { min-width: 0; padding: 12px; border-right: 1px solid #e8e8e6; }.story-point:last-child { border-right: 0; }
.story-point span { display: block; color: #999; font-size: 10px; }.story-point strong { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; }
.look-board-grid { display: grid; gap: 12px; }
.look-board { overflow: hidden; border: 1px solid #e6e6e3; border-radius: 10px; background: #fff; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 15px; }
.board-head span { color: #888; font-size: 11px; }.board-head h3 { margin: 4px 0 0; font-size: 15px; font-weight: 600; }.board-head small { color: #999; font-size: 11px; }
.board-canvas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; background: #f7f7f6; }
.piece { min-width: 0; min-height: 130px; position: relative; padding: 8px; border: 1px solid #e9e9e6; border-radius: 7px; background: #fff; text-align: left; }
.piece:hover { border-color: #aaa; }
.piece-art { height: 76px; display: grid; place-items: center; }.piece-art svg { max-width: 66px; max-height: 64px; }
.piece-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.piece-action { position: absolute; top: 7px; right: 7px; color: #888; font-size: 9px; }
.board-foot { min-height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; color: #999; font-size: 11px; }.board-foot em { color: #555; font-style: normal; }
.sticky-actions { display: flex; gap: 10px; margin-top: 22px; }.sticky-actions .button { flex: 1; }

.upload-card { min-height: 245px; overflow: hidden; display: grid; place-items: center; border: 1px dashed #bdbdba; border-radius: 9px; background: #fafafa; position: relative; }
.upload-inner { padding: 28px; text-align: center; }.upload-icon { margin-bottom: 10px; color: #666; font-size: 29px; }.upload-inner h3 { margin: 0 0 7px; font-size: 15px; }.upload-inner p { margin: 0 0 15px; color: #999; font-size: 12px; line-height: 1.6; }
.upload-preview { width: 100%; height: 300px; object-fit: cover; object-position: center 25%; }.upload-overlay { position: absolute; right: 12px; bottom: 12px; padding: 8px 11px; border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer; }

.generation-panel { padding: 30px 20px; border: 1px solid #e8e8e6; border-radius: 9px; background: #fafafa; text-align: center; }
.generation-orbit { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 13px; border: 1px solid #d4d4d1; border-radius: 50%; color: #555; font-size: 21px; }
.generation-panel h3 { margin: 0 0 7px; font-size: 15px; }.generation-panel p { margin: 0; color: #888; font-size: 12px; }
.progress-track { height: 5px; margin: 18px 0 8px; overflow: hidden; border-radius: 10px; background: #e5e5e2; }.progress-fill { height: 100%; background: #333; border-radius: 10px; transition: width .4s; }.progress-caption { color: #888; font-size: 11px; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.result-card { overflow: hidden; border: 1px solid #e8e8e6; border-radius: 8px; }
.result-image { aspect-ratio: 2 / 3; background: #eee; }.result-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.result-caption { padding: 11px; }.result-caption span { color: #999; font-size: 10px; }.result-caption strong { display: block; margin-top: 4px; font-size: 12px; }.result-caption p { margin: 5px 0 0; color: #999; font-size: 10px; }
.reference-line { display: flex; align-items: center; gap: 8px; margin: 17px 0; color: #888; font-size: 11px; }.reference-line img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; }

.video-templates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.template-option { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid #e4e4e1; border-radius: 8px; background: #fff; text-align: left; }
.template-option.selected { border-color: #444; }.template-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 6px; background: #f0f0ee; color: #555; font-size: 17px; }
.template-option strong { display: block; font-size: 12px; }.template-option span:last-child { display: block; margin-top: 2px; color: #999; font-size: 10px; line-height: 1.4; }
.video-layout { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 25px; }
.video-poster { width: 100%; aspect-ratio: 9 / 16; position: relative; overflow: hidden; border-radius: 8px; background: #ddd; }
.video-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: slide-cycle 9s infinite; }
.video-poster img:nth-child(2) { animation-delay: 3s; }.video-poster img:nth-child(3) { animation-delay: 6s; }
@keyframes slide-cycle { 0%, 27% { opacity: 1; transform: scale(1); } 33%, 100% { opacity: 0; transform: scale(1.04); } }
.video-poster::after { content: ''; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.4)); }
.video-poster-text { position: absolute; z-index: 1; left: 14px; bottom: 16px; color: #fff; font-size: 16px; font-weight: 600; }
.concept-badge { position: absolute; z-index: 2; right: 10px; top: 10px; padding: 5px 8px; border-radius: 5px; background: rgba(255,255,255,.92); color: #444; font-size: 10px; }
.video-side h3 { margin: 0 0 8px; font-size: 15px; }.video-side p { color: #888; font-size: 12px; line-height: 1.7; }.video-side .button.full { margin-top: 14px; }
.video-spec { display: grid; gap: 9px; margin: 20px 0; }.video-spec div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid #ececea; font-size: 12px; }.video-spec span { color: #999; }.video-spec strong { font-weight: 600; text-align: right; }
.concept-progress { animation: concept-progress 1.4s ease-in-out forwards; }@keyframes concept-progress { from { width: 5%; } to { width: 100%; } }

.apply-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 27px; }
.apply-thumb { position: relative; overflow: hidden; aspect-ratio: 3 / 4; border-radius: 7px; background: #eee; }.apply-thumb img { width: 100%; height: 100%; object-fit: cover; }.apply-thumb span { position: absolute; left: 6px; bottom: 6px; padding: 4px 6px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 9px; }
.apply-form .button.full { margin-top: 20px; }
.success-mark { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 0 23px; border-radius: 50%; background: #f0f0ee; font-size: 25px; }
.success-card { padding: 19px; border: 1px solid #e7e7e5; border-radius: 9px; background: #fafafa; }.success-card span { color: #888; font-size: 11px; }.success-card strong { display: block; margin: 7px 0 12px; font-size: 20px; }.success-card p { margin: 0; color: #777; font-size: 12px; line-height: 1.7; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(0,0,0,.35); }
.drawer { width: min(100%, 600px); max-height: 80vh; overflow-y: auto; padding: 22px; border-radius: 11px; background: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.15); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }.drawer-head span { color: #999; font-size: 11px; }.drawer-head h2 { margin: 5px 0 0; font-size: 19px; }.icon-button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f1f1ef; color: #555; font-size: 19px; }
.replacement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.replacement { min-width: 0; padding: 9px; border: 1px solid #e5e5e2; border-radius: 8px; background: #fff; text-align: left; }.replacement.selected { border-color: #555; }.replacement .piece-art { height: 85px; }.replacement strong { display: block; margin: 7px 0 3px; font-size: 11px; }.replacement span:last-child { color: #999; font-size: 10px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; padding: 11px 14px; border-radius: 7px; background: #222; color: #fff; font-size: 12px; }

@media (max-width: 680px) {
  :root { background: #fff; }
  .app-shell { box-shadow: none; }
  .topbar { padding: 0 20px; }
  .screen { padding: 29px 20px 64px; }
  .page-title { font-size: 27px; }
  .board-canvas { grid-template-columns: repeat(2, 1fr); }
  .video-layout { grid-template-columns: 1fr; gap: 18px; }.video-poster { width: min(100%, 250px); margin: 0 auto; }
}
@media (max-width: 400px) {
  .topbar-status { gap: 7px; font-size: 11px; }
  .result-grid { gap: 6px; }.result-caption { padding: 7px; }.result-caption strong { font-size: 11px; }.result-caption p { display: none; }
  .story-point { padding: 10px 7px; }
  .template-option { padding: 9px; }.template-icon { display: none; }
  .replacement-grid { gap: 5px; }.replacement { padding: 6px; }
  .drawer-backdrop { padding: 0; }.drawer { border-radius: 12px 12px 0 0; }
}
