/* Detail page — BigTradeData style */

.detail-hero {
    padding: 18px 0 36px;
    background:
        linear-gradient(180deg, #edf5ff 0%, #f3f6fb 100%);
    border-bottom: 1px solid #e4ecf6;
}

.breadcrumb {
    margin: 0 0 18px;
    color: #8aa0ba;
    font-size: 13px;
}

.breadcrumb a {
    color: #8aa0ba;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--blue);
}

.breadcrumb span {
    margin: 0 8px;
    color: #c2cede;
}

.company-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.company-head__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.company-head__title-row h1 {
    margin: 0;
    color: var(--navy);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
}

.country-flag {
    flex: none;
    width: 28px;
    height: auto;
    max-height: 20px;
    border: 1px solid var(--line);
    border-radius: 3px;
    object-fit: cover;
}

.country-flag--sm {
    width: 16px;
    max-height: 12px;
    vertical-align: -1px;
}

.meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.meta-chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid #e2eaf4;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
}

.meta-chips__label {
    color: #8a98ab;
}

.meta-chips strong {
    font-weight: 700;
}

.company-head__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    flex: none;
}

.button-ghost {
    color: #3d5573;
    background: #fff;
    border: 1px solid #d5e0ee;
}

.button-ghost:hover {
    border-color: #b7cbe4;
    color: var(--blue);
}

.button-text {
    color: #708399;
    background: transparent;
    border: 0;
    height: 38px;
    padding: 0 12px;
}

.button-text:hover {
    color: var(--blue);
}

.button-lock {
    gap: 8px;
}

.button-lock svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: none;
}

.detail-body {
    margin-top: -12px;
    padding-bottom: 56px;
}

.notice {
    margin: 0 0 14px;
    padding: 10px 12px;
    color: #b85020;
    background: #fff3eb;
    border-radius: 8px;
}

/* Shared panel */
.panel {
    margin-bottom: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel__head h2 {
    margin: 0;
    color: var(--navy);
    font-size: 17px;
    font-weight: 700;
}

.panel__head p {
    margin: 4px 0 0;
    color: #8a98ab;
    font-size: 12px;
}

.panel__head a {
    color: var(--blue);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.panel__head a:hover {
    text-decoration: underline;
}

/* Advanced search (locked preview + mask) */
.adv-search {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, #f4f9ff 0%, #fff 48%);
}

.adv-search.is-locked {
    background-image:
        linear-gradient(180deg, rgba(244, 249, 255, 0.55) 0%, rgba(255, 255, 255, 0.4) 48%),
        repeating-linear-gradient(
            45deg,
            rgba(148, 163, 184, 0.035) 0,
            rgba(148, 163, 184, 0.035) 8px,
            transparent 8px,
            transparent 16px
        );
}

.adv-search__head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adv-search__head-actions .button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.adv-search__head-actions .button-primary svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.adv-search__body {
    position: relative;
    min-height: 148px;
}

.adv-search__form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
}

.adv-search.is-locked .adv-search__form {
    opacity: 0.92;
    pointer-events: none;
    user-select: none;
}

.adv-search__form label {
    display: grid;
    gap: 6px;
    color: #61748c;
    font-size: 12px;
}

.adv-search__form input,
.adv-search__form select {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d8e3f0;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.adv-search__form input:disabled,
.adv-search__form select:disabled {
    background: #f7fafd;
    color: #8090a5;
    cursor: not-allowed;
}

.adv-search__mask {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: transparent;
    pointer-events: none;
}

.adv-search__lock-card {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 300px;
    padding: 18px 22px;
    border: 1px solid #d7e4f4;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 28px rgba(22, 48, 86, 0.12);
    text-align: center;
}

.adv-search__lock-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--blue-soft);
    color: var(--blue);
}

.adv-search__lock-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.adv-search__lock-card p {
    margin: 0;
    color: #51657f;
    font-size: 14px;
    font-weight: 600;
}

/* Locked feature shortcuts under advanced search */
.locked-nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.locked-nav__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #d7e0ec;
    border-radius: 8px;
    background: #fff;
    color: #5b6b80;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.locked-nav__btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.locked-nav__btn:hover {
    border-color: #9eb6d6;
    color: var(--blue);
    background: #f5f9ff;
}

/* KPI */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.kpi-card span {
    display: block;
    color: #8090a5;
    font-size: 12px;
}

.kpi-card strong {
    display: block;
    margin-top: 6px;
    color: var(--navy);
    font-size: clamp(16px, 1.6vw, 22px);
    font-weight: 700;
    line-height: 1.15;
    word-break: break-word;
}

.kpi-card > div:last-child {
    min-width: 0;
    flex: 1;
}

