/* 自定义样式 */

/* 导航栏样式 */
nav {
    background-color: var(--pico-background-color);
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

nav ul {
    margin: 0;
    padding: 0;
}

/* 卡片样式 */
.card {
    background-color: var(--pico-card-background-color);
    border: 1px solid var(--pico-card-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* 表格样式优化 */
.table-responsive {
    overflow-x: auto;
}

.table th {
    white-space: nowrap;
}

/* 自动补全下拉框 */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-top: none;
    border-radius: 0 0 var(--pico-border-radius) var(--pico-border-radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.dropdown-item:hover {
    background-color: var(--pico-primary-hover-background);
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* 信号样式 */
.signal-buy {
    color: var(--pico-color-green-500);
    font-weight: bold;
}

.signal-sell {
    color: var(--pico-color-red-500);
    font-weight: bold;
}

.signal-hold {
    color: var(--pico-color-yellow-500);
    font-weight: bold;
}

/* 盈亏颜色（中国股市习惯：盈利用红色，亏损用绿色） */
.text-success {
    color: var(--pico-color-red-500) !important;  /* 成功/盈利 → 红色 */
}

.text-danger {
    color: var(--pico-color-green-500) !important;  /* 危险/亏损 → 绿色 */
}

.text-muted {
    color: var(--pico-color-gray-500);
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* 加载动画 */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--pico-background-color);
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--pico-border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

/* 统计卡片 */
.stats-card {
    text-align: center;
    padding: 1.5rem;
}

.stats-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-card p {
    color: var(--pico-color-gray-500);
    margin: 0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

/* 筛选表单 */
.filter-form {
    background-color: var(--pico-card-background-color);
    padding: 1rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1rem;
}

.filter-form .grid {
    gap: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
}

/* 隐藏滚动条 */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 打印样式 */
@media print {
    nav, footer, .button-group, .filter-form {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}

/* 博客文章内容样式 */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--pico-border-radius);
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-content pre {
    background-color: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.article-content code {
    background-color: var(--pico-card-background-color);
    padding: 0.2rem 0.4rem;
    border-radius: var(--pico-border-radius);
    font-size: 0.9em;
}

.article-content pre code {
    background-color: transparent;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--pico-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--pico-color-gray-600);
    font-style: italic;
}

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

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.article-content th,
.article-content td {
    border: 1px solid var(--pico-muted-border-color);
    padding: 0.75rem;
    text-align: left;
}

.article-content th {
    background-color: var(--pico-card-background-color);
    font-weight: bold;
}

.article-content a {
    color: var(--pico-primary);
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
}

/* 代码高亮样式 */
.highlight {
    background-color: var(--pico-card-background-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

/* 博客侧边栏样式 */
aside article {
    margin-bottom: 1rem;
}

aside ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

aside ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

aside ul li:last-child {
    border-bottom: none;
}

/* 评论样式 */
.reply-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
}

blockquote {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--pico-card-background-color);
    border-left: 4px solid var(--pico-primary);
    border-radius: var(--pico-border-radius);
}

/* 标签云样式 */
.tag-cloud a {
    margin: 0.25rem;
    display: inline-block;
}

/* 搜索高亮 */
.search-highlight {
    background-color: var(--pico-color-amber-100);
    padding: 0.1rem 0.3rem;
    border-radius: var(--pico-border-radius);
}

/* 文章封面图 */
.article-cover {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .article-content {
        font-size: 1rem;
    }
    
    .article-content img {
        margin: 0.5rem 0;
    }
}