/* 输入页永不承载角色报告；报告只允许在独立结果页显示。 */
body:not(.corp-report-mode) #corpReportHeader,
body:not(.corp-report-mode) #corpResultSection {
    display: none !important;
}
/* 命局角色首屏：与财富 K 线页采用相同的独立首屏样式加载方案。 */
.corp-input-form .panel-title { margin-bottom: 14px; }
.corp-hour-unknown-label { display:flex; align-items:flex-start; gap:8px; color:var(--text-dim); font-size:12px; line-height:1.55; cursor:pointer; }
.corp-hour-unknown-label input { margin-top:3px; accent-color:var(--gold); }
#corpDatetimeWheelPicker.hour-unknown .wheel-hour,
#corpDatetimeWheelPicker.hour-unknown .wheel-minute { opacity:.4; }
.corp-action-row { align-items:stretch; gap:12px; }
.corp-action-row .btn-paipan-large,
.corp-action-row .btn-case-import { min-height:50px; margin:0; display:flex; align-items:center; justify-content:center; }
.corp-action-row .btn-paipan-large { flex:1.65; }
.corp-action-row .btn-case-import { flex:1; border-color:rgba(201,169,110,.68); color:var(--gold); background:transparent; font-weight:600; }
.corp-action-row .btn-case-import:hover { background:rgba(201,169,110,.1); }
.corp-input-form .true-solar-info:not(.show) { display:none; }

#corpResultSection {
    scroll-margin-top: 72px;
}

.corp-result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 4px 4px 12px;
    border-bottom: 1px solid rgba(201,169,110,.42);
}

.corp-result-toolbar-title {
    color: var(--gold);
    font-size: 17px;
    font-weight: 600;
}

.corp-result-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.corp-input-stage {
    display: grid;
    grid-template-columns: minmax(500px, .96fr) minmax(380px, 1.04fr);
    gap: clamp(12px, 2vw, 30px);
    align-items: stretch;
    margin-bottom: 2px;
}

#corpInputSection {
    width: 100%;
    max-width: none;
    padding: 20px 24px;
}

.corp-input-stage .corp-input-form { margin: 0; }
.corp-category-inline { display:none; align-items:center; gap:6px; min-height:28px; white-space:nowrap; }
.corp-category-inline.show { display:inline-flex; }
.corp-category-inline-label { color:var(--text-dim); font-size:12px; }
.corp-category-inline .category-chips { flex-wrap:nowrap; gap:4px; }
.corp-category-inline .category-chip { padding:4px 10px; }
#corpInputSection .options-toggle-group { column-gap:6px; }

.corp-role-visual {
    min-width: 0;
    min-height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
}

.corp-role-visual img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 390px;
    object-fit: contain;
    object-position: center;
}

body.dark-theme:not(.light-theme) .corp-role-visual { background:transparent; }
body.dark-theme:not(.light-theme) .corp-role-visual img {
    opacity: .86;
    mix-blend-mode: screen;
    filter: invert(1) hue-rotate(180deg) brightness(.86) saturate(1.08);
}

@media (max-width: 1040px) {
    .corp-input-stage { grid-template-columns:minmax(460px, 1.08fr) minmax(280px, .92fr); gap:14px; }
    .corp-category-inline-label { display:none; }
    .corp-role-visual img { max-height:340px; }
}

@media (max-width: 820px) {
    .corp-input-stage { grid-template-columns:1fr; }
    .corp-input-stage .corp-input-form { order:0; }
    .corp-input-stage .corp-role-visual { order:1; }
    .corp-role-visual { min-height:220px; }
    .corp-role-visual img { width:min(100%, 680px); height:auto; max-height:300px; }
}

@media (max-width: 560px) {
    .corp-input-stage { gap:10px; }
    #corpInputSection { padding:20px 16px; }
    .corp-category-inline { display:none !important; }
    .corp-action-row { flex-direction:column; }
    .corp-action-row .btn-paipan-large,
    .corp-action-row .btn-case-import { width:100%; flex:none; }
    .corp-role-visual { display:none; }
    .corp-result-toolbar { align-items:flex-start; flex-direction:column; }
    .corp-result-toolbar-actions { justify-content:flex-start; width:100%; }
}

@media (prefers-reduced-motion: no-preference) {
    .corp-role-visual img { animation:corpRoleVisualEnter .65s ease-out both; }
}

@keyframes corpRoleVisualEnter {
    from { opacity:0; transform:translateY(6px); }
    to { opacity:1; transform:translateY(0); }
}

/* 2026-08-25 result layout: immediate toolbar state + compact desktop summary. */
.corp-result-toolbar-title:focus { outline: none; }
.corp-result-toolbar-actions .btn-sm:disabled {
    opacity: .46;
    cursor: not-allowed;
    transform: none;
}
.corp-result-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
    margin-bottom: 18px;
}
.corp-result-summary-grid > * { min-width: 0; }
.corp-result-summary-grid .corp-module { margin: 0; }
.corp-summary-hero .corp-hero-card {
    height: 100%;
    min-height: 100%;
    margin: 0 !important;
    box-sizing: border-box;
}
.corp-result-placeholder {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-dim);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg2);
    box-sizing: border-box;
}

