/* 全局重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    margin: 20px;
}

.container {
    max-width: 1200px;
    margin: 85px auto 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 24px;
    overflow: hidden;
}

.content-wrapper {
    display: flex;
    gap: 24px;
}

.main-content {
    flex: 3;
    min-width: 0;
}

.sidebar {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
    margin-top: 0;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #666;
}

.current-page {
    color: #333;
    font-weight: 500;
}

/* 企业头部信息 */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.country-flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    margin-right: 12px;
    object-fit: cover;
}

/* 交易概况 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
    padding: 0 20px;
    margin-top: 20px;
}

.stats-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px; /* ← 增加与上方元素的间距 */
}

.stats-title::before {
    content: "📋";
    font-size: 14px;
}

.stat-item {
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8), rgba(255, 255, 255, 0.8));
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #007bff;
    margin: 0;
}

.stat-item:nth-child(1) {
    background: linear-gradient(135deg, rgba(220, 237, 255, 0.8), rgba(248, 250, 252, 0.8));
    border-color: #dce5ff;
}

.stat-item:nth-child(2) {
    background: linear-gradient(135deg, rgba(220, 255, 237, 0.8), rgba(248, 250, 252, 0.8));
    border-color: #dcefff;
}

.stat-item:nth-child(3) {
    background: linear-gradient(135deg, rgba(255, 237, 255, 0.8), rgba(248, 250, 252, 0.8));
    border-color: #ffdce5;
}

.stat-item:nth-child(4) {
    background: linear-gradient(135deg, rgba(255, 237, 237, 0.8), rgba(248, 250, 252, 0.8));
    border-color: #ffdcd9;
}

/* 图表容器 */
.chart-container {
    margin-top: 30px;
    padding: 24px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.chart {
    width: 100%;
    height: 300px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
}

/* 同行公司容器 */
.peers-container {
    margin-top: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
}

.peers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
}

.peer-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    min-height: 56px;
    background-color: #ffffff;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.peer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.peer-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e3f2fd;
    color: #1976d2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 12px;
    opacity: 0.9;
    background-color: #e3f2fd;
}

.peer-info {
    flex: 1;
}

.peer-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.peer-country {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.country-flag-small {
    width: 16px;
    height: 10px;
    border-radius: 2px;
    object-fit: cover;
}

/* 高级搜索容器 */
.advanced-search-container {
    margin-top: -19px;
    padding: 15px 15px 8px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow: hidden;
    position: relative;
    background-image: linear-gradient(
            45deg,
            rgba(200, 200, 200, 0.1) 25%,
            transparent 25%,
            transparent 50%,
            rgba(200, 200, 200, 0.1) 50%,
            rgba(200, 200, 200, 0.1) 75%,
            transparent 75%,
            transparent
    );
    background-size: 20px 20px;
    opacity: 0.9;
}

.advanced-search-container .search-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* ← 关键：垂直居中对齐 */
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.advanced-search-container .search-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.2; /* ← 紧凑行高 */
    display: flex;
    align-items: center;
}

.advanced-search-container .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 0;
    align-items: center;
}

.advanced-search-container .close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.advanced-search-container .close-btn:hover {
    color: #333;
    transform: scale(1.1);
}

/* 静态悬浮提示框 */
.permission-tooltip-static {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 200px;
    max-width: 300px;
    z-index: 1002;
    opacity: 1;
    visibility: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tooltip-content {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.tooltip-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tooltip-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* 表单通用样式 */
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin: 0;
    padding-bottom: 1px;
}

.form-control {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 0;
}

.search-form {
    padding: 12px 0;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset {
    background-color: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.btn-reset:hover {
    background-color: #e9ecef;
}

.btn-search {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-search:hover {
    background-color: #0056b3;
}

.btn-search:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #007bff;
    padding: 10px 20px;
    border: 1px solid #007bff;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

/* 权限提示层 */
.permission-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    gap: 20px;
    border-radius: 12px;
    backdrop-filter: blur(1px);
    overflow: hidden;
}

.permission-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
            45deg,
            rgba(200, 200, 200, 0.1) 25%,
            transparent 25%,
            transparent 50%,
            rgba(200, 200, 200, 0.1) 50%,
            rgba(200, 200, 200, 0.1) 75%,
            transparent 75%,
            transparent
    );
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.8;
    inset: 0;
}

.permission-text {
    text-align: center;
    padding: 0 20px;
}

.permission-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.permission-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 按钮样式优化 */
.permission-actions .btn-primary {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.permission-actions .btn-secondary {
    background-color: white;
    color: #007bff;
    padding: 10px 20px;
    border: 1px solid #007bff;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.permission-actions .btn-primary:hover,
.permission-actions .btn-secondary:hover {
    opacity: 0.9;
}

/* 留资申请表单样式 */
.application-form {
    margin-top: 20px;
}

.application-header {
    text-align: center;
    margin-bottom: 20px;
}

.application-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.application-header p {
    font-size: 14px;
    color: #666;
}

.application-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.application-body .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.application-body .form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin: 0;
}

.application-body .form-control {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.application-body .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* 表格样式 */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.trade-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.trade-table th,
.trade-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.trade-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #495057;
}

.trade-table tbody tr:hover {
    background-color: #f1f3f5;
}

/* SEO优化：隐藏内容供搜索引擎阅读 */
.chart-description {
    display: none;
}

/* 报告概述容器（新增） */
.report-overview-container {
    padding: 24px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    border-top: none;
    font-size: 14px;
}

.report-overview-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.overview-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    display: inline-block;
}

.profile-section {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* 同行公司链接样式 */
.peer-company-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.peer-company-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.peer-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .main-content {
        flex: none;
    }

    .sidebar {
        flex: none;
        width: 100%;
        margin-top: 20px;
    }

    .company-name {
        font-size: 24px;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-item {
        padding: 12px;
        min-width: auto;
    }

    .form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .application-body .form-row {
        grid-template-columns: 1fr;
    }

    .application-body .form-group {
        margin-bottom: 12px;
    }

    .permission-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-secondary {
        width: 100%;
    }

    .report-overview-container {
        margin-top: 20px;
        padding: 16px;
    }

    .overview-title {
        font-size: 15px;
    }
}
