.site-header{height:80px;position:sticky;top:0;z-index:40;background:#fff;border-bottom:1px solid #f0f0f0;overflow:visible}
.site-header [hidden]{display:none!important}
.header-inner{position:relative;max-width:none;height:100%;margin:0;padding:0 16px;display:grid;grid-template-columns:1fr minmax(320px,850px) 1fr;align-items:center;gap:20px}
.site-header .brand{border:0;background:transparent;padding:0;white-space:nowrap;text-align:left;color:var(--ink);cursor:pointer;justify-self:start}
.site-header .brand strong{display:block;font-family:Georgia,"Times New Roman",serif;font-size:25px;line-height:1;font-style:italic;letter-spacing:-.04em}
.site-header .brand small{display:block;margin-top:7px;color:#777;font-size:10px;letter-spacing:.16em}
.search-wrap{margin:0;display:flex;align-items:center;gap:8px}
.search-wrap input{flex:1 1 auto;min-width:0;width:100%;height:52px;border:0;border-radius:14px;background:#f4f4f4;padding:0 20px;color:var(--ink);outline:none;font-size:15px}
.search-wrap input:focus{box-shadow:0 0 0 2px #222;background:#fff}
.search-submit{flex:0 0 auto;height:52px;padding:0 20px;border:0;border-radius:14px;background:var(--red,#e5484d);color:#fff;font:700 14px/1 var(--font);cursor:pointer;transition:background .15s,transform .06s}
.search-submit:hover{background:var(--red-dark,#cd3439)}
.search-submit:active{transform:translateY(1px)}
.header-actions{justify-self:end;display:flex;align-items:center;gap:10px;white-space:nowrap}
.header-auth{position:absolute;top:13px;right:24px;z-index:3;display:flex;align-items:center;gap:8px}
.header-auth[hidden]{display:none!important}
.header-auth .outline-btn,.header-auth .solid-btn{height:44px;padding:0 16px;border-radius:11px}
.mobile-nav-panel{display:contents}
.mobile-menu-toggle{display:none}
.site-header .outline-btn,.site-header .solid-btn{display:inline-flex;align-items:center;justify-content:center;height:46px;border-radius:12px;padding:0 18px;border:0;background:transparent;color:var(--ink);font-size:14px;cursor:pointer}
.site-header .outline-btn{border:1px solid #dedede;background:#fff}
.site-header .solid-btn{background:#181818;color:#fff;font-weight:700}
.site-header .outline-btn:hover{background:#f3f3f3}
.site-header .solid-btn:hover{background:#333}
.account-menu{position:relative}
.site-header .avatar-btn{display:flex;align-items:center;gap:9px;width:max-content;max-width:190px;height:44px;padding:0;border:0;background:transparent;color:#171717;font-weight:800;cursor:pointer}
.account-avatar{display:grid;place-items:center;width:42px;height:42px;flex:none;overflow:hidden;border-radius:50%;background:#181818;color:#fff}
.account-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.account-avatar img[hidden],.account-avatar span[hidden]{display:none}
.account-name{max-width:126px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;text-align:left}
.account-dropdown{display:none;position:absolute;right:0;top:54px;width:230px;max-height:calc(100dvh - 90px);overflow-y:auto;background:#fff;border:1px solid #e5e5e5;border-radius:13px;padding:10px;box-shadow:0 18px 55px rgba(0,0,0,.16);color:#222;z-index:90}
.account-menu.open .account-dropdown{display:block}
.account-email{padding:10px 11px 12px;border-bottom:1px solid #eee;font-size:12px;color:#666;overflow:hidden;text-overflow:ellipsis}
.account-balance{display:flex;align-items:baseline;gap:6px;margin:8px 0 6px;padding:11px;border-radius:9px;background:#f7f6f3;color:#6d6a64;font-size:12px}
.account-balance b{margin-left:auto;color:#1e1e1e;font-size:20px;line-height:1;font-variant-numeric:tabular-nums}
.account-balance small{font-size:11px;color:#999}
.logout-btn{width:100%;height:40px;margin-top:4px;border:0;border-radius:8px;background:#fff;text-align:left;padding:0 11px;color:#222;display:block}
.logout-btn:hover{background:#f4f4f4;color:var(--red)}
.account-dropdown .logout-btn{display:flex;align-items:center;gap:10px;box-sizing:border-box;text-decoration:none;white-space:nowrap;cursor:pointer}
.account-dropdown .logout-btn svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.site-header .account-dropdown{overflow-y:auto}
.account-buy-link{display:flex;align-items:center;justify-content:center;min-height:48px;margin:9px 0 6px;background:var(--red,#e5484d);color:#fff;font-size:15px;font-weight:800;text-decoration:none}
.account-buy-link:hover{background:var(--red-dark,#cd3439);color:#fff}
.logout-btn.signed,.logout-btn:disabled{color:#8a8a8a;cursor:default}
.logout-btn.signed:hover,.logout-btn:disabled:hover{background:#fff;color:#8a8a8a}
.site-header :focus-visible{outline:2px solid #171717;outline-offset:2px}
#siteHeaderToast.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  background: #171717;
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#siteHeaderToast.toast.on, #siteHeaderToast.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media(max-width:900px){.header-inner{gap:12px;padding:0 12px}.search-wrap input{height:48px}.site-header .outline-btn{padding:0 12px}}
@media(max-width:720px){
  .site-header{height:auto;position:sticky}
  .header-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;height:auto;padding:10px 12px;max-width:100%}
  .site-header .brand{grid-column:1;grid-row:1;min-width:0}
  .site-header .brand small{display:none}
  .site-header .brand strong{font-size:21px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .header-actions{grid-column:2;grid-row:1;justify-self:end;display:flex;align-items:center;gap:8px;position:relative;z-index:2;margin:0}
  .mobile-menu-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 12px;border:1px solid #dedede;border-radius:10px;background:#fff;color:var(--ink);font-size:13px;font-weight:700;cursor:pointer}
  .mobile-menu-mark{position:relative;width:14px;height:12px;flex:none}
  .mobile-menu-mark::before,.mobile-menu-mark::after{content:"";position:absolute;left:0;width:14px;height:1.5px;border-radius:2px;background:currentColor;transition:transform .18s ease}
  .mobile-menu-mark::before{top:2px}
  .mobile-menu-mark::after{bottom:2px}
  .menu-open .mobile-menu-mark::before{transform:translateY(4px) rotate(45deg)}
  .menu-open .mobile-menu-mark::after{transform:translateY(-4px) rotate(-45deg)}
  .mobile-nav-panel{display:none;position:absolute;top:calc(100% + 12px);right:0;width:min(260px,calc(100vw - 24px));max-height:calc(100dvh - 125px);overflow-y:auto;padding:8px;border:1px solid #e6e6e6;border-radius:14px;background:#fff;box-shadow:0 18px 50px rgba(0,0,0,.16)}
  .header-actions.menu-open .mobile-nav-panel{display:flex;flex-direction:column;gap:2px}
  .site-header .mobile-nav-panel>.outline-btn,.site-header .mobile-nav-panel>.solid-btn{display:flex;justify-content:flex-start;width:100%;height:42px;padding:0 12px;border:0;border-radius:9px;background:#fff;color:var(--ink);font-size:14px;text-align:left}
  .site-header .mobile-nav-panel>.outline-btn.is-active{background:#171717;color:#fff}
  .site-header .mobile-nav-panel>.backend-entry:not([hidden]){display:flex}
  .site-header .mobile-nav-panel>.solid-btn{background:#171717;color:#fff}
  .site-header .avatar-btn{width:44px;height:44px;padding:0;font-size:13px}
  .site-header .account-name{display:none}
  .search-wrap{grid-column:1/-1;grid-row:2;width:100%;min-width:0;margin:0}
  .search-wrap input{height:44px;border-radius:10px;font-size:14px;padding:0 13px}
  .search-submit{height:44px;border-radius:10px;padding:0 15px;font-size:13px}
  .account-dropdown{top:52px;right:0;width:min(240px,calc(100vw - 24px))}
}
@media(prefers-reduced-motion:reduce){.mobile-menu-mark::before,.mobile-menu-mark::after{transition:none}}

/* ---------------- 当前页高亮（手机菜单与桌面页签分别呈现） ----------------
   放在 header.css 里而不是 ui.css：首页/生图中心/反推提示词等所有页面都引这个文件，
   保证 header 在任何页面长得一样（2026-09-20 反推页漏引 ui.css 导致高亮缺失）。 */
.site-header .header-actions .outline-btn.is-active {
  background: var(--ink, #171717);
  color: #fff;
  border-color: var(--ink, #171717);
}
.site-header .header-actions .outline-btn.is-active:hover{background:#000}

.header-cdk-dialog{box-sizing:border-box;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);margin:auto;padding:32px 28px 28px;border:0;border-radius:18px;background:#fff;color:#171717;box-shadow:0 24px 80px rgba(0,0,0,.25);font:14px/1.55 Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;overflow:auto}
.header-cdk-dialog::backdrop{background:rgba(0,0,0,.72)}
.header-cdk-dialog h2{margin:0;text-align:center;font-size:25px}
.header-cdk-dialog p{margin:8px 0 24px;text-align:center;color:#777}
.header-cdk-close{position:absolute;right:12px;top:9px;border:0;background:transparent;padding:6px 10px;color:#777;font-size:26px;cursor:pointer}
.header-cdk-dialog label{display:block;margin-bottom:7px}
.header-cdk-dialog input{box-sizing:border-box;width:100%;height:48px;border:1px solid #d6d6d6;border-radius:10px;padding:0 14px;font:inherit}
.header-cdk-dialog input:focus{outline:2px solid #171717;outline-offset:1px}
.header-cdk-message{min-height:24px;margin:8px 0;color:#c93b40}
.header-cdk-submit{width:100%;height:48px;border:0;border-radius:10px;background:#171717;color:#fff;font:700 14px/1 Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;cursor:pointer}
.header-cdk-submit:disabled{opacity:.55;cursor:default}
.header-cdk-buy{display:flex;align-items:center;justify-content:center;min-height:44px;margin-top:10px;border:1px solid #e8d4d4;border-radius:10px;color:#c93b40;font-weight:700;text-decoration:none}
.header-cdk-buy:hover{background:#fff1f1}

.app-download-dialog{box-sizing:border-box;width:min(470px,calc(100vw - 28px));max-height:calc(100dvh - 32px);margin:auto;padding:30px;border:0;border-radius:22px;background:#fff;color:#171717;box-shadow:0 24px 80px rgba(0,0,0,.2);font:14px/1.5 Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;overflow:auto}
.app-download-dialog::backdrop{background:rgba(15,15,15,.55);backdrop-filter:blur(5px)}
.app-download-close{position:absolute;top:12px;right:14px;width:36px;height:36px;border:0;border-radius:50%;background:#f3f3f3;color:#555;font-size:23px;line-height:1;cursor:pointer}
.app-download-kicker{margin-bottom:9px;color:var(--red,#e5484d);font-size:11px;font-weight:800;letter-spacing:.12em}
.app-download-dialog h2{margin:0;font-size:28px;line-height:1.2;letter-spacing:-.04em}
.app-download-dialog p{margin:10px 34px 23px 0;color:#777;line-height:1.6}
.app-download-choices{display:grid;gap:10px}
.app-download-choice{position:relative;display:grid;grid-template-columns:1fr 26px;gap:2px 8px;align-items:center;min-height:92px;padding:17px 19px;border:1px solid #e8e8e8;border-radius:14px;background:#fff;color:#171717;text-align:left;text-decoration:none;font:inherit;cursor:pointer;box-sizing:border-box;transition:border-color .18s,background .18s}
.app-download-choice:hover:not(.is-disabled){border-color:#e5484d;background:#fff8f8}
.app-download-choice .app-download-platform{grid-column:1;color:#a83a40;font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.app-download-choice strong{grid-column:1;font-size:16px;line-height:1.3}
.app-download-choice small{grid-column:1;color:#777;font-size:12px}
.app-download-choice svg{grid-column:2;grid-row:1/4;width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:#c94149}
.app-download-choice.is-disabled{background:#f7f7f7;color:#999;cursor:not-allowed}
.app-download-choice.is-disabled .app-download-platform,.app-download-choice.is-disabled svg{color:#999}
.app-download-dialog :focus-visible{outline:2px solid #171717;outline-offset:2px}
@media(max-width:720px){.app-download-dialog{padding:26px 20px 22px;border-radius:18px}.app-download-dialog h2{font-size:25px}}

/* 手机端独立底栏；桌面端使用两层顶栏。 */
.mobile-app-nav,.mobile-create-scrim,.mobile-create-sheet{display:none}
@media(max-width:720px){
  html.mobile-app-enabled body{padding-bottom:calc(74px + env(safe-area-inset-bottom,0px))}
  html.mobile-app-enabled body.mobile-create-open{overflow:hidden}
  html.mobile-app-enabled .site-header{height:auto}
  html.mobile-app-enabled .site-header .header-inner{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(44px,auto) auto;gap:10px;padding:14px 16px 12px}
  html.mobile-app-enabled .site-header .header-auth{position:static;grid-column:2;grid-row:1;justify-self:end;gap:6px}
  html.mobile-app-enabled .site-header .header-auth .outline-btn,html.mobile-app-enabled .site-header .header-auth .solid-btn{height:36px;padding:0 11px;border-radius:9px;font-size:12px}
  html.mobile-app-enabled .site-header .brand{grid-column:1;grid-row:1}
  html.mobile-app-enabled .site-header .brand{max-width:100%}
  html.mobile-app-enabled .site-header .brand strong{font-size:23px}
  html.mobile-app-enabled .site-header .header-actions{display:none}
  html.mobile-app-enabled .site-header .search-wrap{grid-column:1/-1;grid-row:2}
  html.mobile-app-enabled site-header:not([page="home"]) .search-wrap{display:none}
  html.mobile-app-enabled site-header[page="me"]{display:none}
  .mobile-app-nav{position:fixed;inset:auto 0 0;z-index:55;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;min-height:calc(68px + env(safe-area-inset-bottom,0px));padding:5px 10px calc(5px + env(safe-area-inset-bottom,0px));box-sizing:border-box;border-top:1px solid #ececec;background:#fff;box-shadow:0 -5px 22px rgba(0,0,0,.045)}
  .mobile-app-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:58px;padding:3px 0;border:0;background:transparent;color:#4d4d4d;text-decoration:none;font:600 11px/1.2 Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .mobile-app-tab svg{width:25px;height:25px;flex:none}
  .mobile-app-tab.is-active{color:var(--red,#e5484d);font-weight:800}
  .mobile-app-tab[data-tab="create"].is-active svg{width:29px;height:29px;padding:3px;border-radius:50%;background:var(--red,#e5484d);color:#fff;box-sizing:border-box}
  .mobile-app-tab:focus-visible,.mobile-create-sheet :focus-visible{outline:2px solid #171717;outline-offset:2px}
  .mobile-create-scrim:not([hidden]){position:fixed;inset:0;z-index:52;display:block;background:rgba(0,0,0,.58)}
  .mobile-create-sheet:not([hidden]){position:fixed;inset:auto 0 calc(68px + env(safe-area-inset-bottom,0px));z-index:54;display:flex;flex-direction:column;gap:9px;max-height:calc(100dvh - 100px - env(safe-area-inset-bottom,0px));overflow:auto;padding:20px 16px 14px;border-radius:22px 22px 0 0;background:#fff;box-sizing:border-box;box-shadow:0 -12px 38px rgba(0,0,0,.12)}
  .mobile-create-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
  .mobile-create-heading h2{margin:0;color:#171717;font-size:22px;line-height:1.25;letter-spacing:-.035em}
  .mobile-create-close{width:44px;height:44px;flex:none;border:0;background:transparent;color:#333;font-size:28px;line-height:1;cursor:pointer}
  .mobile-create-option{display:flex;align-items:center;gap:14px;min-height:76px;padding:10px 15px;border-radius:13px;background:#fff7f7;color:#171717;text-decoration:none;box-sizing:border-box}
  .mobile-create-option:active,.mobile-create-option.is-current{background:#ffecee}
  .mobile-create-icon{display:grid;place-items:center;width:34px;height:34px;flex:none;color:#de3442}
  .mobile-create-icon svg{width:31px;height:31px}
  .mobile-create-option>span:nth-child(2){display:flex;flex-direction:column;gap:4px;min-width:0}
  .mobile-create-option b{font-size:16px;line-height:1.2}
  .mobile-create-option small{font-size:12px;line-height:1.3;color:#777}
  .mobile-create-arrow{margin-left:auto;color:#333;font-size:26px;font-weight:300}
}

/* Desktop: give search and navigation their own rows, echoing the mobile header. */
@media(min-width:721px){
  .site-header{height:auto}
  .site-header .header-inner{box-sizing:border-box;width:100%;max-width:none;height:auto;min-height:120px;margin:0 auto;padding:0 24px;grid-template-columns:minmax(150px,1fr) minmax(280px,700px) minmax(150px,1fr);grid-template-rows:72px 48px;column-gap:24px;row-gap:0}
  .site-header .brand{grid-column:1;grid-row:1}
  .site-header .brand strong{font-size:27px}
  .site-header .brand small{display:none}
  .site-header .search-wrap{grid-column:2;grid-row:1;min-width:0}
  .site-header .search-wrap input{height:44px;border-radius:11px}
  .site-header .search-submit{height:44px;border-radius:11px}
  .site-header .header-actions{grid-column:1/-1;grid-row:2;justify-self:stretch;justify-content:center;position:relative;width:100%;height:48px;margin:0;border-top:1px solid #f0f0f0}
  .site-header .mobile-nav-panel{display:flex;align-items:stretch;justify-content:center;gap:4px;min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:none}
  .site-header .mobile-nav-panel::-webkit-scrollbar{display:none}
  .site-header .mobile-nav-panel>.outline-btn,.site-header .mobile-nav-panel>.solid-btn{flex:none;height:47px;padding:0 17px;border:0;border-radius:0;background:transparent;color:#5f5f5f;font-size:14px;font-weight:600}
  .site-header .mobile-nav-panel>.outline-btn:hover,.site-header .mobile-nav-panel>.solid-btn:hover{background:#fafafa;color:#171717}
  .site-header .header-actions .outline-btn.is-active,.site-header .header-actions .outline-btn.is-active:hover{background:transparent;color:var(--red,#e5484d);border-color:transparent;box-shadow:inset 0 -2px 0 var(--red,#e5484d)}
  .site-header .account-menu{position:absolute;right:0;top:-58px}
  .site-header .account-dropdown{top:52px}
}
@media(min-width:721px) and (max-width:980px){
  .site-header .header-inner{padding:0 16px;column-gap:16px}
  .site-header .mobile-nav-panel{justify-content:flex-start}
}

.header-more{position:relative;flex:none;font-size:13px}.header-more summary{cursor:pointer;padding:10px;list-style:none}.header-more-links{position:absolute;z-index:100;right:0;top:100%;width:220px;padding:8px;background:#fff;border:1px solid #ddd;border-radius:12px;box-shadow:0 12px 30px #0002}.header-more-links a{display:block;padding:12px;color:#222;text-decoration:none}.header-more-links a:hover{background:#f7f7f7}

.site-contact-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 48px);overflow:auto;padding:28px;border:1px solid #e7e7e7;border-radius:18px;color:#222;background:#fff;box-shadow:0 20px 70px #0002;font-family:inherit}.site-contact-dialog::backdrop{background:#0006}.site-contact-dialog h2{margin:0 36px 8px 0;font-size:22px}.site-contact-dialog p{font-size:14px;color:#777;margin:0 0 22px}.site-contact-dialog section{padding:18px 0;border-top:1px solid #eee}.site-contact-dialog h3{font-size:14px;margin:0 0 10px}.site-contact-number{display:flex;align-items:center;justify-content:space-between;font-size:20px;font-weight:600;gap:12px}.site-contact-number button,.site-contact-close{background:#fff;border:1px solid #ddd;border-radius:8px;cursor:pointer;padding:7px 10px;color:#555;font:inherit;font-size:13px}.site-contact-close{position:absolute;right:20px;top:20px;font-size:20px;padding:2px 9px}.site-contact-action{display:block;text-align:center;text-decoration:none;border:1px solid #ddd;border-radius:10px;padding:11px;margin-top:14px;font-size:14px;color:#222}.site-contact-action.primary{background:#ec454f;border-color:#ec454f;color:white}.site-contact-dialog small{display:block;line-height:1.7;color:#888;font-size:12px}