.kpi-card__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.kpi-card__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kpi-card--blue .kpi-card__icon { background: #e8f2ff; color: #1479e9; }
.kpi-card--green .kpi-card__icon { background: #e8f7f0; color: #1f9d6a; }
.kpi-card--purple .kpi-card__icon { background: #f1eef9; color: #6d5ea8; }
.kpi-card--orange .kpi-card__icon { background: #fff1e8; color: #d97706; }

.kpi-card--blue strong { color: #1479e9; }
.kpi-card--green strong { color: #1f9d6a; }
.kpi-card--purple strong { color: #6d5ea8; }
.kpi-card--orange strong { color: #d97706; }

/* Charts */
.charts-row,
.lists-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
    align-items: stretch;
}

.chart-panel,
.records-panel,
.peers-panel {
    margin-bottom: 0;
    min-width: 0;
}

.records-panel,
.peers-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* 两侧始终等高：内容区固定高度，条数多少都整齐 */
.lists-row .panel__scroll {
    height: 420px;
    max-height: 420px;
    overflow: auto;
    margin: 0 -4px;
    padding: 0 4px;
    scrollbar-gutter: stable;
}

.panel__scroll--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, #f8fbff 0%, #fff 100%);
    border: 1px dashed #d7e4f4;
    border-radius: 10px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 280px;
    padding: 16px;
    text-align: center;
}

.empty-state[hidden],
.table-wrap[hidden],
.peer-list[hidden],
.is-hidden {
    display: none !important;
}

.empty-state__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    border-radius: 12px;
    background: var(--blue-soft);
    color: var(--blue);
}

.empty-state__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state p {
    margin: 0;
    color: #3d5573;
    font-size: 15px;
    font-weight: 700;
}

.empty-state span {
    color: #8a98ab;
    font-size: 12px;
    line-height: 1.6;
}

.empty-state .button {
    margin-top: 8px;
    min-width: 120px;
}

.panel__scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.panel__scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c9d6e6;
}

.panel__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    background: #f5f8fc;
}

.segmented button {
    border: 0;
    border-radius: 6px;
    padding: 5px 12px;
    background: transparent;
    color: #708399;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

.segmented button.is-active {
    color: var(--blue);
    background: #fff;
    box-shadow: 0 1px 3px rgba(22, 48, 86, 0.08);
}

.chart {
    height: 320px;
}

.country-chart {
    height: 320px;
}

/* Tables & peers */
.table-wrap {
    overflow: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf1f6;
    text-align: left;
    font-size: 13px;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #5e718a;
    background: #f7fafd;
    font-weight: 600;
    white-space: nowrap;
}

td {
    color: #53647a;
}

.cell-ellipsis {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-amount {
    color: var(--navy);
    font-weight: 700;
    white-space: nowrap;
}

.empty-cell {
    text-align: center;
    color: #93a1b1;
    padding: 28px 10px;
}

.peer-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.peer-list > li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #edf1f6;
}

.peer-list > li:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
}

.peer-list > li:first-child {
    padding-top: 2px;
}

.peer-list__empty {
    display: block !important;
    padding: 28px 0 !important;
    color: #93a1b1;
    text-align: center;
}

.peer-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, #167ae8, #5db1ff);
}

.tone-0 .peer-avatar { background: linear-gradient(135deg, #167ae8, #5db1ff); }
.tone-1 .peer-avatar { background: linear-gradient(135deg, #1f9d6a, #4ec896); }
.tone-2 .peer-avatar { background: linear-gradient(135deg, #6d5ea8, #9b8fd0); }
.tone-3 .peer-avatar { background: linear-gradient(135deg, #d97706, #f0a54a); }
.tone-4 .peer-avatar { background: linear-gradient(135deg, #0e8aa8, #45b8d0); }

.peer-meta {
    min-width: 0;
}

.peer-meta a {
    display: block;
    overflow: hidden;
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.peer-meta a:hover {
    color: var(--blue);
}

.peer-meta small {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: #96a4b5;
    font-size: 12px;
}

.peer-stat {
    text-align: right;
}

.peer-stat em {
    display: block;
    color: var(--navy);
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
}

.peer-stat span {
    color: #96a4b5;
    font-size: 11px;
}

/* Report & tags */
.report-panel .report-summary {
    display: grid;
    gap: 14px;
}

.report-panel .report-summary p {
    margin: 0;
    color: #51657f;
    font-size: 14px;
    line-height: 1.85;
}

.report-panel small {
    display: block;
    margin-top: 14px;
    color: #93a1b1;
    line-height: 1.7;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s;
}

.tag-cloud a:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(22, 48, 86, 0.08);
}

.tag-cloud a.tone-0 { background: #e8f2ff; color: #1479e9; }
.tag-cloud a.tone-1 { background: #e8f7f0; color: #1f9d6a; }
.tag-cloud a.tone-2 { background: #f1eef9; color: #6d5ea8; }
.tag-cloud a.tone-3 { background: #fff1e8; color: #d97706; }
.tag-cloud a.tone-4 { background: #e8f7fb; color: #0e8aa8; }
.tag-cloud a.tone-5 { background: #fdecef; color: #c2415b; }

.data-footnote {
    margin: 8px 0 0;
    color: #93a1b1;
    font-size: 12px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1100px) {
    .adv-search__form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .company-head {
        flex-direction: column;
    }

    .company-head__actions {
        justify-content: flex-start;
    }

    .kpi-grid,
    .charts-row,
    .lists-row {
        grid-template-columns: 1fr 1fr;
    }

    .locked-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .charts-row,
    .lists-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .company-head__title-row h1 {
        font-size: 22px;
    }

    .kpi-grid,
    .adv-search__form {
        grid-template-columns: 1fr;
    }

    .locked-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .adv-search__head-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .chart,
    .country-chart {
        height: 260px;
    }

    .panel {
        padding: 14px;
    }

    .company-head__actions {
        width: 100%;
    }

    .company-head__actions .button {
        flex: 1;
    }
}
