/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 重置导航栏中的表单元素样式 */
.navbar input,
.navbar button,
.navbar form {
    box-sizing: border-box;
    font-family: inherit;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 50px;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.navbar .navbar-search {
    display: inline-flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 0;
    transition: all 0.2s ease;
    max-width: 260px;
    width: 100%;
    height: 36px;
    overflow: hidden;
    vertical-align: middle;
    margin: 0;
}

.navbar .navbar-search:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.25);
}

.navbar .navbar-search:focus-within {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    outline: none;
}

.navbar .search-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-size: 13.5px !important;
    padding: 0 14px 0 16px !important;
    outline: none !important;
    min-width: 0;
    height: 100% !important;
    line-height: 36px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.navbar .search-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.navbar .search-btn {
    background: transparent !important;
    border: none !important;
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 0 20px 20px 0 !important;
    width: 38px !important;
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.navbar .search-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
}

.navbar .search-btn:active {
    background: rgba(255, 255, 255, 0.12) !important;
}

.navbar .search-btn svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .nav-right {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        justify-content: stretch;
    }
    
    .navbar-search {
        max-width: none;
        flex: 1;
        min-width: 0;
    }
}

/* 页头 */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.summary {
    color: #666;
    font-size: 0.9rem;
}

/* 导航卡片 */
.nav-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.nav-card h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.nav-card .count {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* 报告列表 */
.reports-list {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.reports-table thead {
    background-color: #f8f9fa;
}

.reports-table th,
.reports-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.reports-table th {
    font-weight: 600;
    color: #495057;
}

.reports-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 按钮 */
.btn-view,
.btn-back {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-view:hover,
.btn-back:hover {
    background-color: #0056b3;
}

.btn-back {
    margin-bottom: 1rem;
}

/* 报告详情 */
.report-metadata {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.report-metadata h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.report-metadata dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
}

.report-metadata dt {
    font-weight: 600;
    color: #666;
}

.report-metadata dd {
    color: #333;
}

/* 投资建议卡片 */
.report-verdict {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.report-verdict h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.verdict-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.verdict-recommendation {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.recommendation-label {
    font-size: 1rem;
    opacity: 0.9;
}

.recommendation-value {
    font-size: 1.8rem;
    font-weight: bold;
}

.verdict-recommendation.buy {
    color: #28a745;
}

.verdict-recommendation.neutral {
    color: #ffc107;
}

.verdict-recommendation.avoid {
    color: #dc3545;
}

.verdict-confidence {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.confidence-label {
    opacity: 0.9;
}

.confidence-value {
    font-weight: bold;
    font-size: 1.2rem;
}

.verdict-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    line-height: 1.8;
}

/* 报告内容 */
.report-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.report-content h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.markdown-content {
    line-height: 1.8;
    color: #333;
}

.markdown-content h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    color: #2c3e50;
}

.markdown-content h1 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #007bff;
    color: #2c3e50;
}

.markdown-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #6c757d;
    color: #495057;
}

.markdown-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child {
    margin-top: 0;
}

.markdown-content p {
    margin-bottom: 1rem;
    text-align: justify;
    line-height: 1.8;
}

.markdown-content strong {
    color: #495057;
    font-weight: 600;
}

.markdown-content ul,
.markdown-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    padding-left: 0;
}

.markdown-content li {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.markdown-content ul li {
    list-style-type: disc;
}

.markdown-content ol li {
    list-style-type: decimal;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 2rem 0;
}

.markdown-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.markdown-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

/* 附录 */
.report-appendix {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.report-appendix h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.appendix-section {
    margin-bottom: 2rem;
}

.appendix-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #495057;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.stat-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #495057;
    text-transform: capitalize;
}

.stat-card dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.stat-card dt {
    font-weight: 600;
    color: #666;
}

.stat-card dd {
    color: #333;
}

.scoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.score-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.score-dimension {
    font-weight: 600;
    color: #495057;
    text-transform: capitalize;
}

.score-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
}

.score-evidence {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.missing-items,
.evidence-list {
    list-style: none;
    padding-left: 0;
}

.missing-items li,
.evidence-list li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

.evidence-list li {
    background: #d1ecf1;
    border-left-color: #17a2b8;
}

/* JSON 查看器 */
.report-raw {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.report-raw h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.report-raw details {
    cursor: pointer;
}

.report-raw summary {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 600;
    color: #495057;
}

.report-raw summary:hover {
    background: #e9ecef;
}

.json-viewer {
    overflow-x: auto;
    margin-top: 1rem;
}

.json-content {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 600px;
    overflow-y: auto;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* 错误页 */
.error-page {
    text-align: center;
    padding: 3rem;
}

.error-page h1 {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* 页脚 */
.footer {
    margin-top: 3rem;
    padding: 2rem 0;
    background-color: #2c3e50;
    color: white;
    text-align: center;
}

.footer p {
    margin: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-section {
        grid-template-columns: 1fr;
    }
    
    .reports-table {
        font-size: 0.9rem;
    }
    
    .report-metadata dl {
        grid-template-columns: 1fr;
    }
    
    .report-metadata dt {
        margin-top: 0.5rem;
    }
}
