/* C6-02 / L-01：唯一左栏 #home-side；禁止 panel-rail 形成双左栏 */
.shell-app.app {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 56px);
  padding-bottom: 64px;
}
@media (max-width: 768px) {
  .shell-app.app { grid-template-columns: 1fr; }
}

.shell-main {
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* 左栏导航样式 → rail-nav.css（#home-side 唯一源） */

.panel-rail {
  display: none !important;
  width: 0;
  background: var(--ink0);
  flex-direction: column;
  align-items: center;
  padding-top: 14px;
  gap: 12px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}
.panel-rail .rail-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #9a9890;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.panel-rail .rail-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}
.panel-rail .rail-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.panel-rail .rail-btn.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
@media (max-width: 768px) {
  .panel-rail { display: none; }
}

/* 顶栏底色与左栏 rail 对齐 #181a1d；文字/图标保持浅色 */
body.landing .site-header.top {
  background: #181a1d !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
/* 顶栏三区文字（样板 .top） */
.site-header.top .nav-mid a.home-view-nav {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #d9d7d0;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 0;
}
.site-header.top .nav-mid a.home-view-nav.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.site-header.top .top-text-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #d9d7d0;
}
.site-header.top .top-text-zone .sep { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.15); }
.site-header.top .top-text-zone b { color: var(--brass-light, #f3a55d); font-weight: 600; }
.site-header.top .top-text-btn {
  color: #d9d7d0;
  cursor: pointer;
  background: none;
  border: 0;
  font: inherit;
  padding: 0;
}
.site-header.top .top-text-btn:hover { color: #fff; }
.site-header.top .top-ver { color: rgba(255, 255, 255, 0.42); font-size: 11px; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 顶栏版本号产品化：不占右上角视觉 */
.site-header.top .top-ver.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* 分析页显示语言；创作态仍隐藏账户区控件 */
.site-header.top .top-lang-label {
  display: none;
  color: #d9d7d0;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: 0;
  font: inherit;
  padding: 0;
}
body.view-analyze .site-header.top .top-lang-label {
  display: inline !important;
}
body.view-analyze .site-header.top .top-lang-label:hover { color: #fff; }
.site-header.top .top-text-zone { margin-left: auto; }

/* 顶栏必须全视口宽：覆盖 brand.css 的 max-width:1240 + margin:auto（否则 LOGO 卡在居中盒里） */
.site-header.top .site-header-inner {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 56px;
  align-items: center;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 16px 0 12px !important;
  column-gap: 0 !important;
  box-sizing: border-box;
}
.site-header.top .brand {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
}
/* 创作态：LOGO 占最左 230px，与左栏左缘对齐；积分/兑换/账户从顶栏撤走 */
body.view-create .site-header.top .site-header-inner {
  grid-template-columns: 230px 1fr auto;
  padding-left: 0 !important;
  padding-right: 16px !important;
}
body.view-create .site-header.top .brand {
  width: 230px;
  max-width: 230px;
  box-sizing: border-box;
  padding-left: 12px !important;
  margin: 0 !important;
  justify-self: start;
}
body.view-create .site-header.top .nav-mid { justify-self: center; }
body.view-create .top-analyze-only { display: none !important; }
/* 创作态：积分/兑换/账户只留左栏底用户卡，顶栏不再重复 */
body.view-create #top-credits-wrap,
body.view-create #top-redeem,
body.view-create #top-account,
body.view-create .sep.top-analyze-only { display: none !important; }
/* 营销主页顶栏布局对齐 demo .top-in */
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .site-header.top .site-header-inner {
  display: flex !important;
  align-items: center;
  gap: 26px;
  height: 64px;
  max-width: none;
  margin: 0 auto;
  padding-inline: 28px;
  grid-template-columns: none !important;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .site-header.top .nav-mid {
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .site-header.top .top-text-zone {
  margin-left: auto;
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
}
/* LOGO：首页 / 创作 / 分析共用参考页 .brand 渐变（不重写，仅放宽选择器） */
body.landing .site-header.top .brand.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.6px;
  background: linear-gradient(90deg, #fff, var(--brass-2, #f3a55d));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
body.landing .site-header.top .brand.brand-lockup em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--brass, #e8862a), var(--brass-2, #f3a55d));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .site-header.top .nav-toggle {
  display: none !important;
}
body.landing .mode a.home-view-nav {
  height: 36px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--txt-3, #979a93);
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
}
body.landing .mode a.home-view-nav.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}
body.landing .top-cta .btn {
  height: 36px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  border-radius: 0;
}

/* 营销主页顶栏（对照 home-demo）：登录 + 注册；已登录显示账户 */
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #top-redeem,
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #top-credits-wrap,
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) .sep.top-analyze-only,
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #top-lang-label {
  display: none !important;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #top-account.hidden {
  display: none !important;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #top-cta-auth {
  display: inline-flex !important;
  gap: 8px;
  align-items: center;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #top-cta-auth.hidden {
  display: none !important;
}
body.landing:not(.view-create):not(.view-analyze):not(.view-workspace) #top-account:not(.hidden) {
  display: inline !important;
}
body.landing .btn-gen,
body.landing .btn-out {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
body.landing .btn-ico { display: block; flex: 0 0 auto; }
/* 左栏品牌已隐藏：与 compose x-nav 一致，LOGO 只在顶栏 */
.site-header.top .header-right-legacy { display: none !important; }
#header-legacy-store { display: none !important; }
.site-header.top .nav-mid { grid-column: 2; grid-row: 1; }
.site-header.top .top-text-zone {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  flex-shrink: 0;
}
.site-header.top .header-auth-legacy { display: none !important; }
.site-header.top #header-user .credits-badge,
.site-header.top #header-user .redeem-quick-action,
.site-header.top #header-user .user-menu-wrap { display: none !important; }
.site-header.top #header-user { gap: 0; }

/* R-03：分析态藏左栏/创作 iframe，壳保留单列主区（lingscan-app 在 shell-main 内，不可整壳 display:none） */
body.view-analyze .shell-app.app {
  display: grid !important;
  grid-template-columns: 1fr !important;
  max-width: none !important;
  width: 100%;
  margin: 0 !important;
}
body.view-analyze #home-side,
body.view-analyze .side,
body.view-analyze .panel-rail { display: none !important; }
body.view-analyze #home-compose-frame { display: none !important; }
body.landing.view-analyze #landing { left: 0 !important; display: none !important; }
body.view-analyze .shell-main {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}
body.view-analyze .lingscan-app { max-width: none; margin: 0; padding: 0; display: block !important; }
@media (max-width: 768px) {
  body.view-analyze .lingscan-app { padding: 0 16px; }
}

/* 创作中心：保留唯一左栏 #home-side；iframe 内 x-nav 已在 is-embed 隐藏；只让 panel-rail */
body.view-create .panel-rail { display: none !important; }
body.view-create .shell-app.app {
  grid-template-columns: 230px 1fr;
  max-width: none !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  min-height: calc(100vh - 56px);
  padding-bottom: 0 !important;
}
@media (max-width: 768px) {
  body.view-create .shell-app.app { grid-template-columns: 1fr; }
}
body.view-create .shell-main,
body.view-create .shell-main-create { max-width: none; width: 100%; margin: 0; padding: 0; }
body.view-create .shell-create-hero { display: none !important; }

body.view-workspace #home-compose-frame,
body.view-analyze #home-compose-frame { display: none !important; }
body.view-create #home-dashboard,
body.view-create .lingscan-app { display: none !important; }
body.view-workspace #home-dashboard { display: block; }
body.view-workspace .lingscan-app { display: none !important; }
body.view-analyze #home-dashboard { display: none !important; }
body.view-analyze .lingscan-app { display: block !important; }

.shell-create-hero { display: none; }
body.view-create .shell-create-hero { display: block; }

body.view-create .shell-main-create {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px - 64px);
  background: var(--canvas, #101113);
}
body.view-create .shell-create-hero {
  flex: none;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 32px 8px;
  box-sizing: border-box;
}
body.view-create .shell-create-hero h1,
body.view-create .shell-create-hero .view-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--t-1, #1d1f1e);
  letter-spacing: 0.5px;
  margin: 0;
}
body.view-create .shell-create-hero p {
  color: var(--t-3, #8a8a83);
  margin: 8px 0 0;
  font-size: 15px;
}
body.view-create #home-compose-frame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 480px;
  /* 顶栏 56px 以下全高；compose 自带底部播放条，勿再扣 dock 64px 造成「矮窄」 */
  height: calc(100vh - 56px);
  border: 0;
  background: #101113;
}
body.view-create.has-dock #home-compose-frame {
  height: calc(100vh - 56px);
}
@media (max-width: 768px) {
  body.view-create .shell-create-hero { padding: 20px 16px 4px; }
}

body.view-workspace .site-footer,
body.view-create .site-footer,
body.view-analyze .site-footer { display: none !important; }

/* 工作台 */
.main.home-dashboard {
  padding: 40px 32px 60px;
  max-width: 1120px;
  margin: 0 auto;
  box-sizing: border-box;
}
.main.home-dashboard .hero h1,
.main.home-dashboard .hero .view-title { font-size: 30px; font-weight: 800; color: var(--t-1, #1d1f1e); }
.main.home-dashboard .hero p { color: var(--t-3, #8a8a83); margin-top: 8px; font-size: 15px; }
.home-dashboard .works { margin-top: 32px; }
.home-dashboard .works h2 { font-size: 17px; font-weight: 700; color: var(--t-1); margin-bottom: 16px; }
.home-dashboard .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .home-dashboard .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .home-dashboard .grid { grid-template-columns: 1fr; } }
.home-dashboard .w-card {
  background: var(--surface, #1d1f22);
  border: 1px solid var(--line, #2a2b2e);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.home-dashboard .w-card .cov {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface-2, #1d1f22);
  flex: none;
}
.home-dashboard .w-card .meta { flex: 1; min-width: 0; }
.home-dashboard .w-card .meta .t {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-dashboard .w-card .meta .s { font-size: 11px; color: var(--t-4); }
.home-dashboard .tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 768px) { .home-dashboard .tool-grid { grid-template-columns: 1fr; } }
.home-dashboard .tool-card {
  background: var(--surface, #1d1f22);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.home-dashboard .tool-card:hover { border-color: var(--brass); }
.home-dashboard .tool-card svg { width: 22px; height: 22px; stroke: var(--brass); flex: none; }
.home-dashboard .tool-card strong { display: block; font-size: 14px; color: var(--t-1); }
.home-dashboard .tool-card small { font-size: 12px; color: var(--t-3); }

/* U-01：下载行 SVG 图标 */
.download-row-info h3 { display: flex; align-items: center; gap: 8px; }
.download-row-info .dl-ico { flex: none; color: var(--brass, #c4a574); }

/* F-03 / A-02：旧英文档位条退出视觉与 a11y，只保留 level-card */
#tier-selector,
#tier-selector[hidden],
.tier-selector.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* C6-03 分析页：无侧栏单列 + 隐藏更多工具 */
body.view-analyze #purpose-more-tools { display: none !important; }
body.view-analyze #features,
body.view-analyze #demo-walkthrough,
body.view-analyze #pricing,
body.view-analyze #contact,
body.view-analyze #faq,
body.view-analyze #downloads { display: none !important; }
/* 未出报告：空壳报告区不占 a11y；雷达无数据时整块隐藏 */
body.view-analyze:not([data-workspace-state="report"]) #results { display: none !important; }
body.view-analyze #radar.hidden { display: none !important; }
/* 分析态：保留样板「为什么选择 LINGSCAN」四卡（#highlights） */
body.view-analyze #highlights { display: block !important; }
/* 演示占位假 UI 不下屏 */
.demo-fake-ui { display: none !important; }
/* 非分析态：分析主区完全退出可访问性树 */
body:not(.view-analyze) .lingscan-app {
  display: none !important;
}
body.view-analyze .lingscan-app { display: block !important; }
/* L-01：任何视图都不显示 panel-rail，只保留 #home-side 单左栏 */
body.view-workspace .panel-rail,
body.view-create .panel-rail,
body.view-analyze .panel-rail,
.panel-rail { display: none !important; }
