/*
Theme Name: 头条资讯
Theme URL: https://www.example.com
Description: 仿今日头条风格的Emlog主题，首页信息流卡片布局，详情页清爽阅读体验
Version: 1.0
Author: Doubao
Author URL: https://www.example.com
Sidebar: no
*/

/* ========== 全局重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #222;
    background: #f4f5f7;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: #f04142; }
img { max-width: 100%; height: auto; display: block; border: 0; }
ul, ol { list-style: none; }
input, button, textarea { font-family: inherit; font-size: inherit; outline: none; }
.clearfix::after { content: ""; display: table; clear: both; }

/* ========== 顶部导航 ========== */
.tt-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.tt-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.tt-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #f04142;
    letter-spacing: -0.5px;
}
.tt-logo svg { width: 32px; height: 32px; }
.tt-logo span { color: #222; font-weight: 500; font-size: 16px; }

.tt-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tt-nav::-webkit-scrollbar { display: none; }
.tt-nav a {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 15px;
    color: #555;
    border-radius: 6px;
    white-space: nowrap;
    transition: all .2s;
}
.tt-nav a:hover,
.tt-nav a.active {
    color: #f04142;
    background: #fff0f0;
}

.tt-search {
    flex-shrink: 0;
    position: relative;
    width: 240px;
}
.tt-search input {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 14px;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    background: #f5f6f7;
    font-size: 13px;
    transition: all .2s;
}
.tt-search input:focus {
    border-color: #f04142;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(240,65,66,.08);
}
.tt-search button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tt-search button:hover { color: #f04142; }

/* 用户功能区 */
.tt-user {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}
.tt-user-btn {
    padding: 6px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    transition: all .2s;
    white-space: nowrap;
}
.tt-user-login {
    background: #f04142;
    color: #fff;
}
.tt-user-login:hover {
    background: #d63638;
    color: #fff;
}
.tt-user-btn:not(.tt-user-login) {
    color: #555;
    border: 1px solid #e0e0e0;
    background: #fff;
}
.tt-user-btn:not(.tt-user-login):hover {
    color: #f04142;
    border-color: #f04142;
}
.tt-user-logout {
    color: #999 !important;
}
.tt-user-logout:hover {
    color: #f04142 !important;
    border-color: #f04142 !important;
}

/* ========== 主体布局 ========== */
.tt-main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    gap: 24px;
}
.tt-content { flex: 1; min-width: 0; }
.tt-sidebar { width: 300px; flex-shrink: 0; }

/* ========== 首页信息流卡片 ========== */
.tt-feed { display: flex; flex-direction: column; gap: 12px; }

.tt-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
    border: 1px solid transparent;
}
.tt-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: #f0f0f0;
}

/* 左图右文模式 */
.tt-card-horizontal {
    display: flex;
    gap: 16px;
}
.tt-card-horizontal .tt-card-thumb {
    flex-shrink: 0;
    width: 200px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}
.tt-card-horizontal .tt-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.tt-card:hover .tt-card-thumb img { transform: scale(1.05); }
.tt-card-horizontal .tt-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 纯文字模式 */
.tt-card-text .tt-card-title { font-size: 18px; }

/* 三图模式 */
.tt-card-gallery .tt-card-title { margin-bottom: 12px; }
.tt-card-gallery .tt-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}
.tt-card-gallery .tt-gallery img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
}

/* 大图模式 */
.tt-card-large .tt-card-title { margin-bottom: 12px; }
.tt-card-large .tt-card-thumb {
    width: 100%;
    height: 240px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #f0f0f0;
}
.tt-card-large .tt-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.tt-card:hover .tt-card-thumb img { transform: scale(1.05); }

