/**
 * 股票行情系统样式表
 */

/* 全局样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --up-color: #f44336;
    --down-color: #4caf50;
}

body {
    background-color: #f5f8fa;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
}

.user-area {
    align-items: center;
}

/* 首页轮播图样式 */
.carousel-item {
    height: 400px;
    background-position: center;
    background-size: cover;
}

.carousel-caption {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
}

.carousel-caption h2,
.carousel-caption p {
    color: #212529;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carousel-caption h2 {
    font-size: 2rem;
    font-weight: bold;
}

/* 指数数据样式 */
.index-card {
    transition: all 0.3s ease;
}

.index-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.index-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
    text-align: center;
}

.index-data {
    padding: 0.5rem;
}

.price-area {
    display: flex;
    align-items: baseline;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 2rem;
    font-weight: bold;
    margin-right: 0.75rem;
}

.change, .change-percent {
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.up {
    color: var(--up-color);
    background-color: rgba(244, 67, 54, 0.1);
}

.down {
    color: var(--down-color);
    background-color: rgba(76, 175, 80, 0.1);
}

.price-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
}

.detail-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.detail-value {
    font-weight: 500;
}

/* 市场行情表格样式 */
.market-table th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 100;
}

.stock-code {
    color: #6c757d;
    font-size: 0.85rem;
}


.screenshot-preview {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px;
    max-height: 400px;
    overflow: auto;
}

/* 股票详情页样式 */
.stock-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 20px 0;
    margin-bottom: 20px;
}

.stock-price-up {
    color: #dc3545;
}

.stock-price-down {
    color: #28a745;
}

.stock-chart {
    height: 400px;
    margin-bottom: 20px;
}

/* 自选股列表样式 */
.favorite-list .list-group-item {
    transition: all 0.2s ease;
}

.favorite-list .list-group-item:hover {
    background-color: #f8f9fa;
}

.remove-favorite {
    visibility: hidden;
}

.favorite-list .list-group-item:hover .remove-favorite {
    visibility: visible;
}


/* 响应式调整 */
@media (max-width: 767.98px) {
    .carousel-item {
        height: 250px;
    }
    
    .stock-chart {
        height: 250px;
    }
}

/* 分享历史页面样式 */
.status-filter {
    width: 150px;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 股票表格样式 */
.stock-table {
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stock-table thead {
    background-color: #f8f9fa;
}

.stock-table th {
    font-weight: 600;
    vertical-align: middle;
}

.stock-table td {
    vertical-align: middle;
}

.stock-table .up {
    color: var(--up-color);
}

.stock-table .down {
    color: var(--down-color);
}

.stock-table .stock-code {
    font-family: monospace;
}

.stock-table .stock-name {
    font-weight: 500;
}

.add-favorite-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* 行情板块样式 */
.market-board {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.market-board .board-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* 新闻卡片样式 */
.news-card {
    height: 100%;
    transition: transform 0.3s;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card .card-title {
    font-weight: 600;
    font-size: 1.1rem;
}

/* 页脚样式 */
footer {
    margin-top: 3rem;
}

footer h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer a {
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    text-decoration: underline;
}


/* 用户下拉菜单样式 */
.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #f1f5fe;
}

.dropdown-divider {
    margin: 0.5rem 0;
}

/* 股票详情页样式 */
.stock-header {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stock-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stock-header .code {
    font-family: monospace;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.stock-info {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stock-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
}

.info-label {
    color: var(--secondary-color);
}

.info-value {
    font-weight: 500;
}

/* 自选股页面样式 */
.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.favorites-empty {
    text-align: center;
    padding: 3rem;
}

.favorites-empty i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* 管理后台样式 */
.admin-sidebar .card-header {
    font-weight: 600;
}

.admin-sidebar .list-group-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    transition: all 0.2s;
}

.admin-sidebar .list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.admin-sidebar .list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 用户表格样式 */
.user-table th, .user-table td {
    vertical-align: middle;
}

.user-table .btn-group {
    white-space: nowrap;
}

/* 管理员表单样式 */
#user-form .form-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* 权限徽章 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 4px;
}

/* 拒绝原因输入样式 */
#reject-reason-area {
    transition: all 0.3s ease;
}

#reject-reason-area.show {
    animation: highlight 1s ease;
}

#reject-reason {
    border-width: 2px;
}

#reject-reason:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
    border-color: #dc3545;
}

#reject-reason.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

@keyframes highlight {
    0% { background-color: #fff0f0; }
    100% { background-color: transparent; }
}

#klineChart,
#klineChart * {
    cursor: default !important;
}