.corp-paipan-card { padding: 14px 14px 12px !important; height: 100%; box-sizing: border-box; }
.corp-paipan-meta { margin-bottom: 10px !important; gap: 6px !important; }
.corp-paipan-meta > div:first-child > span:first-child { font-size: 15px !important; }
.corp-paipan-meta > div:first-child > span { font-size: 12px !important; }
.corp-paipan-meta > div:last-child { font-size: 11px !important; line-height: 1.45 !important; }
.corp-pillar-grid { gap: 8px !important; margin-bottom: 10px !important; }
.corp-pillar-item > div:first-child { margin-bottom: 5px !important; font-size: 11px !important; }
.corp-pillar-char { font-size: 36px !important; }
.corp-pillar-item > div:nth-child(3) { margin-bottom: 7px !important; font-size: 10px !important; }
.corp-canggan-list { min-height: 34px !important; margin-top: 5px !important; }
.corp-canggan-list > div { font-size: 11px !important; line-height: 1.45 !important; }
.corp-paipan-extra { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border); }
.corp-paipan-extra > summary { cursor: pointer; color: var(--gold); font-size: 11px; list-style-position: inside; }
.corp-paipan-dayun { margin-top: 9px; }
.corp-paipan-extra-meta { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--border); display: flex; gap: 10px; flex-wrap: wrap; color: #999; font-size: 10px; }

@media (max-width: 900px) {
    .corp-result-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .corp-pillar-char { font-size: 33px !important; }
}

@media (max-width: 760px) {
    .corp-result-summary-grid { grid-template-columns: 1fr; }
    .corp-result-summary-grid #corpPaipan { order: 1; }
    .corp-result-summary-grid #corpOverviewHero { order: 2; }
    .corp-paipan-card { height: auto; }
}

@media (max-width: 560px) {
    .corp-result-toolbar { align-items: center; flex-direction: row; gap: 6px; }
    .corp-result-toolbar-title { flex: 0 0 auto; font-size: 15px; }
    .corp-result-toolbar-actions { width: auto; margin-left: auto; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
    .corp-result-toolbar-actions .btn-sm { padding: 4px 7px !important; font-size: 10px !important; }
    #corpCacheBadge { padding: 2px 6px !important; font-size: 10px !important; }
    .corp-result-summary-grid { gap: 10px; }
    .corp-pillar-char { font-size: 34px !important; }
}

/* 2026-08-29 standalone corporate report page. */
body.corp-report-mode #corpLandingTitle,
body.corp-report-mode #corpAboutPanel,
body.corp-report-mode #corpInputStage {
    display: none !important;
}

.corp-report-header[hidden] { display: none; }
.corp-report-header {
    border-bottom: 1px solid var(--border);
}
.corp-report-heading-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 4px 4px 18px;
}
.corp-report-back {
    color: var(--gold);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.corp-report-back:hover { text-decoration: underline; }
.corp-report-subject { min-width: 0; }
.corp-report-subject h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.35;
    letter-spacing: .02em;
}
.corp-report-subject p {
    margin: 6px 0 0;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.corp-report-header .corp-result-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.corp-report-header .btn-sm {
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card, #fff);
    color: var(--text);
    cursor: pointer;
}
.corp-report-header #corpReanalyzeBtn {
    border-color: var(--gold);
    background: var(--gold);
    color: #111;
    font-weight: 700;
}
.corp-report-header .btn-sm:disabled {
    opacity: .46;
    cursor: not-allowed;
}
.corp-cache-badge {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid rgba(201,169,110,.34);
    border-radius: 7px;
    background: rgba(201,169,110,.11);
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.corp-report-tabs {
    display: flex;
    align-items: flex-end;
    min-height: 44px;
}
.corp-report-tabs button {
    position: relative;
    align-self: stretch;
    padding: 0 18px;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 600;
}
.corp-report-tabs button.active { color: var(--gold); }
.corp-report-tabs button.active::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: -1px;
    left: 12px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--gold);
}
.corp-report-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg2);
    color: var(--text-dim);
    text-align: center;
}
.corp-report-empty strong { color: var(--text); font-size: 18px; }
.corp-report-empty a { color: var(--gold); }
.corp-preview-org {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.corp-preview-org-chief {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px;
    border: 1px solid rgba(201,169,110,.28);
    border-radius: 10px;
    background: rgba(201,169,110,.07);
}
.corp-preview-org-chief b { color: var(--gold); }
.corp-preview-org-chief span { color: var(--text-dim); font-size: 12px; }
.corp-preview-depts {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    margin-top: 4px;
}
.corp-preview-depts span {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 13px;
}
.corp-preview-depts i {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(201,169,110,.13);
}
.corp-preview-depts i::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--corp-preview-power);
    border-radius: inherit;
    background: linear-gradient(90deg,var(--gold),#e3c889);
}

@media (max-width: 900px) {
    .corp-report-heading-row {
        grid-template-columns: 1fr auto;
    }
    .corp-report-back {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    body.corp-report-mode .card { padding: 18px 14px; }
    .corp-report-heading-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-bottom: 14px;
    }
    .corp-report-back { grid-column: auto; }
    .corp-report-header .corp-result-toolbar-actions {
        justify-content: flex-start;
        gap: 6px;
    }
    .corp-report-header .btn-sm {
        min-height: 32px;
        padding: 5px 9px;
        font-size: 11px;
    }
    .corp-report-tabs { min-height: 42px; }
    .corp-report-tabs button { padding: 0 14px; }
}
