@media (max-width: 900px) {
  .workspace,
  .result-layout,
  .pay-panel,
  .vip-strip {
    grid-template-columns: 1fr;
  }
  .intro { padding: 26px; }
  h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .grid,
  .vip-action { grid-template-columns: 1fr; }
  .compact-pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }
  .secondary { width: 100%; }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 12% 4%, rgba(105, 210, 255, .42), transparent 28%),
      radial-gradient(circle at 92% 18%, rgba(138, 92, 255, .28), transparent 30%),
      linear-gradient(160deg, #06101f 0%, #09172b 46%, #06111f 100%);
  }
  body::before {
    background-size: 38px 38px;
    opacity: .88;
    animation-duration: 12s;
  }
  body::after {
    opacity: .92;
    background:
      linear-gradient(118deg, transparent 0 34%, rgba(105, 210, 255, .20) 48%, transparent 63%),
      radial-gradient(circle at 80% 16%, rgba(92, 123, 255, .16), transparent 32%);
  }
  .app-shell, .container {
    width: min(100% - 18px, 520px);
    padding: 10px 0 30px;
  }
  .brand-bar {
    align-items: flex-end;
    gap: 4px;
    margin-bottom: 10px;
  }
  .brand-lockup {
    gap: 9px;
    padding: 4px 6px 4px 4px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,.07), rgba(255,255,255,0));
  }
  .brand-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .brand-lockup span {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
  }
  .brand-lockup strong {
    font-size: 19px;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 0 18px rgba(105, 210, 255, .28);
  }
  .brand-lockup strong::after {
    content: "AI创作助手";
    margin-left: 7px;
    color: #9ed0ff;
    font-size: 13px;
    font-weight: 800;
  }
  .brand-lockup small {
    display: none;
  }
  .brand-domain {
    display: none;
  }
  .mobile-brand-tagline {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 0 -2px 0;
    transform: translateX(-18px);
    color: #c9eaff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: right;
    white-space: nowrap;
    text-shadow: 0 0 16px rgba(105, 210, 255, .28);
    opacity: .88;
  }
  .workspace {
    gap: 12px;
    min-height: 0;
  }
  .assistant-hero {
    display: none;
  }
  .composer-panel {
    padding: 14px;
    border-color: rgba(105, 210, 255, .34);
    background:
      linear-gradient(180deg, rgba(12, 28, 52, .88), rgba(6, 16, 31, .84)),
      rgba(9, 20, 38, .86);
    box-shadow:
      0 18px 42px rgba(0,0,0,.34),
      0 0 0 1px rgba(105,210,255,.08),
      inset 0 1px 0 rgba(255,255,255,.08);
  }
  .composer-panel::before {
    opacity: .9;
  }
  .composer-panel::after {
    height: 54%;
    top: -20%;
    background: linear-gradient(105deg, transparent, rgba(105,210,255,.16), transparent);
  }
  .composer-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .composer-title-row {
    width: 100%;
    justify-content: space-between;
    min-width: 0;
  }
  .composer-head label {
    font-size: 18px;
    line-height: 1.2;
    text-shadow: 0 0 16px rgba(105, 210, 255, .18);
  }
  .vip-toggle {
    flex: 0 0 auto;
    width: auto;
    min-width: 40px;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: .2px;
    background: linear-gradient(135deg, rgba(37,137,255,.26), rgba(105,210,255,.12));
    box-shadow: inset 0 0 14px rgba(105, 210, 255, .12);
    margin: 0;
  }
  .composer-panel textarea {
    min-height: 142px;
    font-size: 16px;
    border-color: rgba(105, 210, 255, .24);
    background: rgba(2, 8, 18, .72);
    box-shadow: inset 0 0 22px rgba(0,0,0,.26);
  }
  .composer-foot {
    grid-template-columns: 1fr;
  }
  .attachment-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
  }
  .file-pick-trigger,
  .output-format-control,
  .attachment-panel select {
    min-height: 43px;
    height: 43px;
    font-size: 15px;
    border-color: rgba(105, 210, 255, .24);
    background: rgba(255,255,255,.10);
    box-shadow: inset 0 0 16px rgba(105, 210, 255, .04);
  }
  .file-pick-trigger {
    padding: 10px 8px;
  }
  .output-format-control span {
    padding: 0 8px;
    font-size: 12px;
  }
  .attachment-panel select {
    appearance: none;
    -webkit-appearance: none;
    padding: 9px 27px 9px 8px;
    background:
      linear-gradient(45deg, transparent 50%, #b9d8f5 50%) calc(100% - 16px) 50% / 6px 6px no-repeat,
      linear-gradient(135deg, #b9d8f5 50%, transparent 50%) calc(100% - 11px) 50% / 6px 6px no-repeat;
    background-color: transparent;
    background-clip: padding-box;
    text-overflow: ellipsis;
  }
  .file-list {
    grid-column: 1 / -1;
  }
  .file-chip span {
    max-width: 72vw;
  }
  .assistant-meta {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 7px;
  }
  .assistant-meta span,
  .model-select {
    padding: 6px 9px;
    border-color: rgba(105, 210, 255, .26);
    background: rgba(8, 22, 44, .72);
    color: #c8defb;
    font-size: 12px;
    box-shadow: inset 0 0 18px rgba(105, 210, 255, .08), 0 0 18px rgba(37, 137, 255, .08);
  }
  .model-select {
    max-width: 46vw;
    min-height: 32px;
    padding-right: 25px;
    text-overflow: ellipsis;
  }
  .intro, .tool-panel, .result-card, .pay-panel, .card {
    box-shadow: 0 14px 36px rgba(0,0,0,.24);
  }
  .intro {
    padding: 18px;
  }
  h1 {
    margin: 12px 0 8px;
    font-size: 28px;
  }
  h2 {
    font-size: 18px;
  }
  p {
    font-size: 14px;
  }
  .tool-panel, .card, .result-card, .pay-panel {
    padding: 15px;
    border-color: rgba(105, 210, 255, .25);
    background: rgba(7, 18, 35, .78);
    box-shadow: 0 16px 38px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
  }
  textarea {
    min-height: 96px;
  }
  textarea::placeholder {
    font-size: 13px;
    line-height: 1.5;
  }
  button {
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(37, 137, 255, .26), inset 0 1px 0 rgba(255,255,255,.35);
  }
  #generateBtn {
    min-height: 56px;
    border: 1px solid rgba(139, 225, 255, .48);
    border-radius: 14px;
    background: linear-gradient(105deg, #228cff 0%, #48c7ff 58%, #5ee6dc 100%);
    color: #04111f;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: .5px;
    text-shadow: 0 1px 0 rgba(255,255,255,.22);
    box-shadow:
      0 14px 34px rgba(37, 137, 255, .34),
      0 0 22px rgba(105, 210, 255, .18),
      inset 0 1px 0 rgba(255,255,255,.46),
      inset 0 -8px 18px rgba(4, 28, 67, .10);
  }
  #generateBtn::before,
  #generateBtn::after {
    content: none;
  }
  #generateBtn:not(:disabled) {
    animation: sendGlow 5.6s ease-in-out infinite;
  }
  #generateBtn:active {
    transform: translateY(1px) scale(.99);
    box-shadow:
      0 10px 24px rgba(37, 137, 255, .28),
      inset 0 2px 10px rgba(0,0,0,.12);
  }
  .output-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .answer-card .output-head {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 10px;
  }
  .answer-card .output-head h2 {
    flex: 1 1 auto;
    font-size: 18px;
    text-shadow: 0 0 15px rgba(105, 210, 255, .16);
  }
  .answer-card .output-actions {
    flex: 0 0 auto;
    gap: 6px;
  }
  .answer-card .output-actions .secondary {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 9px;
    font-size: 12px;
    white-space: nowrap;
  }
  .output-actions {
    justify-content: stretch;
  }
  .output-actions .secondary {
    flex: 1 1 120px;
  }
  .image-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .image-actions .secondary {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
  }
  .vip-strip {
    padding: 12px;
  }
  .pay-panel {
    gap: 14px;
  }
  .qr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .qr {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
  .result-list, pre {
    font-size: 14px;
    line-height: 1.7;
  }
  .image-preview {
    border-color: rgba(105, 210, 255, .30);
    box-shadow: 0 14px 34px rgba(0,0,0,.26), 0 0 24px rgba(37, 137, 255, .10);
  }
  .usage-block strong {
    font-size: 15px;
  }
  .usage-block span {
    font-size: 12px;
  }
  .vip-strip {
    border: 1px solid rgba(105, 210, 255, .20);
    background: rgba(8, 24, 48, .72);
  }
  .vip-action {
    grid-template-columns: 1fr 64px;
  }
}

@media (min-width: 761px) and (max-width: 1023px) {
  .app-shell, .container {
    width: min(100% - 40px, 860px);
  }
  .workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .result-layout {
    grid-template-columns: 1fr 1fr;
  }
  .script-card {
    grid-column: 1 / -1;
  }
  .pay-panel {
    grid-template-columns: 1fr auto;
  }
  .pay-panel > .secondary {
    grid-column: 1 / -1;
    width: 100%;
  }
}