.tt-card-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #222;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tt-card-excerpt {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
}
.tt-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    flex-shrink: 0;
}
.tt-card-meta .tt-tag {
    color: #f04142;
    background: #fff0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}
.tt-card-meta .tt-author { color: #666; }
.tt-card-meta span { display: inline-flex; align-items: center; gap: 3px; }

/* ========== 侧边栏 ========== */
.tt-widget {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}
.tt-widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 3px solid #f04142;
}
.tt-hot-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.tt-hot-list li:last-child { border-bottom: 0; }
.tt-hot-rank {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #999;
    background: #f0f0f0;
    border-radius: 4px;
}
.tt-hot-list li:nth-child(1) .tt-hot-rank { background: #f04142; color: #fff; }
.tt-hot-list li:nth-child(2) .tt-hot-rank { background: #ff7a45; color: #fff; }
.tt-hot-list li:nth-child(3) .tt-hot-rank { background: #ffa940; color: #fff; }
.tt-hot-title {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tt-hot-title:hover { color: #f04142; }

/* ========== 分页 ========== */
.tt-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.tt-pagination a,
.tt-pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #555;
    border: 1px solid #e8e8e8;
    transition: all .2s;
}
.tt-pagination a:hover {
    color: #f04142;
    border-color: #f04142;
}
.tt-pagination .current {
    background: #f04142;
    color: #fff;
    border-color: #f04142;
}

/* ========== 详情页 ========== */
.tt-article {
    background: #fff;
    border-radius: 10px;
    padding: 32px 40px;
}
.tt-article-header { margin-bottom: 24px; }
.tt-article-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    color: #222;
    margin-bottom: 16px;
}
.tt-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #999;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.tt-article-meta .tt-author-box {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tt-article-meta .tt-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f04142, #ff7a45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.tt-article-meta .tt-author-name { color: #333; font-weight: 500; }

.tt-article-content {
    font-size: 16px;
    line-height: 1.9;
    color: #333;
}
.tt-article-content p { margin-bottom: 18px; }
.tt-article-content p:empty { display: none; margin: 0; }
/* 确保文章内容区所有文字可见，修复维语等RTL内容显示 */
.tt-article-content,
.tt-article-content * {
    color: inherit;
    visibility: visible;
    opacity: 1;
}
.tt-article-content [dir="rtl"],
.tt-article-content *[style*="rtl"] {
    text-align: right;
    direction: rtl;
}
.tt-article-content pre,
.tt-article-content code {
    white-space: pre-wrap;
    word-wrap: break-word;
}
.tt-article-content h1,
.tt-article-content h2,
.tt-article-content h3,
.tt-article-content h4 {
    margin: 28px 0 14px;
    font-weight: 600;
    color: #222;
}
.tt-article-content h2 { font-size: 22px; }
.tt-article-content h3 { font-size: 19px; }
.tt-article-content img {
    border-radius: 8px;
    margin: 16px auto;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.tt-article-content blockquote {
    border-left: 4px solid #f04142;
    background: #fafafa;
    padding: 14px 18px;
    margin: 18px 0;
    color: #666;
    border-radius: 0 6px 6px 0;
}
.tt-article-content a { color: #f04142; border-bottom: 1px solid #f04142; }
.tt-article-content ul,
.tt-article-content ol { padding-left: 24px; margin-bottom: 18px; }
.tt-article-content ul li { list-style: disc; margin-bottom: 6px; }
.tt-article-content ol li { list-style: decimal; margin-bottom: 6px; }
.tt-article-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #d63384;
}
.tt-article-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 18px 0;
    font-size: 14px;
}
.tt-article-content pre code { background: none; color: inherit; padding: 0; }

.tt-article-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.tt-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.tt-article-tags a {
    padding: 4px 12px;
    background: #f5f6f7;
    border-radius: 14px;
    font-size: 13px;
    color: #666;
}
.tt-article-tags a:hover { background: #fff0f0; color: #f04142; }

.tt-article-nav {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}
.tt-article-nav a {
    flex: 1;
    padding: 14px 18px;
    background: #fafafa;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    transition: all .2s;
}
.tt-article-nav a:hover { background: #fff0f0; color: #f04142; }
.tt-article-nav .tt-nav-label { font-size: 12px; color: #999; margin-bottom: 4px; }
.tt-article-nav .tt-nav-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 相关推荐 ========== */
.tt-related {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-top: 16px;
}
.tt-related-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #222;
}
.tt-related-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.tt-related-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: background .2s;
}
.tt-related-item:hover { background: #fafafa; }
.tt-related-item img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.tt-related-info { min-width: 0; }
.tt-related-info h4 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.tt-related-info .tt-related-meta { font-size: 12px; color: #999; }

/* ========== 评论区 ========== */
.tt-comments {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-top: 16px;
}
.tt-comments-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
}
.tt-comment-form textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    font-size: 14px;
    transition: border-color .2s;
}
.tt-comment-form textarea:focus { border-color: #f04142; }
.tt-comment-fields {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.tt-comment-fields input {
    flex: 1;
    min-width: 120px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color .2s;
}
.tt-comment-fields input:focus { border-color: #f04142; }
.tt-comment-code {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.tt-comment-code input {
    width: 120px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
}
.tt-comment-logged {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f5f6f7;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
}
.tt-comment-logged strong {
    color: #f04142;
}
.tt-comment-form button {
    margin-top: 10px;
    padding: 8px 24px;
    background: #f04142;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background .2s;
}
.tt-comment-form button:hover { background: #d63638; }

.tt-comment-list { margin-top: 24px; }
.tt-comment-item {
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    gap: 12px;
}
.tt-comment-item:last-child { border-bottom: 0; }
.tt-comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.tt-comment-body { flex: 1; min-width: 0; }
.tt-comment-name { font-size: 14px; font-weight: 500; color: #333; margin-bottom: 4px; }
.tt-comment-date { font-size: 12px; color: #999; margin-bottom: 6px; }
.tt-comment-content { font-size: 14px; color: #555; line-height: 1.7; }

/* ========== 底部 ========== */
.tt-footer {
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 28px 20px;
    margin-top: 40px;
    text-align: center;
    color: #999;
    font-size: 13px;
}
.tt-footer p { margin-bottom: 6px; }
.tt-footer a { color: #666; }
.tt-footer a:hover { color: #f04142; }

/* ========== 404页面 ========== */
.tt-404 {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 10px;
}
.tt-404 h1 { font-size: 72px; color: #f04142; margin-bottom: 16px; }
.tt-404 p { font-size: 16px; color: #666; margin-bottom: 24px; }
.tt-404 a {
    display: inline-block;
    padding: 10px 28px;
    background: #f04142;
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
}

/* ========== 面包屑 ========== */
.tt-breadcrumb {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
    padding: 0 4px;
}
.tt-breadcrumb a:hover { color: #f04142; }
.tt-breadcrumb span { margin: 0 6px; }

/* ========== 响应式 ========== */
@media (max-width: 960px) {
    .tt-sidebar { display: none; }
    .tt-main { padding: 0 12px; margin: 12px auto; }
    .tt-header-inner { padding: 0 12px; gap: 12px; }
    .tt-search { width: 160px; }
    .tt-article { padding: 20px 16px; }
    .tt-article-title { font-size: 22px; }
    .tt-article-content { font-size: 15px; }
    .tt-related-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .tt-search { display: none; }
    .tt-card-horizontal { flex-direction: column; }
    .tt-card-horizontal .tt-card-thumb { width: 100%; height: 180px; }
    .tt-card-gallery .tt-gallery img { height: 80px; }
    .tt-card-large .tt-card-thumb { height: 180px; }
    .tt-logo span { display: none; }
    .tt-article-nav { flex-direction: column; }
}


.tt-comment-item{
    display:flex !important;
    gap:10px !important;
    margin:14px 0 !important;
}
.tt-comment-avatar{
    flex-shrink:0 !important;
    width:36px !important;
    height:36px !important;
    border-radius:50% !important;
    background:#f04142 !important;
    color:#fff !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
}
/* 评论列表布局修复 */
.tt-comment-item{
    display:flex;
    gap:10px;
    margin:14px 0;
}
.tt-comment-avatar{
    flex-shrink:0;
    width:36px;
    height:36px;
    border-radius:50%;
    background:#f04142;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
}
.tt-comment-body{
    flex:1;
    min-width:0;
}
