/*
Theme Name: TMMS 教辅内容与商业门户主题
Description: 支持PC/iPad/手机自适应的双栏门户主题，内置左顶部横幅广告位、公开词库开关、右侧自由信息流及页脚拓展区。
Version: 2.0.0
Author: Patrick
*/

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f4f6f8;
    color: #1d2327;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #2271b1;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #135e96;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== 1. 顶部 Header（双行设计） ==================== */
.tmms-site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dcdcde;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.tmms-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 第一行：左侧 Logo + 网站名，右侧保留空白 */
.tmms-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0 14px 0;
    border-bottom: 1px solid #f0f0f1;
}

.tmms-brand-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tmms-brand-left .custom-logo {
    max-height: 46px;
    width: auto;
    display: block;
}

.tmms-site-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tmms-site-title a {
    color: #1d2327;
}

.tmms-brand-right-blank {
    flex: 1;
}

/* 第二行：右端排列栏目名 */
.tmms-nav-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.tmms-nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 26px;
}

.tmms-nav-menu li a {
    display: inline-block;
    padding: 12px 4px;
    font-size: 15px;
    font-weight: 500;
    color: #3c434a;
    border-bottom: 3px solid transparent;
}

.tmms-nav-menu li a:hover,
.tmms-nav-menu li.current-menu-item a,
.tmms-nav-menu li.current-category-ancestor a {
    color: #2271b1;
    border-bottom-color: #2271b1;
    font-weight: 600;
}

/* ==================== 2. 中间主体双栏布局 ==================== */
.tmms-main-wrapper {
    margin: 10px auto 10px auto;
/*    min-height: calc(100vh - 240px);*/
}

.tmms-layout-grid {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

/* 左侧主内容列（横向一栏一栏纵向堆积） */
.tmms-left-column {
    flex: 1;
    min-width: 0; /* 防止表格或长英文撑破弹性布局 */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 右侧边栏（横向一栏一栏自由添加广告、金句、站外模块） */
.tmms-right-sidebar {
    width: 330px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 通用横向卡片区块 */
.tmms-card-section,
.tmms-widget-box,
.tmms-ad-slot-banner {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 20px 22px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* 顶部横幅广告位专用样式 */
.tmms-ad-slot-banner {
    padding: 14px 18px;
    text-align: center;
    background: #ffffff;
}
.tmms-ad-slot-banner:empty {
    display: none;
    padding: 0;
    border: none;
}

.tmms-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 12px;
    margin-bottom: 16px;
    gap: 10px;
}

.tmms-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
}

.tmms-more-link {
    font-size: 13px;
    font-weight: 600;
    color: #2271b1;
    white-space: nowrap;
}

/* ==================== 3. 公开词库无序标签网格与表格 ==================== */
.tmms-public-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.tmms-public-tag-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #f9fafb;
    border: 1px solid #e2e4e7;
    border-radius: 5px;
    padding: 10px 12px;
    transition: all 0.2s;
}

.tmms-public-tag-item:hover {
    background: #f0f6fc;
    border-color: #2271b1;
    transform: translateY(-1px);
}

.tmms-tag-top {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.tmms-tag-word {
    font-size: 14px;
    color: #1d2327;
    line-height: 1.4;
}

.tmms-badge-topic {
    background: #e5f5fa;
    color: #0073aa;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    font-weight: 600;
}

.tmms-badge-kw {
    background: #edfaef;
    color: #00a32a;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    font-weight: 600;
}

.tmms-tag-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tmms-meta-pill {
    background: #ffffff;
    border: 1px solid #dcdcde;
    color: #50575e;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
}

.tmms-public-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: #f6f7f7;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.tmms-public-filter-bar input,
.tmms-public-filter-bar select {
    padding: 7px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
}

.tmms-public-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.tmms-public-table th {
    background: #f6f7f7;
    padding: 10px 12px;
    border-bottom: 1px solid #dcdcde;
}

.tmms-public-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f1;
}

/* ==================== 4. 文章列表与文章正文 ==================== */
.tmms-article-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tmms-article-item {
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 18px;
}

.tmms-article-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tmms-article-title {
    font-size: 18px;
    margin-bottom: 6px;
}

.tmms-article-title a {
    color: #1d2327;
}

.tmms-article-title a:hover {
    color: #2271b1;
}

.tmms-article-meta {
    font-size: 12px;
    color: #646970;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tmms-cat-badge {
    background: #f0f6fc;
    color: #2271b1;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.tmms-article-excerpt {
    font-size: 14px;
    color: #50575e;
}

.tmms-single-content {
    font-size: 15px;
    line-height: 1.8;
    color: #2c3338;
}

.tmms-single-content p {
    margin-bottom: 16px;
}

/* 按钮样式 */
.tmms-btn-primary {
    display: inline-block;
    background: #2271b1;
    color: #ffffff;
    padding: 9px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.tmms-btn-primary:hover {
    background: #135e96;
    color: #ffffff;
}

.tmms-btn-outline {
    display: inline-block;
    border: 1px solid #2271b1;
    color: #2271b1;
    padding: 7px 18px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.tmms-btn-outline:hover {
    background: #f0f6fc;
}

/* ==================== 5. 右侧边栏小工具样式 ==================== */
.tmms-widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.tmms-widget-box ul {
    list-style: none;
}

.tmms-widget-box ul li {
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f1;
    font-size: 14px;
}

.tmms-widget-box ul li:last-child {
    border-bottom: none;
}

/* ==================== 6. 底部 Footer 与预留拓展行 ==================== */
.tmms-site-footer {
    background: #ffffff;
    border-top: 1px solid #dcdcde;
    padding: 26px 20px 32px 20px;
    text-align: center;
    color: #646970;
    font-size: 13px;
    margin-top: 40px;
}

.tmms-footer-line {
    margin-bottom: 6px;
}

.tmms-footer-beian a {
    color: #646970;
}

.tmms-footer-beian a:hover {
    color: #2271b1;
    text-decoration: underline;
}

/* 底部自由拓展空白行（平时留白，后台添加小工具后自动渲染内容） */
.tmms-footer-extensible-row {
    max-width: 1280px;
    margin: 14px auto 0 auto;
    min-height: 24px;
    padding-top: 10px;
}

/* ==================== 7. 响应式适配（iPad 平板与手机端） ==================== */
@media (max-width: 1024px) {
    .tmms-right-sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .tmms-container {
        padding: 0 14px;
    }

    .tmms-brand-row {
        padding: 14px 0 10px 0;
    }

    .tmms-site-title {
        font-size: 19px;
    }

    /* 手机端导航自动居中适配触控 */
    .tmms-nav-row {
        justify-content: flex-start;
    }

    .tmms-nav-menu {
        justify-content: flex-start;
        gap: 16px;
    }

    .tmms-nav-menu li a {
        padding: 10px 2px;
        font-size: 14px;
    }

    /* 手机端左右双栏自动转为上下单列堆叠 */
    .tmms-layout-grid {
        flex-direction: column;
    }

    .tmms-right-sidebar {
        width: 100%;
    }

    .tmms-card-section,
    .tmms-widget-box {
        padding: 16px;
    }

    .tmms-public-tag-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tmms-public-tag-grid {
        grid-template-columns: 1fr;
    }
}
/* 网站标题与下方副标题小字组合 */
.tmms-title-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tmms-site-desc {
    font-size: 13px;
    color: #646970;
    margin-top: 2px;
    line-height: 1.4;
    font-weight: 400;
}

@media (max-width: 768px) {
    .tmms-site-desc {
        font-size: 12px;
    }
}