/* 软件编程学习Y 新版首页/文章页样式 */
:root {
    --green: #28a745;
    --green-dark: #1e7e34;
    --bg: #f6f8fa;
}
* { box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: #333;
    margin: 0;
}
a { text-decoration: none !important; }

/* 顶部公告 */
.site-notice {
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
}
.site-notice img { width: 20px; vertical-align: -4px; margin-right: 6px; }
.site-notice .notice-text { color: #d84315; font-weight: 600; }

/* 头部 */
.site-header {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.site-header .inner {
    max-width: 1140px; margin: 0 auto; padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
}
.site-header img.logo { width: 38px; height: 38px; border-radius: 8px; }
.site-header .site-title { font-size: 22px; font-weight: 700; color: #1d2b36; margin: 0; }
.site-header .site-slogan { color: #888; font-size: 13px; margin: 0; }

/* 导航 */
.site-nav { background: var(--green) !important; box-shadow: 0 2px 6px rgba(40,167,69,.3); }
.site-nav .nav-link { color: rgba(255,255,255,.92) !important; font-weight: 500; }
.site-nav .nav-link:hover, .site-nav .nav-link:focus { color: #fff !important; background: rgba(255,255,255,.12); border-radius: 6px; }
.site-nav .navbar-toggler { border-color: rgba(255,255,255,.5); }
.site-nav .navbar-toggler-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); }
.site-nav .dropdown-menu a { color: #333 !important; }
.site-nav .dropdown-menu a:hover { color: var(--green-dark) !important; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #1d2b36 0%, #1e7e34 100%);
    color: #fff;
    padding: 56px 16px 64px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(76,175,80,.35), transparent 50%);
}
.hero .inner { max-width: 1140px; margin: 0 auto; position: relative; text-align: center; }
.hero .badge-line {
    display: inline-block; padding: 5px 16px; border-radius: 20px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
    font-size: 13px; margin-bottom: 18px; letter-spacing: 1px;
}
.hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 14px; text-shadow: 0 3px 12px rgba(0,0,0,.25); }
.hero p.lead { color: rgba(255,255,255,.88); font-size: 15px; max-width: 720px; margin: 0 auto 26px; line-height: 1.9; }
.hero-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero-stats .hstat {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px; padding: 12px 26px; min-width: 130px;
}
.hero-stats .hstat b { display: block; font-size: 22px; }
.hero-stats .hstat span { font-size: 12px; opacity: .85; }

/* 主体区块 */
.main-wrap { max-width: 1140px; margin: 0 auto; padding: 32px 16px; }
.section-block { margin-bottom: 36px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-head .bar { width: 5px; height: 22px; background: var(--green); border-radius: 3px; }
.section-head h2 { font-size: 21px; font-weight: 700; margin: 0; color: #1d2b36; }
.section-head .desc { color: #999; font-size: 13px; margin: 0 0 0 4px; }

/* 文章卡片 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.news-card {
    background: #fff; border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: all .2s;
    display: flex; flex-direction: column; border: 1px solid #eef1f4;
}
.news-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.1); }
.news-card .nc-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.news-card .nc-cat { background: #e8f5e9; color: #1e7e34; border-radius: 4px; font-size: 12px; padding: 2px 8px; }
.news-card .nc-date { color: #aaa; font-size: 12px; }
.news-card .nc-title { font-size: 16.5px; font-weight: 700; color: #1d2b36; margin-bottom: 8px; display: block; }
.news-card .nc-title:hover { color: var(--green-dark); }
.news-card .nc-summary { color: #777; font-size: 13.5px; line-height: 1.7; flex: 1; }
.news-card .nc-foot { margin-top: 12px; color: #aaa; font-size: 12px; display: flex; justify-content: space-between; }
.news-card .nc-foot .read { color: var(--green-dark); font-weight: 600; }

/* 工具区块 */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tool-card {
    background: #fff; border-radius: 10px; padding: 16px 18px;
    border: 1px solid #eef1f4; box-shadow: 0 1px 3px rgba(0,0,0,.05);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    transition: all .18s;
}
.tool-card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(40,167,69,.15); }
.tool-card .tc-info { min-width: 0; }
.tool-card .tc-name { font-weight: 600; font-size: 15px; color: #1d2b36; display: block; }
.tool-card.hot .tc-name { color: #dc3545; }
.tool-card .tc-desc { color: #999; font-size: 12px; display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card .tc-go { color: var(--green); font-size: 13px; font-weight: 700; white-space: nowrap; }

/* 页脚 */
.site-footer {
    background: #1d2b36; color: #9fb0bb;
    padding: 28px 16px; text-align: center; font-size: 13px; line-height: 2;
}
.site-footer a { color: #cfd8dc; }
.site-footer a:hover { color: #fff; }
.site-footer img { width: 16px; vertical-align: -3px; margin-right: 4px; }

/* 文章列表/详情页 */
.page-wrap { max-width: 900px; margin: 0 auto; padding: 28px 16px; }
.crumb { font-size: 13px; color: #999; margin-bottom: 18px; }
.crumb a { color: var(--green-dark); }

.article-detail { background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.article-detail h1 { font-size: 26px; font-weight: 800; color: #1d2b36; }
.article-meta { color: #999; font-size: 13px; border-bottom: 1px solid #eef1f4; padding-bottom: 16px; margin-bottom: 20px; }
.article-content { line-height: 1.9; font-size: 15.5px; color: #2d3742; word-break: break-word; }
.article-content img { max-width: 100%; border-radius: 8px; }
.article-content pre { background: #f4f6f8; border-radius: 8px; padding: 14px; overflow: auto; }
.article-content blockquote { border-left: 4px solid var(--green); background: #f4faf5; padding: 10px 16px; color: #555; border-radius: 0 8px 8px 0; }
.article-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.article-nav a { background: #fff; border: 1px solid #eef1f4; border-radius: 8px; padding: 10px 16px; font-size: 13.5px; color: #444; max-width: 46%; }
.article-nav a:hover { border-color: var(--green); color: var(--green-dark); }

@media (max-width: 575px) {
    .hero h1 { font-size: 25px; }
    .hero p.lead { font-size: 13px; }
    .hero-stats .hstat { padding: 10px 16px; min-width: 100px; }
    .article-detail { padding: 20px; }
}
