:root {
    --primary-color: #FF5E18;
    --text-color: #333;
    --bg-color: #fff;
    --card-bg: #fff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 100%;
    padding: 0 15px;
}

.article-container {
    max-width: 100%;
    margin: 24px auto 0;
    padding: 0 24px;
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 24px 0;
    padding: 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.blog-title-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-title {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
    color: #000;
}

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

.category-link {
    color: #666;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.category-link:first-child {
    padding-left: 0;
}

.category-link:hover {
    background: #f8f9fa;
    color: #333;
}

.category-link.active {
    background: #007bff;
    color: white;
}

.category-link.active:first-child {
    padding-left: 1rem;
}

.nav-container {
    margin: 48px 0;  
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;  
}

.page-title {
    font-size: 32px;
    font-weight: 500;
    margin: 0;
    color: #000;
}

.search-box {
    position: relative;
    margin-left: auto;
}

.search-input {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 100px;
    width: 240px;
    outline: none;
    font-size: 14px;
    background-color: #f8f9fa;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 94, 24, 0.1);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    height: 520px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid #eee;
    position: relative;
}

.article-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    height: 100%;
}

.article-card .card-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    margin: 0;
    margin-bottom: 12px;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    min-height: 72px;
}

.pin-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 215, 0, 0.9);
    color: #000;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: normal;
    z-index: 2;
}

.category-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 16px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1;
}

.card-text {
    color: #666;
    font-size: 14px;
    position: absolute;
    bottom: 10px;
    left: 10px;
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    object-fit: cover;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.article-card:hover .card-title {
    color: #007bff;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: #000 !important;
    height: 72px;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px !important;
    max-width: 1536px !important;
    margin: 0 auto;
}

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

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.1rem;
    padding: 0.5rem 1rem !important;
    text-decoration: none;
}

.nav-link:hover {
    color: #fff !important;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
}

/* 文章卡片链接样式 */
.article-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.article-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* 文章详情页样式 */
.article-detail {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0;
    background: transparent;
}

.article-hero-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.article-meta {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    color: #666;
    font-size: 0.85rem;
}

.article-meta .separator {
    margin: 0 0.35rem;
    color: #999;
}

.article-meta .category-link {
    color: #ff4d4f;
    background-color: rgba(255, 77, 79, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: normal;
    font-size: 0.85rem;
}

.article-meta .author {
    margin-left: 0.35rem;
}

.article-meta .category-link:hover {
    text-decoration: none;
    background-color: rgba(255, 77, 79, 0.15);
}

.article-detail .article-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-detail .article-subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: normal;
}

.article-content {
    max-width: 880px;  /* 与容器宽度一致 */
    margin: 0 auto;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    width: 100%;
    margin: 1rem 0;
}

.article-content img {
    max-width: 100%;  /* 限制最大宽度 */
    width: auto;      /* 使用图片原始宽度 */
    height: auto;     /* 保持图片比例 */
    display: inline-block;  /* 让图片按实际大小显示 */
}

.article-content iframe {
    max-width: 100%;
    margin: 2rem 0;
}

.article-content h2 {
    margin: 2rem 0 1rem;
    font-size: 1.8rem;
}

.article-content h3 {
    margin: 1.5rem 0 1rem;
    font-size: 1.5rem;
}

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

.article-content blockquote {
    margin: 2rem 0;
    padding: 1rem 2rem;
    border-left: 4px solid var(--primary-color);
    background: #f8f9fa;
    font-style: italic;
}

/* 视频文本样式 */
.video-text {
    margin: 1rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
}

