/* 产业经营视图 */
:root {
    --ind-text: #f2f6ff;
    --ind-text-muted: rgba(210, 225, 255, 0.82);
    --ind-accent: #c4a86a;
    --ind-accent-strong: #e8d4a8;
    --ind-border: rgba(196, 168, 106, 0.38);
    --ind-surface: rgba(18, 16, 12, 0.82);
    --ind-input-bg: rgba(8, 8, 6, 0.88);
}

.industry-view {
    color: var(--ind-text);
    font-size: 14px;
    line-height: 1.5;
}

body.industry-mode {
    overflow: hidden;
}

body.industry-mode #particle-bg {
    background:
        radial-gradient(ellipse at 20% 16%, rgba(120, 90, 40, 0.28), transparent 46%),
        radial-gradient(ellipse at 82% 84%, rgba(80, 60, 30, 0.22), transparent 42%),
        #000;
}

.industry-view:not(.active) {
    display: none !important;
}

.industry-view.active {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 20;
    height: 100vh;
    overflow: hidden;
    background: transparent;
}

.industry-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 20px 40px;
}

.industry-shell {
    max-width: 1180px;
    margin: 0 auto;
}

.industry-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.industry-header > div:first-child {
    width: 100%;
    min-width: 0;
}

.industry-header .charsheet-actions {
    flex-shrink: 0;
}

.industry-kicker {
    margin: 0 0 4px;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ind-accent);
}

.industry-title {
    margin: 0;
    font-size: 28px;
    color: var(--ind-accent-strong);
}

.industry-sub {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--ind-text-muted);
}

.industry-login-gate {
    padding: 40px 24px;
    text-align: center;
    border: 1px dashed var(--ind-border);
    border-radius: 12px;
    color: var(--ind-text-muted);
}

.industry-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    align-items: start;
}

.industry-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.industry-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ind-border);
    border-radius: 10px;
    background: var(--ind-surface);
    color: var(--ind-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.industry-card:hover,
.industry-card.active {
    border-color: rgba(228, 200, 140, 0.65);
    background: rgba(40, 32, 16, 0.88);
}

.industry-card-name {
    font-weight: 600;
    color: var(--ind-accent-strong);
}

.industry-card-meta {
    font-size: 12px;
    color: var(--ind-text-muted);
}

.industry-main {
    min-width: 0;
    border: 1px solid var(--ind-border);
    border-radius: 12px;
    background: var(--ind-surface);
    overflow: hidden;
}

.industry-main-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ind-border);
}

.industry-active-title {
    margin: 0;
    font-size: 20px;
    color: var(--ind-accent-strong);
}

.industry-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 16px 0;
    border-bottom: 1px solid var(--ind-border);
}

.industry-tab {
    padding: 10px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--ind-text-muted);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.industry-tab.active {
    color: var(--ind-accent-strong);
    border-bottom-color: var(--ind-accent);
}

.industry-panel {
    padding: 20px;
}

.industry-panel.industry-panel-rules {
    padding: 0;
}

.industry-layout.industry-layout-rules {
    grid-template-columns: 1fr;
}

.industry-layout.industry-layout-rules .industry-sidebar {
    display: none;
}

.industry-rules-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
    min-height: 480px;
}

.industry-rules-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--ind-border);
    background: rgba(8, 6, 4, 0.55);
    max-height: calc(100vh - 220px);
    overflow: hidden;
}

.industry-rules-sidebar-head {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--ind-border);
    background: linear-gradient(180deg, rgba(196, 168, 106, 0.12), transparent);
}

.industry-rules-search {
    border-bottom-color: rgba(196, 168, 106, 0.16);
}

.industry-rules-search .book-sidebar-search-input:focus {
    border-color: rgba(228, 200, 140, 0.55);
    box-shadow: 0 0 0 2px rgba(196, 168, 106, 0.18);
}

.industry-rules-nav-filter-hint {
    margin: 0 4px 10px;
    font-size: 11px;
    color: var(--ind-text-muted);
}

.industry-rules-nav-empty {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--ind-text-muted);
    list-style: none;
}

.industry-rules-link.is-search-match {
    color: var(--ind-accent-strong);
}

.industry-rules-sidebar-kicker {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--ind-accent);
}

.industry-rules-sidebar-title {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--ind-accent-strong);
}

