/* ============== 现代网站基础样式表 ============== */
/* 兼容老页面 class 调用，全部使用现代设计风格重写 */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
                 Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
    background: #f5f7fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #4f6df5;
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: #2541e0;
    text-decoration: none;
}

img {
    max-width: 100%;
    border: none;
    vertical-align: middle;
}

h1, h2, h3, h4, h5 {
    margin: 0 0 .6em;
    font-weight: 600;
    color: #1f2d3d;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

p { margin: 0 0 .8em; }

/* ============== 容器与布局 ============== */
.container {
    width: 1200px;
    max-width: 95%;
    margin: 0 auto;
}

.wrap {
    min-height: calc(100vh - 220px);
}

/* ============== 头部 Header ============== */
.site-header {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-top {
    background: linear-gradient(90deg, #4f6df5 0%, #6b8df0 100%);
    color: #fff;
    font-size: 12px;
    padding: 6px 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top a {
    color: #fff;
    margin-left: 14px;
}

.header-top a:hover { color: #ffe082; }

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

.header-logo img {
    height: 56px;
    width: auto;
    display: block;
}

.header-search {
    flex: 1;
    max-width: 520px;
    margin: 0 40px;
    position: relative;
}

.header-search form {
    display: flex;
    border: 2px solid #4f6df5;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.header-search input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 18px;
    font-size: 14px;
    background: transparent;
}

.header-search button {
    border: none;
    background: linear-gradient(90deg, #4f6df5, #6b8df0);
    color: #fff;
    padding: 0 28px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity .2s;
}

.header-search button:hover { opacity: .9; }

.header-user { display: flex; align-items: center; gap: 12px; }

.btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    border: 1px solid transparent;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(90deg, #4f6df5, #6b8df0);
    color: #fff !important;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 109, 245, .35);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: #4f6df5 !important;
    border-color: #4f6df5;
}

.btn-outline:hover {
    background: #4f6df5;
    color: #fff !important;
}

/* ============== 导航栏 ============== */
.site-nav {
    background: #fff;
    border-top: 1px solid #eef0f5;
    position: relative;
    z-index: 50;
}

.site-nav .container > ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.site-nav .container > ul > li {
    position: relative;
}

.site-nav .container > ul > li > a {
    display: block;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    transition: all .2s;
}

.site-nav .container > ul > li > a:hover,
.site-nav .container > ul > li.active > a {
    color: #4f6df5;
    background: linear-gradient(180deg, transparent 0%, #f0f3ff 100%);
}

/* 导航下拉分组（源码中心 / 学习中心 / 任务·积分） */
.site-nav .container > ul > li.has-sub > a::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #9aa7bd;
    vertical-align: middle;
    transition: border-top-color .2s, transform .2s;
}

.site-nav .container > ul > li.has-sub:hover > a::after,
.site-nav .container > ul > li.has-sub.active > a::after {
    border-top-color: #4f6df5;
    transform: rotate(180deg);
}

.site-nav .sub-nav {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    min-width: 132px;
    padding: 6px;
    background: #fff;
    border-radius: 0 0 10px 10px;
    border-top: 2px solid #4f6df5;
    box-shadow: 0 10px 24px rgba(31, 45, 61, .14);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
    z-index: 60;
}

.site-nav .container > ul > li.has-sub:hover .sub-nav {
    opacity: 1;
    visibility: visible;
}

.site-nav .sub-nav a {
    display: block;
    padding: 9px 16px;
    font-size: 14px;
    color: #4a5568;
    border-radius: 6px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.site-nav .sub-nav a:hover {
    background: #f0f3ff;
    color: #4f6df5;
}

@media (max-width: 768px) {
    .site-nav .sub-nav { display: none; }
    .site-nav .container > ul > li.has-sub > a::after { display: none; }
}

/* ============== 主体内容 ============== */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    margin: 24px auto;
}

.mainbar { min-width: 0; }

.sidebar { min-width: 0; }

/* ============== 卡片 ============== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(31, 45, 61, .06);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f2f5;
    background: #fafbfc;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2d3d;
    position: relative;
    padding-left: 12px;
}

.card-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #4f6df5, #6b8df0);
    border-radius: 2px;
}

.card-more {
    font-size: 13px;
    color: #8492a6;
}

.card-more:hover { color: #4f6df5; }

.card-body { padding: 18px 20px; }

/* ============== 通用区块标题 ============== */
.redb {
    font-size: 16px;
    font-weight: 600;
    color: #1f2d3d !important;
}

.red {
    color: #4f6df5 !important;
    font-size: 14px;
}

/* ============== 公告与搜索区 ============== */
.notice-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(90deg, #fff8e1 0%, #fff 100%);
    border-left: 4px solid #ffb74d;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}

.notice-bar strong { color: #ff7043; }

/* ============== 商品 / 源码列表 ============== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: transform .25s, box-shadow .25s;
    text-align: center;
    border: 1px solid #eef0f5;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(79, 109, 245, .15);
    border-color: #d4deff;
}

.product-card .thumb {
    position: relative;
    width: 100%;
    height: 112px;
    overflow: hidden;
    background: #f5f7fa;
}

.product-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .price-tag {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, .92);
    color: #ff4d4f;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.product-card .name {
    padding: 8px 8px 10px;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.4;
    min-height: 38px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-all;
}

/* ============== 分类两栏列表 ============== */
.cat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.cat-block {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(31, 45, 61, .06);
    overflow: hidden;
}

.cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(90deg, #4f6df5 0%, #6b8df0 100%);
    color: #fff;
}

.cat-head .cat-title {
    font-size: 16px;
    font-weight: 600;
}

.cat-head .cat-title a { color: #fff; }
.cat-head .cat-more {
    font-size: 13px;
    color: #fff;
    opacity: .9;
}

.cat-list { padding: 8px 4px; }

.cat-list li {
    padding: 8px 18px;
    border-bottom: 1px dashed #f0f2f5;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-list li:last-child { border-bottom: none; }

.cat-list li::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4f6df5;
    flex-shrink: 0;
}

.cat-list li a {
    flex: 1;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.cat-list li a:hover { color: #4f6df5; }

.txt {
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.7;
}

/* ============== 热门推荐（大图） ============== */
.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.feature-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(31, 45, 61, .06);
}

.feature-card .img-box {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.feature-card .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.feature-card:hover .img-box img { transform: scale(1.05); }

.feature-card .img-box .price-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff4d4f;
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 77, 79, .3);
    white-space: nowrap;
}

.feature-card .info {
    padding: 14px 18px;
    font-size: 14px;
    color: #1f2d3d;
    font-weight: 500;
}

/* ============== 横幅广告位 ============== */
.banner-slot {
    height: 110px;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #4f6df5 0%, #8e9df9 50%, #ff80ab 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

/* ============== 侧边栏 ============== */
.side-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(31, 45, 61, .06);
    overflow: hidden;
    margin-bottom: 18px;
}

.side-card .head {
    padding: 12px 16px;
    background: linear-gradient(90deg, #4f6df5, #6b8df0);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.side-card .body { padding: 10px 16px 16px; }

.side-list li {
    padding: 9px 0;
    border-bottom: 1px dashed #f0f2f5;
    font-size: 13px;
    line-height: 1.5;
}

.side-list li:last-child { border-bottom: none; }

.side-list a {
    color: #2c3e50;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-list a:hover { color: #4f6df5; }

/* 二维码卡片 */
.qr-card {
    text-align: center;
    padding: 18px 12px;
}

.qr-card img {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    border: 4px solid #fff;
    box-shadow: 0 6px 18px rgba(31, 45, 61, .12);
}

.qr-card .qr-title {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #4f6df5;
}

/* ============== 底部 Footer ============== */
.site-footer {
    background: linear-gradient(180deg, #1f2d3d 0%, #15202b 100%);
    color: #c0c8d4;
    margin-top: 40px;
    padding-top: 36px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr) 1.2fr;
    gap: 30px;
    padding-bottom: 24px;
}

.footer-grid h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

.footer-grid h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #4f6df5;
    border-radius: 1px;
}

.footer-links li {
    line-height: 2;
}

.footer-links a {
    color: #c0c8d4;
    font-size: 13px;
}

.footer-links a:hover { color: #fff; }

.footer-about p {
    font-size: 13px;
    line-height: 1.8;
    color: #aab2bd;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #c0c8d4;
}

.contact-item .icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(79, 109, 245, .2);
    color: #6b8df0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.footer-bar {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 18px 0;
    text-align: center;
    font-size: 13px;
    color: #8a93a0;
    background: rgba(0, 0, 0, .15);
}

.footer-bar p { margin: 4px 0; }

.footer-bar a { color: #8a93a0; }
.footer-bar a:hover { color: #fff; }

.friend-links {
    background: #fff;
    border-radius: 12px;
    padding: 14px 20px;
    margin: 24px 0;
    font-size: 13px;
    color: #8492a6;
    box-shadow: 0 2px 12px rgba(31, 45, 61, .06);
}

.friend-links a {
    color: #2c3e50;
    margin: 0 8px;
}

.friend-links a:hover { color: #4f6df5; }

/* ============== 资讯列表 ============== */
.news-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 4px;
    border-bottom: 1px dashed #f0f2f5;
}

.news-list li:last-child { border-bottom: none; }

.news-list li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4f6df5;
    flex-shrink: 0;
}

.news-list li a {
    flex: 1;
    color: #2c3e50;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-list li a:hover { color: #4f6df5; }

.news-list .date {
    color: #a3adbb;
    font-size: 12px;
    flex-shrink: 0;
}

/* ============== 无缩略图占位 ============== */
.product-card .noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #e0e9ff);
    color: #9aa9dd;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 3px;
}

.feature-card .img-box .noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #dce7ff);
    color: #9aa9dd;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 4px;
}

/* ============== 表格行内兼容样式 ============== */
table { border-collapse: collapse; }

/* 兼容老 menu 类的导航标签 */
.menu {
    color: #fff !important;
    font-size: 15px;
    font-weight: 500;
}

/* ============== 首页 公告+资讯 并排布局 ============== */
.note-news-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
}
.note-news-row .card { margin-bottom: 0; }
.note-news-row .note-card { width: 36%; flex-shrink: 0; }
.note-news-row .news-card { flex: 1; min-width: 0; }

.note-item { cursor: pointer; transition: background-color .2s; }
.note-item:hover { background: #f6f9ff; }
.note-top-badge {
    flex-shrink: 0;
    padding: 0 7px;
    border-radius: 9px;
    background: #fff1f0;
    color: #f5222d;
    font-size: 12px;
    line-height: 17px;
}
.note-empty { color: #a3adbb; justify-content: center; }

/* 公告详情弹窗 */
.note-modal {
    display: none;
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.note-modal.show { display: flex; }
.note-modal-box {
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(31, 45, 61, .25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: notePop .22s ease;
}
@keyframes notePop {
    from { transform: translateY(14px) scale(.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.note-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    background: linear-gradient(90deg, #eef2ff 0%, #f7f9fc 100%);
    border-bottom: 1px solid #eef1f6;
}
.note-modal-head span {
    font-size: 16px;
    font-weight: 700;
    color: #1f2d3d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-modal-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    color: #8a94a6;
    font-size: 20px;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e5e9f0;
}
.note-modal-close:hover { color: #f5222d; border-color: #f5222d; }
.note-modal-body {
    padding: 18px 20px 22px;
    overflow-y: auto;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============== 响应式 ============== */
@media (max-width: 1024px) {
    .note-news-row .note-card { width: 42%; }

    .layout { grid-template-columns: 220px 1fr; }
    .product-grid { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .container { width: 100%; padding: 0 12px; }
    .layout { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .cat-row, .feature-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .note-news-row { flex-direction: column; }
    .note-news-row .note-card { width: 100%; }
    .header-search { display: none; }
    .site-nav .container > ul { overflow-x: auto; flex-wrap: nowrap; }
    .site-nav .container > ul > li > a { padding: 12px 14px; white-space: nowrap; }
}