.video-container {
    width: 100%;
    margin: 1rem 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 管理后台样式 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.row {
    margin: 0;
    padding: 0;
}

/* 评论区样式 */
.comments-section {
    margin-top: 2rem;
}

.comment-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

.comment-item[data-depth="0"] {
    margin-left: 0;
}

.comment-item[data-depth="1"] {
    margin-left: 2rem;
}

.comment-item[data-depth="2"] {
    margin-left: 4rem;
}

.comment-item[data-depth="3"] {
    margin-left: 6rem;
}

.comment-item[data-depth="4"] {
    margin-left: 8rem;
}

.comment-item[data-depth="5"] {
    margin-left: 10rem;
}

.comment-item[data-depth="6"] {
    margin-left: 12rem;
}

.comment-item[data-depth="7"] {
    margin-left: 14rem;
}

.comment-item[data-depth="8"] {
    margin-left: 16rem;
}

.comment-item[data-depth="9"] {
    margin-left: 18rem;
}

.comment-item[data-depth="10"] {
    margin-left: 20rem;
}

@media (max-width: 768px) {
    .comment-item[data-depth="1"] { margin-left: 1rem; }
    .comment-item[data-depth="2"] { margin-left: 2rem; }
    .comment-item[data-depth="3"] { margin-left: 3rem; }
    .comment-item[data-depth="4"] { margin-left: 4rem; }
    .comment-item[data-depth="5"] { margin-left: 5rem; }
    .comment-item[data-depth="6"] { margin-left: 6rem; }
    .comment-item[data-depth="7"] { margin-left: 7rem; }
    .comment-item[data-depth="8"] { margin-left: 8rem; }
    .comment-item[data-depth="9"] { margin-left: 9rem; }
    .comment-item[data-depth="10"] { margin-left: 10rem; }
}

.comment-item {
    border-left: 3px solid transparent;
}

.comment-item[data-depth="1"] { border-left-color: #007bff; }
.comment-item[data-depth="2"] { border-left-color: #28a745; }
.comment-item[data-depth="3"] { border-left-color: #ffc107; }
.comment-item[data-depth="4"] { border-left-color: #dc3545; }
.comment-item[data-depth="5"] { border-left-color: #6610f2; }
.comment-item[data-depth="6"] { border-left-color: #fd7e14; }
.comment-item[data-depth="7"] { border-left-color: #20c997; }
.comment-item[data-depth="8"] { border-left-color: #e83e8c; }
.comment-item[data-depth="9"] { border-left-color: #17a2b8; }
.comment-item[data-depth="10"] { border-left-color: #6f42c1; }

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

.comment-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comment-author {
    font-weight: 500;
    color: #666;
}

.comment-date {
    color: #999;
    font-size: 0.875rem;
}

.comment-content {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-link {
    padding: 0;
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #007bff;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.btn-link.btn-sm {
    padding: 0;
    padding-left: 0.25rem;
    font-size: 0.8125rem;
    color: #0d6efd;
    text-decoration: none;
    display: inline;
    vertical-align: baseline;
}

.btn-link.btn-sm:hover {
    text-decoration: underline;
}

.btn-danger.btn-sm {
    padding: 0.125rem 0.375rem;
    font-size: 0.8125rem;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-warning.btn-sm {
    padding: 0.125rem 0.375rem;
    font-size: 0.8125rem;
}

.text-muted {
    color: #6c757d;
    font-style: italic;
}

textarea[name="content"] {
    resize: vertical;
    min-height: 100px;
}

.btn-warning.btn-sm,
.btn-info.btn-sm {
    padding: 0.125rem 0.375rem;
    font-size: 0.8125rem;
}

.btn-info.btn-sm {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
}

.btn-info.btn-sm:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* 确保文章标题和内容区域使用相同的宽度 */
.article-title,
.article-subtitle,
.article-meta,
.article-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

/* 移除任何可能的额外内边距 */
.article-content {
    padding-left: 0;
    padding-right: 0;
}

/* 文章封面图片样式 */
.article-cover {
    width: 880px;     /* 设置固定宽度 */
    max-width: 100%;  /* 在小屏幕上自适应 */
    object-fit: contain;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
    display: block;   /* 确保图片居中 */
}

/* 文章标题和容域 */
.article-header,
.article-content {
    width: 880px;     /* 设置固定宽度 */
    max-width: 100%;  /* 在小屏幕上自适应 */
    margin: 0 auto;
    padding: 0;
}

/* 移除article标签的限制 */
article {
    width: 880px;     /* 设置固定宽度 */
    max-width: 100%;  /* 在小屏幕上自适应 */
    margin: 0 auto;
    padding: 0;
}

html {
    scroll-behavior: smooth;  /* 添加平滑滚动效果 */
}

/* 给新评论添加高亮效果 */
.comment-item:target {
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    0% {
        background-color: rgba(255, 94, 24, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    min-height: 150px;
}

.exchanges-list {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.exchanges-list h5 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.exchange-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.exchange-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.exchange-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.exchange-link span {
    font-size: 14px;
    white-space: nowrap;
}

#notification-badge {
    position: relative;
    top: -8px;
    right: -5px;
    font-size: 0.7rem;
    padding: 0.25em 0.6em;
    border-radius: 10px;
}

.nav-link .badge {
    margin-left: 5px;
}

/* 评论框占位文本样式 */
.comment-form textarea::placeholder {
    color: #999;
    font-style: italic;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.admin-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.btn-warning.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-danger.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.text-muted {
    color: #6c757d;
    font-style: italic;
}