.industry-rules-sidebar-sub {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ind-text-muted);
}

.industry-rules-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 8px 16px;
}

.industry-rules-nav-group {
    margin-bottom: 8px;
}

.industry-rules-group-name,
.industry-rules-link {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ind-text-muted);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.industry-rules-group-name:hover,
.industry-rules-group-name.active,
.industry-rules-link:hover,
.industry-rules-link.active {
    background: rgba(196, 168, 106, 0.14);
    color: var(--ind-accent-strong);
}

.industry-rules-link.active {
    border-left: 2px solid var(--ind-accent);
}

.industry-rules-link-top {
    margin-top: 4px;
}

.industry-rules-section-list {
    list-style: none;
    margin: 0;
    padding: 0 0 4px 8px;
}

.industry-rules-section-list.hidden {
    display: none;
}

.industry-rules-section-list .industry-rules-link {
    padding: 7px 12px 7px 16px;
    font-size: 12px;
}

.industry-rules-main {
    min-width: 0;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 24px 28px 32px;
}

.industry-rules-hub.hidden,
.industry-rules-article.hidden {
    display: none;
}

.industry-rules-hub-title {
    margin: 0 0 8px;
    font-size: 26px;
    color: var(--ind-accent-strong);
}

.industry-rules-hub-sub {
    margin: 0 0 24px;
    font-size: 13px;
    color: var(--ind-text-muted);
}

.industry-rules-hub-group {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--ind-accent);
}

.industry-rules-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.industry-rules-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 14px;
    border: 1px solid var(--ind-border);
    border-radius: 12px;
    background: rgba(196, 168, 106, 0.06);
    color: var(--ind-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.industry-rules-card:hover {
    border-color: rgba(228, 200, 140, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.industry-rules-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ind-accent-strong);
}

.industry-rules-card-meta {
    font-size: 12px;
    color: var(--ind-text-muted);
}

.industry-rules-article-head {
    margin-bottom: 20px;
}

.industry-rules-back-hub {
    margin: 0 0 12px;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--ind-accent);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.industry-rules-back-hub:hover {
    color: var(--ind-accent-strong);
}

.industry-rules-article-title {
    margin: 0;
    font-size: 24px;
    color: var(--ind-accent-strong);
}

.industry-rules-article-body {
    min-width: 0;
}

.industry-section {
    margin-bottom: 22px;
}

.industry-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--ind-accent-strong);
}

.industry-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.industry-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.industry-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.industry-field-span2 {
    grid-column: span 2;
}

.industry-label {
    font-size: 12px;
    color: var(--ind-text-muted);
}

.industry-input,
.industry-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--ind-border);
    border-radius: 8px;
    background: var(--ind-input-bg);
    color: var(--ind-text);
    font-family: inherit;
    font-size: 14px;
}

.industry-textarea {
    resize: vertical;
    min-height: 72px;
}

.industry-trait-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.industry-trait-check {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--ind-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 13px;
    cursor: pointer;
}

.industry-trait-check.has-trait-tooltip:hover {
    border-color: rgba(228, 200, 140, 0.55);
    z-index: 2;
}

.industry-trait-check-label {
    flex: 1;
    min-width: 0;
}

.industry-trait-tooltip {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    padding: 10px 12px;
    border: 1px solid rgba(228, 200, 140, 0.45);
    border-radius: 8px;
    background: rgba(24, 20, 12, 0.96);
    color: var(--ind-text);
    font-size: 12px;
    line-height: 1.55;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 10;
}

.industry-trait-check.has-trait-tooltip:hover .industry-trait-tooltip {
    display: block;
}

.industry-trait-check input {
    accent-color: var(--ind-accent);
}

.industry-ref-pre {
    margin: 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ind-text-muted);
}

.industry-type-ref .industry-ref-pre {
    max-height: 220px;
    overflow-y: auto;
}

.industry-empty {
    color: var(--ind-text-muted);
    font-size: 13px;
}

.industry-rules-head h3 {
    margin: 0 0 6px;
    color: var(--ind-accent-strong);
}

.industry-rules-credit {
    margin: 0 0 16px;
    font-size: 12px;
    color: var(--ind-text-muted);
}

.industry-rules-intro p {
    margin: 0 0 10px;
    color: var(--ind-text-muted);
    line-height: 1.65;
}

