/* Reset & Base */
:root {
    --primary: #b91c1c;
    --primary-dark: #991b1b;
    --gray-bg: #f3f4f6;
    --border: #e5e7eb;
    --text-main: #333;
    --text-light: #6b7280;
    --white: #ffffff;
}
* { box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Heiti SC", "WenQuanYi Micro Hei", sans-serif; background: var(--gray-bg); color: var(--text-main); font-size: 14px; margin:0; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary); }
ul, li { list-style: none; padding: 0; margin: 0; }
input, button { outline: none; font-family: inherit; }
h1,h2,h3,h4,p { margin: 0; }
img { max-width: 100%; height: auto; }

/* Utilities */
.container { max-width: 1100px; margin: 0 auto; /* padding: 0 15px;*/ width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-red { color: var(--primary); }
.font-bold { font-weight: bold; }

/* Layout - Responsive */
.main-wrapper { display: flex; flex-direction: column; gap: 15px; margin-top: 15px; }

/* Desktop Grid System */
@media (min-width: 769px) {
    .main-wrapper { flex-direction: row; }
    .col-left { width: 72%; }
    .col-right { width: 28%; }
    .desktop-only { display: block; }
    .mobile-only { display: none; }
    
}
.navtitle2{display: none;}
/* 右侧说明文字 */
.logo-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 14px;
  color: #374151;
}
.mobile-nav-bar { display: none; }
.red{color:red;}
.page-content { padding: 25px; min-height: 600px; }

/* Mobile Specifics */
@media (max-width: 768px) {
    .col-left, .col-right { width: 100%; }
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    
    .header-inner { flex-direction: row; justify-content: space-between; position: relative; }
    .search-box { display: none !important; }
    .desktop-nav-ul { display: none !important; }
    .logo{margin:0 auto;}
    /* Mobile Nav */
    .mobile-nav-bar { display: block; width: 100%; }
    .mobile-top-row { display: flex; width: 100%; background: var(--primary); }
    .m-nav-item { flex: 1; text-align: center; padding: 12px 0; color: #fff; font-size: 15px; text-decoration: none; display: block; border-right: 1px solid rgba(255,255,255,0.1); white-space: nowrap; overflow: hidden; }
    .m-nav-item.active { background: #991b1b; font-weight: bold; }
    .m-toggle-btn { background: rgba(0,0,0,0.1); border: none; cursor: pointer; font-family: inherit; font-size: 14px; color: #fff; }
    
    .mobile-dropdown { display: none; background: #991b1b; border-top: 1px solid rgba(255,255,255,0.1); }
    .mobile-dropdown.open { display: block; animation: slideDown 0.3s ease-out; }
    .mobile-dropdown a { display: block; padding: 12px 20px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.05); }

    /* Optimize font sizes for mobile reading */
    .article-title { font-size: 22px !important; }
    .gen-name { font-size: 24px !important; }
    .score-val { font-size: 48px !important; }
    .result-header { border-radius: 4px 4px 0 0; }
    
    .grid-links { grid-template-columns: repeat(3, 1fr) !important; }
    .grid-links.cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
    .navtitle{display: none;}
    .navtitle2{display:block;}
    .page-content { padding: 15px; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Top Bar */
.top-bar { background: #1f2937; color: #d1d5db; font-size: 12px; padding: 6px 0; border-bottom: 1px solid #374151; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; }
.top-links a { margin-left: 15px; }
.top-links a:hover { color: white; }

/* Header */
.header { background: white; padding: 20px 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-icon { width: 48px; height: 48px; background: var(--primary); color: white; font-size: 30px; font-weight: bold; display: flex; align-items: center; justify-content: center; border-radius: 2px; font-family: "Songti SC", "SimSun", "STSong", "Times New Roman", serif; }
.logo-text h1 { font-size: 30px; line-height: 1; color: #111; font-family: "Songti SC", "SimSun", "STSong", "Times New Roman", serif; font-weight: bold; }
.logo-text p { font-size: 12px; color: #9ca3af; letter-spacing: 1px; margin-top: 4px; }

/* Search */
.search-box { display: flex; max-width: 320px; width: 100%; }
.search-input { border: 2px solid var(--primary); padding: 6px 10px; font-size: 14px; flex-grow: 1; border-radius: 2px 0 0 2px; border-right: none; }
.search-btn { background: var(--primary); color: white; border: none; padding: 0 20px; font-weight: bold; cursor: pointer; border-radius: 0 2px 2px 0; white-space: nowrap; }
.search-btn:hover { background: var(--primary-dark); }

/* Nav */
.nav { background: var(--primary); border-top: 1px solid #991b1b; position: relative; }
.nav-list { display: flex; }
.nav-list li { flex: 1; text-align: center; }
.nav-list a { display: block; padding: 12px 0; color: white; font-size: 15px; font-weight: 500; }
.nav-list a:hover, .nav-list a.active { background: #991b1b; }


/* Common Box Styles */
.box { background: white; border: 1px solid var(--border); margin-bottom: 15px; border-radius: 2px; }
.box-header { background: #f9fafb; padding: 8px 15px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.section-title { font-size: 16px; font-weight: bold; color: #1f2937; border-left: 4px solid var(--primary); padding-left: 8px; }
.more-link { font-size: 12px; color: #9ca3af; }

/* Home Tabs */
.tab-header { display: flex; border-bottom: 1px solid var(--border); }
.tab-btn { flex: 1; padding: 12px; border: none; background: #f9fafb; font-size: 16px; font-weight: bold; color: #4b5563; cursor: pointer; border-bottom: 1px solid var(--border); transition: all 0.2s; }
.tab-btn.active { background: white; color: var(--primary); border-top: 2px solid var(--primary); border-bottom: none; }
.input-area { padding: 20px 30px; }
@media (max-width: 480px) { .input-area { padding: 20px 15px; } }

.form-row { display: flex; gap: 15px; margin-bottom: 15px; }
@media (max-width: 480px) {
    .form-row { flex-direction: column; gap: 10px; }
    .form-col { width: 100%; }
}

.form-col { flex: 1; }
.form-label { display: block; font-size: 14px; color: #4b5563; margin-bottom: 5px; }
.form-input { width: 100%; border: 1px solid #d1d5db; padding: 8px; border-radius: 2px; }
.form-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 1px var(--primary); }
.radio-group { display: flex; gap: 20px; align-items: center; height: 38px; }
.radio-label { display: flex; align-items: center; cursor: pointer; }
.radio-label input { margin-right: 4px; accent-color: var(--primary); }
.btn-submit { width: 100%; background: var(--primary); color: white; border: none; padding: 12px; font-size: 16px; font-weight: bold; border-radius: 2px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.btn-submit:hover { background: var(--primary-dark); }
.form-tip { text-align: center; font-size: 12px; color: #9ca3af; margin-top: 10px; }

/* News List Widget */
.news-grid { padding: 15px; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media(min-width: 768px) { .news-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }
.news-list li { margin-bottom: 8px; }
.news-link { font-size: 14px; color: #4b5563; display: flex; align-items: center; overflow: hidden; }
.news-link:hover { color: var(--primary); text-decoration: underline; }
.bullet { color: #d1d5db; margin-right: 8px; font-size: 12px; transform: scale(0.8); flex-shrink: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Feature Grid */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
@media(min-width: 768px) { .feature-grid { grid-template-columns: 1fr 1fr; } }

/* Sidebar Widgets */

/* Almanac Widget Refined */
.almanac-link { display: block; text-decoration: none; color: inherit; transition: transform 0.2s; background: #fff; border: 1px solid var(--border); border-radius: 2px; margin-bottom: 15px; overflow: hidden; }
.almanac-link:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.almanac-header { background: var(--primary); color: #fff; padding: 10px; text-align: center; font-weight: 700; font-size: 16px; letter-spacing: 1px; }
.almanac-body { padding: 20px 15px; text-align: center; }
.date-big { font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--primary); margin-bottom: 8px; font-family: serif,"Songti SC", "SimSun", "STSong", "Times New Roman"; }
.date-lunar { font-size: 14px; color: #6b7280; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dashed #e5e7eb; }
.date-tags { display: flex; gap: 10px; justify-content: center; }
.tag-box { flex: 1; text-align: left; padding: 8px 10px; border-radius: 4px; display: flex; flex-direction: column; gap: 2px; }
.tag-good { background: #ecfdf5; color: #047857; }
.tag-bad { background: #fef2f2; color: #b91c1c; }
.tag-label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 2px; }
.tag-content { font-size: 12px; line-height: 1.4; opacity: 0.9; }

/* Rank List */
.rank-list { padding: 15px; }
.rank-item { display: flex; gap: 10px; margin-bottom: 12px; font-size: 14px; align-items: flex-start; }
.rank-num { width: 18px; height: 18px; background: #d1d5db; color: white; text-align: center; line-height: 18px; font-size: 12px; border-radius: 2px; flex-shrink: 0; margin-top: 2px; }
.rank-num.top { background: var(--primary); }
.rank-link { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #4b5563; }
.rank-link:hover { color: var(--primary); }

.grid-links { padding: 15px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-links.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-links.cols-2 { grid-template-columns: repeat(2, 1fr); }
.link-btn { display: block; background: #f9fafb; border: 1px solid #f3f4f6; text-align: center; padding: 4px 0; border-radius: 4px; font-size: 14px; color: #374151; transition: all 0.2s; }
.link-btn:hover { background: #fef2f2; color: var(--primary); border-color: #fee2e2; }

/* Content Pages */

.breadcrumbs { font-size: 12px; color: #6b7280; margin-bottom: 20px; display: flex; align-items: center; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { margin: 0 8px; }
.page-h1 { font-size: 24px; font-weight: bold; color: #1f2937; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); font-family: serif,"Songti SC", "SimSun", "STSong", "Times New Roman"; }

/* List Item */
.list-item { border-bottom: 1px dashed var(--border); padding-bottom: 15px; margin-bottom: 15px; display: flex; flex-direction: column; gap: 4px; }
.list-title { font-size: 18px; font-weight: bold; color: #1f2937; }
.list-title:hover { color: var(--primary); }
.list-desc { font-size: 14px; color: #6b7280; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-meta { font-size: 12px; color: #9ca3af; margin-top: 4px; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
    list-style: none;
    padding: 0;
    flex-wrap: wrap; /* 在小屏幕上允许换行 */
}

.pagination li {
    margin: 0;
}

.pagination a, 
.pagination .active {
    border: 1px solid var(--border);
    padding: 5px 12px;
    background: #f9fafb;
    font-size: 14px;
    border-radius: 2px;
    color: #6b7280;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease; /* 添加平滑过渡效果 */
    min-width: 30px; /* 设置最小宽度，保持按钮大小一致 */
    text-align: center;
}

.pagination a:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: white;
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: bold;
    pointer-events: none; /* 防止活动页面被点击 */
}

.pagination .disabled {
    color: #ccc;
    background-color: #f0f0f0;
    border-color: #e0e0e0;
    pointer-events: none;
    cursor: default;
}

    .logo-1 {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .logo-1 .icon {
        width: 50px;
        height: 50px;
        background: #b91c1c;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        font-weight: bold;
        color: white;
        position: relative;
        overflow: hidden;
    }

    .logo-1 .icon::before {
        content: '';
        position: absolute;
        top: -2px;
        right: -2px;
        width: 20px;
        height: 20px;
        background: rgba(255,255,255,0.2);
        border-radius: 50%;
    }

    .logo-1 .text {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .logo-1 .brand {
        font-size: 28px;
        font-weight: 700;
        color: #b91c1c;
        letter-spacing: 1px;
    }

    .logo-1 .brand.white {
        color: white;
    }

    .logo-1 .tagline {
        font-size: 12px;
        color: #666;
        letter-spacing: 0.5px;
    }

    .logo-1 .tagline.white {
        color: rgba(255,255,255,0.8);
    }
/* 中间竖线 */
.logo-divider {
  width: 1px;
  height: 48px;
  background-color: #d1d5db;
  margin: 0 6px;
}



/* 右侧每一行 */
.logo-slogan-cn {
  line-height: 1.6;
  white-space: nowrap;
}
/* Article Content */
.article-title { font-size: 28px; font-weight: bold; color: #111; margin-bottom: 15px; line-height: 1.4; font-family: serif,"Songti SC", "SimSun", "STSong", "Times New Roman"; }
.article-meta-info { font-size: 12px; color: #9ca3af; border-bottom: 1px solid #f3f4f6; padding-bottom: 15px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 20px; }
.article-body { font-size: 16px; line-height: 1.8; color: #374151; text-align: justify; }
.article-body p { margin-bottom: 20px; }
.article-body h3 {
    padding-left: 15px;
    line-height: 30px;
    border-left: 5px solid #b91c1c;
    font-size: 18px;
    background: #F5F5F5;
    margin: 8px 0;
}
.article-nav { border-top: 1px solid #f3f4f6; margin-top: 30px; padding-top: 20px; display: flex; justify-content: space-between; font-size: 14px; color: #4b5563; }
.article-nav a { max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-nav a:hover { color: var(--primary); }

.related-box { background: #f9fafb; padding: 15px; border: 1px solid var(--border); margin-top: 30px; border-radius: 2px; }
.related-title { font-weight: bold; color: #1f2937; margin-bottom: 10px; font-size: 14px; }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media(min-width: 768px) { .related-grid { grid-template-columns: 1fr 1fr; } }
.related-link { font-size: 14px; color: #4b5563; }
.related-link:hover { color: var(--primary); }

/* Reco & Hot in Article */
.extra-section { margin-top: 30px; }
.extra-title { font-weight: bold; color: #1f2937; margin-bottom: 15px; border-left: 4px solid var(--primary); padding-left: 8px; font-size: 16px; }
.reco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.reco-card { display: block; background: white; border: 1px solid var(--border); padding: 15px; text-align: center; border-radius: 2px; transition: all 0.2s; }
.reco-card:hover { border-color: #fca5a5; background: #fef2f2; }
.reco-card-icon { font-size: 24px; margin-bottom: 5px; }
.reco-card-title { font-weight: bold; color: #1f2937; font-size: 15px; margin-bottom: 2px; }
.reco-card:hover .reco-card-title { color: var(--primary); }
.reco-card-desc { font-size: 12px; color: #9ca3af; }

.hot-list-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media(min-width: 768px) { .hot-list-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }

/* Footer */
.footer { border-top: 2px solid var(--primary); background: white; margin-top: 20px; padding: 30px 0; text-align: center; color: #6b7280; font-size: 14px; }
.footer-links { margin-bottom: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.footer-links a:hover { color: var(--primary); }

/* Friendly Links */
.friendly-box { background: white; border: 1px solid var(--border); margin-top: 15px; padding: 15px; }
.friendly-title { font-weight: bold; font-size: 14px; color: #1f2937; border-bottom: 1px solid #f3f4f6; padding-bottom: 8px; margin-bottom: 10px; }
.friendly-list { display: flex; flex-wrap: wrap; gap: 15px; font-size: 12px; color: #6b7280; }
.friendly-list a:hover { color: var(--primary); }

/* Loader */
.loader { border: 3px solid #f3f3f3; border-radius: 50%; border-top: 3px solid var(--primary); width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Result Area */
.result-header { background: var(--primary); color: white; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: 2px 2px 0 0; }
.result-back-btn { background: white; color: var(--primary); border: none; padding: 4px 10px; border-radius: 2px; font-size: 12px; font-weight: bold; cursor: pointer; }
.result-body { padding: 20px; border: 1px solid var(--border); border-top: none; background: white; }
.score-box { display: flex; align-items: center; border-bottom: 1px solid #f3f4f6; padding-bottom: 20px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.score-val { font-size: 60px; font-weight: bold; color: var(--primary); line-height: 1; }
.score-label { text-align: center; width: 120px; border-right: 1px solid #f3f4f6; margin-right: 20px; }
@media (max-width: 480px) {
    .score-label { width: 100%; border-right: none; margin-right: 0; margin-bottom: 15px; border-bottom: 1px solid #f3f4f6; padding-bottom: 10px; }
    .score-details { width: 100%; }
}
.score-details { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.score-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.score-tag { background: #fef2f2; color: var(--primary); padding: 2px 8px; border-radius: 4px; font-weight: bold; white-space: nowrap; }
.meaning-box { background: #fefce8; border: 1px solid #fef9c3; padding: 15px; border-radius: 4px; }
.meaning-title { color: #854d0e; font-weight: bold; margin-bottom: 5px; font-size: 14px; }
.meaning-text { font-size: 14px; color: #374151; line-height: 1.6; }

/* Generated Item Styles */
.gen-item { display: flex; align-items: center; justify-content: space-between; padding: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: all 0.2s; }
.gen-item:hover { box-shadow: 0 4px 12px rgba(185, 28, 28, 0.1); border-color: #fee2e2; transform: translateY(-2px); }
.gen-info-left { text-align: center; min-width: 90px; padding-right: 20px; border-right: 1px solid #f3f4f6; margin-right: 20px; flex-shrink: 0; }
.gen-name { font-size: 28px; line-height: 1.1; font-weight: 700; color: var(--primary); font-family: "Songti SC", "SimSun", "STSong", "Times New Roman", serif; }
.gen-pinyin { display: block; font-size: 13px; color: #9ca3af; margin-top: 4px; }
.gen-details { flex: 1; }
.gen-meaning { font-size: 14px; color: #4b5563; margin-bottom: 8px; line-height: 1.5; }
.gen-tag-span { display: inline-block; font-size: 12px; border: 1px solid #e5e7eb; padding: 2px 8px; border-radius: 12px; color: #6b7280; margin-right: 6px; background: #f9fafb; margin-bottom: 4px; }
.gen-action { margin-left: 20px; flex-shrink: 0; }
.btn-analyze-link { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 15px; border: 1px solid var(--primary); color: var(--primary); background: transparent; border-radius: 16px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-analyze-link:hover { background: var(--primary); color: #fff; }

@media (max-width: 480px) {
    .gen-item { flex-wrap: wrap; }
    .gen-info-left { border-right: none; border-bottom: 1px solid #f3f4f6; padding-right: 0; padding-bottom: 12px; margin-right: 0; margin-bottom: 12px; width: 100%; display: flex; align-items: baseline; gap: 10px; justify-content: center; }
    .gen-pinyin { margin-top: 0; }
    .gen-action { width: 100%; margin-left: 0; margin-top: 12px; text-align: right; border-top: 1px dashed #f3f4f6; padding-top: 10px; }
    .btn-analyze-link { width: 100%; }
}

/* Result Actions */
.result-actions { margin-top: 20px; text-align: center; }
.btn-action { display: inline-block; padding: 10px 40px; background: var(--primary); color: white; border-radius: 2px; font-weight: bold; font-size: 15px; border: 1px solid var(--primary); cursor: pointer; }
.btn-action:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.btn-action.outline { background: white; color: var(--primary); }
.btn-action.outline:hover { background: #fef2f2; }