.industry-rules-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ind-border);
}

.industry-rules-toc-link {
    padding: 6px 12px;
    border: 1px solid var(--ind-border);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--ind-accent-strong);
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.industry-rules-toc-link:hover {
    background: rgba(80, 60, 24, 0.45);
    border-color: rgba(228, 200, 140, 0.55);
}

.industry-rules-anchor {
    margin-bottom: 28px;
    scroll-margin-top: 16px;
}

.industry-rules-section {
    margin-bottom: 18px;
}

.industry-rules-section-title {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--ind-accent-strong);
}

.industry-rules-prose p {
    margin: 0 0 8px;
    color: var(--ind-text-muted);
    line-height: 1.65;
}

.industry-rules-detail p {
    font-family: inherit;
    white-space: pre-wrap;
}

.industry-rules-prose .book-mark-reaction {
    color: #6ec8ff;
    font-weight: 600;
}

.industry-rules-prose .book-mark-alert {
    color: #ff9f9f;
    font-weight: 600;
}

.industry-rules-prose .book-mark-emphasis {
    color: #ff8a8a;
    font-weight: 600;
}

.industry-rules-subtitle {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--ind-accent);
}

.industry-rules-full-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--ind-text-muted);
}

.industry-rules-block-body {
    padding: 0 14px 14px;
}

.industry-ref-pre-detail {
    max-height: none;
}

.industry-ref-pre-full {
    max-height: 520px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.6;
}

.industry-trait-desc-heading {
    margin: 14px 0 8px;
    font-size: 13px;
    color: #c8e8b0;
}

.industry-trait-desc-heading-neg {
    color: #ffb8a0;
}

.industry-trait-desc-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

.industry-trait-desc-list li {
    margin-bottom: 8px;
    color: var(--ind-text-muted);
    line-height: 1.6;
    font-size: 13px;
}

.industry-trait-desc-list-pos li::marker {
    color: #a8d890;
}

.industry-trait-desc-list-neg li::marker {
    color: #ff9a80;
}

.industry-section-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--ind-text-muted);
}

.industry-rules-block {
    margin-bottom: 8px;
    border: 1px solid var(--ind-border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.industry-rules-block summary {
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 600;
    color: var(--ind-accent-strong);
}

.industry-rules-block .industry-ref-pre {
    margin: 0 14px 10px;
}

.industry-rules-tags {
    margin: 0 14px 12px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ind-text-muted);
}

.industry-rules-tags-neg {
    color: rgba(255, 180, 160, 0.85);
}

.industry-portal {
    border: 1px solid rgba(210, 175, 90, 0.52);
    background:
        linear-gradient(135deg, rgba(70, 52, 18, 0.42), rgba(35, 28, 12, 0.38)),
        rgba(255, 255, 255, 0.04);
}

.industry-portal:hover {
    border-color: rgba(240, 210, 130, 0.75);
    box-shadow: 0 0 28px rgba(180, 140, 60, 0.28), inset 0 0 24px rgba(120, 90, 40, 0.1);
}

.industry-portal .library-portal-glow {
    background: radial-gradient(circle at 30% 30%, rgba(240, 200, 100, 0.35), transparent 62%);
}

.industry-portal .library-portal-icon {
    background: rgba(90, 65, 20, 0.55);
    color: #ffe8b8;
    box-shadow: 0 0 16px rgba(200, 160, 80, 0.35);
}

.industry-portal .library-portal-title {
    color: #fff4dc;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.industry-portal .library-portal-sub {
    color: rgba(255, 236, 200, 0.82);
}

.industry-portal .library-portal-arrow {
    color: rgba(255, 236, 200, 0.92);
}

@media (max-width: 768px) {
    .industry-layout {
        grid-template-columns: 1fr;
    }

    .industry-rules-shell {
        grid-template-columns: 1fr;
    }

    .industry-rules-sidebar {
        max-height: 38vh;
        border-right: none;
        border-bottom: 1px solid var(--ind-border);
    }

    .industry-rules-main {
        max-height: none;
        padding: 18px 16px 24px;
    }

    .industry-grid-2,
    .industry-field-span2 {
        grid-template-columns: 1fr;
    }

    .industry-field-span2 {
        grid-column: span 1;
    }

    .industry-grid-3 {
        grid-template-columns: 1fr;
    }
}
