:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --border: #eaeaea;
    --accent: #4f8cff;
    --accent-hover: #3a7aef;
    --text: #1a1a2e;
    --text-secondary: #666;
    --text-muted: #999;
    --tag-bg: #4f8cff;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
}

*{margin:0;padding:0;box-sizing:border-box}
body{
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
    background:var(--bg);
    color:var(--text);
    font-size:15px;
    line-height:1.6;
    min-height:100vh;
    overflow-x:hidden;
}
a{color:var(--text);text-decoration:none}
a:hover{color:var(--accent)}

/* ========== Header ========== */
.site-header{
    background:#fff;
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    z-index:100;
    box-shadow:0 1px 4px rgba(0,0,0,0.04);
}
.header-container{
    max-width:1180px;
    margin:0 auto;
    padding:0 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    height:56px;
}
.logo{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:700;white-space:nowrap}
.logo-icon{
    width:32px;height:32px;
    background:linear-gradient(135deg,var(--accent),#a78bfa);
    border-radius:8px;
    display:flex;align-items:center;justify-content:center;
    font-weight:800;font-size:16px;color:#fff;
}
.main-nav{display:flex;gap:4px;align-items:center}
.nav-link{
    padding:6px 14px;
    border-radius:6px;
    color:var(--text-secondary);
    font-size:14px;
    transition:all .2s;
    white-space:nowrap;
}
.nav-link:hover,.nav-link.active{color:var(--accent);background:rgba(79,140,255,0.08)}
.header-right{display:flex;align-items:center;gap:12px}
.search-btn,.menu-btn{
    width:36px;height:36px;
    border-radius:50%;
    border:1px solid var(--border);
    background:#fff;
    display:flex;align-items:center;justify-content:center;
    cursor:pointer;
    font-size:16px;
    color:var(--text-secondary);
    transition:all .2s;
}
.search-btn:hover,.menu-btn:hover{border-color:var(--accent);color:var(--accent)}
.search-form-header{
    display:flex;
    align-items:center;
    gap:0;
    border:1px solid var(--border);
    border-radius:20px;
    overflow:hidden;
    background:#f8f9fa;
    width:200px;
}
.search-form-header input{
    border:none;
    background:transparent;
    padding:6px 12px;
    font-size:13px;
    outline:none;
    width:100%;
    color:var(--text);
}
.search-form-header button{
    border:none;
    background:transparent;
    padding:6px 12px;
    cursor:pointer;
    color:var(--text-muted);
}

/* ========== Main Layout ========== */
.main-content{max-width:1180px;margin:0 auto;padding:24px 20px}
.content-layout{display:flex;gap:24px}
.content-main{flex:1;min-width:0}
.sidebar{width:300px;flex-shrink:0}

/* ========== Hero / Featured ========== */
.featured-section{
    display:grid;
    grid-template-columns:1fr 300px;
    gap:20px;
    margin-bottom:24px;
    align-items:stretch;
    max-width:100%;
}
.featured-main{
    position:relative;
    border-radius:var(--radius);
    overflow:hidden;
    background:var(--card);
    box-shadow:var(--shadow);
    height:100%;
    display:flex;
    flex-direction:column;
    min-width:0;
    max-width:100%;
}
.featured-main .featured-img{
    width:100%;
    height:400px;
    object-fit:cover;
    display:block;
}
.featured-main .featured-info{
    padding:16px 20px;
}
.banner-carousel{width:100%;display:block;max-width:100%;min-width:0}
.banner-slides{width:100%;display:block;max-width:100%;min-width:0}
.banner-slide{width:100%;display:none;max-width:100%;min-width:0}
.banner-slide:first-child{display:block}
.banner-slide[style*="display:block"]{display:block!important}
.banner-slide a{display:block;color:inherit;max-width:100%;min-width:0}
.banner-slide a>div:first-child{
    height:400px;
    width:100%;
    overflow:hidden;
    flex-shrink:0;
    max-width:100%;
    min-width:0;
}
.banner-slide a>div:first-child img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    object-position:center;
    max-width:100%;
}
.featured-main .featured-tag{
    display:inline-block;
    padding:3px 12px;
    background:var(--accent);
    color:#fff;
    font-size:12px;
    border-radius:4px;
    margin-bottom:8px;
}
.featured-main h2{
    font-size:18px;
    font-weight:600;
    line-height:1.4;
    margin-bottom:8px;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    word-break:break-word;
}
.featured-main .featured-meta{
    font-size:13px;
    color:var(--text-muted);
}

/* 让右侧「今日精选」widget 也跟随拉伸，保证左右底部严格对齐 */
.featured-section > .sidebar,
.featured-section > aside,
.featured-section > .widget {
    height:100%;
    min-width:0;
    max-width:100%;
}
.featured-section .sidebar .widget:first-child,
.featured-section > .widget:first-child {
    height:100%;
}

/* ========== Widget ========== */
.widget{
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
    margin-bottom:20px;
    overflow:hidden;
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
}
.widget-title{
    font-size:16px;
    font-weight:600;
    margin-bottom:16px;
    padding-bottom:12px;
    border-bottom:2px solid var(--border);
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.widget-title a{font-size:13px;color:var(--text-muted)}
.widget-title a:hover{color:var(--accent)}

/* Today Pick */
.pick-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 0;
    border-bottom:1px solid #f0f0f0;
    max-width:100%;
    overflow:hidden;
    min-width:0;
}
.pick-item:last-child{border:none;padding-bottom:0}
.pick-item>img,.pick-item>div:first-child{
    width:56px;height:56px;
    border-radius:8px;
    object-fit:cover;
    flex-shrink:0;
    flex-grow:0;
    background:#f0f0f0;
    min-width:56px;
    max-width:56px;
}
.pick-item .pick-info{
    flex:1;
    min-width:0;
    max-width:100%;
    overflow:hidden;
}
.pick-item .pick-title{
    font-size:14px;
    font-weight:500;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    margin-bottom:4px;
    max-width:100%;
    width:100%;
}
.pick-item .pick-title a{
    display:block;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    max-width:100%;
    width:100%;
}
.pick-item .pick-date{font-size:12px;color:var(--text-muted)}

/* ========== Tools Section ========== */
.tools-section{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:24px;
    max-width:100%;
}
.tool-card{
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
    display:flex;
    align-items:flex-start;
    gap:14px;
    transition:all .2s;
    max-width:100%;
    min-width:0;
    overflow:hidden;
}
.tool-card:hover{transform:translateY(-2px);box-shadow:0 4px 20px rgba(0,0,0,0.1)}
.tool-card img{
    width:48px;height:48px;
    border-radius:10px;
    object-fit:cover;
    flex-shrink:0;
}
.tool-card .tool-info{flex:1;min-width:0;max-width:100%;overflow:hidden}
.tool-card .tool-name{font-size:15px;font-weight:600;margin-bottom:4px}
.tool-card .tool-desc{font-size:13px;color:var(--text-secondary);line-height:1.5;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}

/* ========== Hot Section ========== */
.hot-section{
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:24px;
    margin-bottom:24px;
    max-width:100%;
    min-width:0;
    overflow:hidden;
}
.hot-header{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:20px;
}
.hot-header h3{
    font-size:20px;
    font-weight:700;
}
.hot-header .hot-sub{color:var(--text-muted);font-size:14px}
.hot-header .hot-dots{margin-left:auto;display:flex;gap:6px}
.hot-dot{width:8px;height:8px;border-radius:50%}
.hot-dot:nth-child(1){background:#ff6b6b}
.hot-dot:nth-child(2){background:#ffd93d}
.hot-dot:nth-child(3){background:#6bcb77}

/* ========== Hot Section Layout ========== */
.hot-layout{display:flex;gap:16px;max-width:100%;min-width:0}
.hot-main{flex:0 0 58%;max-width:58%;min-width:0}
.hot-main-img-wrap{position:relative;border-radius:12px;overflow:hidden;height:240px;max-width:100%;min-width:0}
.hot-main-img-wrap img{width:100%;height:100%;object-fit:cover;display:block}
.hot-img-placeholder{width:100%;height:100%;background:linear-gradient(135deg,var(--accent),#a78bfa);display:flex;align-items:center;justify-content:center;color:#fff}
.hot-img-tag{position:absolute;top:12px;left:12px;padding:3px 12px;background:var(--accent);color:#fff;font-size:12px;border-radius:4px;z-index:2}
.hot-main-title{font-size:18px;font-weight:600;margin:12px 0 8px;line-height:1.4;word-break:break-word}
.hot-main-desc{font-size:14px;color:var(--text-secondary);line-height:1.6;margin-bottom:12px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}
.hot-main-meta{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-muted)}
.author-avatar-small{width:24px;height:24px;border-radius:50%;background:linear-gradient(135deg,var(--accent),#a78bfa);display:flex;align-items:center;justify-content:center;color:#fff;font-size:10px;font-weight:700}
.hot-subs{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:12px;min-width:0}
.hot-sub-card{display:block;color:inherit;transition:transform .2s;max-width:100%;min-width:0;overflow:hidden}
.hot-sub-card:hover{transform:translateY(-2px)}
.hot-sub-img-wrap{border-radius:10px;overflow:hidden;height:90px;margin-bottom:8px;max-width:100%;min-width:0}
.hot-sub-img-wrap img{width:100%;height:100%;object-fit:cover;display:block}
.hot-sub-title{font-size:14px;font-weight:500;line-height:1.4;margin-bottom:4px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}
.hot-sub-meta{font-size:12px;color:var(--text-muted)}

/* ========== Section Header ========== */
.section-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:20px;
    max-width:100%;
    min-width:0;
}
.section-header h3{
    font-size:20px;
    font-weight:700;
}
.section-header .section-sub{
    font-size:14px;
    color:var(--text-muted);
    margin-left:12px;
}

/* ========== Banner Carousel ========== */
.banner-carousel{position:relative;overflow:hidden;max-width:100%;min-width:0}
.banner-slide{transition:opacity .4s;max-width:100%;min-width:0}
.banner-dots{position:absolute;bottom:60px;left:50%;transform:translateX(-50%);display:flex;gap:6px;z-index:10}
.banner-dot{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,0.5);cursor:pointer;transition:all .3s}
.banner-dot.active{background:#fff;width:20px;border-radius:4px}
.banner-arrow{position:absolute;top:35%;transform:translateY(-50%);width:36px;height:36px;border-radius:50%;border:none;background:rgba(255,255,255,0.8);color:var(--text);font-size:20px;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:10;transition:all .2s;opacity:0}
.banner-carousel:hover .banner-arrow{opacity:1}
.banner-arrow:hover{background:#fff}
.banner-prev{left:10px}
.banner-next{right:10px}

/* ========== Post List (zhiman.vip style) ========== */
.post-list{display:flex;flex-direction:column;gap:20px;max-width:100%;min-width:0}
.post-item{
    display:flex;
    gap:20px;
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    overflow:hidden;
    transition:all .2s;
    max-width:100%;
    min-width:0;
}
.post-item:hover{transform:translateY(-2px);box-shadow:0 4px 20px rgba(0,0,0,0.08)}
.post-item .post-thumb-wrap{
    position:relative;
    width:280px;
    height:180px;
    flex-shrink:0;
}
.post-item .post-thumb{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.post-item .post-thumb-tag{
    position:absolute;
    top:12px;
    left:12px;
    padding:3px 12px;
    background:var(--accent);
    color:#fff;
    font-size:12px;
    border-radius:4px;
    z-index:2;
}
.post-item .post-body{
    flex:1;
    min-width:0;
    padding:16px 20px 16px 0;
    display:flex;
    flex-direction:column;
    justify-content:center;
    max-width:100%;
    overflow:hidden;
}
.post-item .post-title{
    font-size:18px;
    font-weight:600;
    line-height:1.4;
    margin-bottom:10px;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    word-break:break-word;
}
.post-item .post-excerpt{
    font-size:14px;
    color:var(--text-secondary);
    line-height:1.7;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    margin-bottom:14px;
    word-break:break-word;
}
.post-item .post-meta-line{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:13px;
    color:var(--text-muted);
}
.post-item .post-meta-line img{
    width:24px;height:24px;
    border-radius:50%;
    object-fit:cover;
}

/* ========== Post Detail ========== */
.post-detail{max-width:800px;margin:0 auto;background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:40px}
.post-breadcrumb{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-muted);margin-bottom:20px}
.post-breadcrumb a{color:var(--text-muted)}
.post-breadcrumb a:hover{color:var(--accent)}
.post-header-detail{margin-bottom:32px;padding-bottom:24px;border-bottom:1px solid var(--border)}
.post-header-detail h1{font-size:28px;font-weight:700;margin-bottom:16px;line-height:1.4}
.post-meta-bar{display:flex;align-items:center;gap:20px;font-size:14px;color:var(--text-muted)}
.post-meta-bar .meta-tag{padding:2px 10px;background:rgba(79,140,255,0.1);color:var(--accent);border-radius:4px;font-size:12px}

/* 文章内容 - 修复代码块和长单词溢出问题 */
.post-content{font-size:16px;line-height:1.8;color:var(--text);word-wrap:break-word;word-break:break-word;overflow-wrap:break-word}
.post-content h2,.post-content h3,.post-content h4{margin:32px 0 16px;font-weight:600;color:var(--text)}
.post-content p{margin-bottom:16px}
.post-content img{max-width:100%;height:auto;border-radius:8px;margin:16px 0}
.post-content pre{background:#1e1e2e;color:#e2e2f0;padding:16px;border-radius:8px;overflow-x:auto;overflow-y:auto;margin:16px 0;font-size:14px;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;max-width:100%}
.post-content code{background:#f0f0f5;padding:2px 6px;border-radius:4px;font-size:14px;color:#d63384;white-space:pre-wrap;word-wrap:break-word}
.post-content blockquote{border-left:3px solid var(--accent);padding-left:16px;margin:16px 0;color:var(--text-secondary)}
.post-content ul,.post-content ol{margin:16px 0;padding-left:24px}
.post-content li{margin-bottom:8px}
.post-content a{color:var(--accent)}
.post-content a:hover{text-decoration:underline}

/* 文章内表格样式 - 防止溢出 */
.post-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
    margin: 16px 0;
}
.post-content table th,
.post-content table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
}

.download-box{margin:32px 0;padding:24px;background:var(--bg);border-radius:var(--radius);text-align:center}
.btn-download{display:inline-flex;align-items:center;gap:8px;padding:12px 32px;background:linear-gradient(135deg,var(--accent),#a78bfa);color:#fff;border-radius:8px;font-weight:500;transition:all .2s}
.btn-download:hover{transform:translateY(-1px);box-shadow:0 4px 16px rgba(79,140,255,0.3);color:#fff}

.post-nav{display:flex;justify-content:space-between;gap:20px;margin-top:48px;padding-top:24px;border-top:1px solid var(--border)}
.post-nav a{display:flex;flex-direction:column;gap:4px;padding:16px 20px;background:var(--bg);border-radius:8px;color:var(--text);flex:1;transition:all .2s}
.post-nav a:hover{background:var(--border)}
.post-nav span{font-size:12px;color:var(--text-muted)}
.post-nav strong{font-size:14px;font-weight:500;overflow:hidden;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}

/* ========== Page Header ========== */
.page-header{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:32px;margin-bottom:24px}
.page-header .breadcrumb{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-muted);margin-bottom:12px}
.page-header .breadcrumb a{color:var(--text-muted)}
.page-header h1{font-size:24px;font-weight:700;margin-bottom:8px}
.page-desc{color:var(--text-secondary);font-size:14px}

/* ========== Page Detail ========== */
.page-detail{max-width:800px;margin:0 auto;background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:40px}
.page-detail .breadcrumb{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-muted);margin-bottom:20px}
.page-detail .breadcrumb a{color:var(--text-muted)}
.page-title{font-size:24px;font-weight:700;margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--border)}
.page-content{font-size:16px;line-height:1.8}
.page-content h2,.page-content h3,.page-content h4{margin:32px 0 16px}
.page-content p{margin-bottom:16px}
.page-content img{max-width:100%;height:auto;border-radius:8px}
.page-content pre{background:#1e1e2e;color:#e2e2f0;padding:16px;border-radius:8px;overflow-x:auto}
.page-content code{background:#f0f0f5;padding:2px 6px;border-radius:4px;color:#d63384}
.page-content blockquote{border-left:3px solid var(--accent);padding-left:16px;margin:16px 0;color:var(--text-secondary)}
.page-content a{color:var(--accent)}
.page-content a:hover{text-decoration:underline}

/* ========== Post Grid (for search/category) ========== */
.post-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px}
.post-grid-card{
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    overflow:hidden;
    transition:all .2s;
}
.post-grid-card:hover{transform:translateY(-2px);box-shadow:0 4px 20px rgba(0,0,0,0.1)}
.post-grid-card .grid-thumb{height:160px;position:relative}
.post-grid-card .grid-thumb img{width:100%;height:100%;object-fit:cover}
.post-grid-card .grid-thumb .grid-tag{position:absolute;top:10px;left:10px;padding:2px 10px;background:var(--accent);color:#fff;font-size:11px;border-radius:4px}
.post-grid-card .grid-body{padding:16px}
.post-grid-card .grid-title{font-size:15px;font-weight:600;line-height:1.4;margin-bottom:8px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.post-grid-card .grid-excerpt{font-size:13px;color:var(--text-secondary);line-height:1.5;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-bottom:10px}
.post-grid-card .grid-meta{font-size:12px;color:var(--text-muted)}

/* ========== Pagination ========== */
.pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin-top:32px}
.pagination a,.pagination span{
    padding:8px 18px;
    background:var(--card);
    border:1px solid var(--border);
    border-radius:8px;
    font-size:14px;
    color:var(--text);
    transition:all .2s;
}
.pagination a:hover{border-color:var(--accent);color:var(--accent)}

/* ========== Empty State ========== */
.empty-state{text-align:center;padding:80px 20px;color:var(--text-muted)}
.empty-state h1{font-size:64px;color:var(--accent);margin-bottom:16px}
.empty-state p{font-size:16px;margin-bottom:24px}

/* ========== Footer ========== */
.site-footer{
    background:var(--card);
    border-top:2px solid #ff6b6b;
    margin-top:48px;
    padding:0;
}
.site-footer a:hover{color:var(--accent)}

/* ========== Responsive ========== */
@media(max-width:1024px){
    .content-layout{flex-direction:column}
    .sidebar{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;box-sizing:border-box!important;min-width:0!important}
    .widget{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;box-sizing:border-box!important;padding:16px!important;overflow:hidden!important;min-width:0!important}
    .featured-section{
        grid-template-columns:minmax(0, 1fr)!important;
        gap:16px;
        max-width:100%;
        min-width:0;
        overflow:hidden;
    }
    .featured-section .sidebar{width:100%!important;margin-top:16px;max-width:100%;min-width:0}
    .featured-main{max-width:100%;min-width:0;overflow:hidden}
    .tools-section{grid-template-columns:repeat(2,1fr);gap:12px}
    /* .main-nav{display:none} */  /* 已注释 - 移动端菜单改用汉堡菜单 */
    .search-form-header{width:160px}
    .post-item{flex-direction:column}
    .post-item .post-thumb-wrap{width:100%;height:200px}
    .post-item .post-body{padding:16px}
    .banner-slide a>div:first-child{height:300px}
    .featured-main .featured-img{height:300px}
    .hot-layout{flex-direction:column;gap:12px}
    .hot-main{flex:1;max-width:100%;min-width:0}
    .hot-subs{grid-template-columns:1fr 1fr}
}
@media(max-width:640px){
    .main-content{padding:16px 12px}
    .tools-section{grid-template-columns:1fr}
    .post-grid{grid-template-columns:1fr}
    .post-detail{padding:24px}
    .page-detail{padding:24px}
    .search-form-header{display:none}
    .hot-layout{flex-direction:column}
    .hot-main{flex:1;max-width:100%;min-width:0}
    .hot-subs{grid-template-columns:1fr 1fr}
    .banner-slide a>div:first-child{height:240px}
    .featured-main .featured-img{height:240px}
    .widget{padding:12px!important;min-width:0!important}
    .widget-title{margin-bottom:12px!important;padding-bottom:8px!important}
    .pick-item{padding:8px 0!important;gap:10px!important;min-width:0!important}
    .pick-item>img,.pick-item>div:first-child{width:48px!important;height:48px!important;min-width:48px!important;max-width:48px!important}
    .pick-item .pick-title{font-size:13px!important}
    .featured-section{gap:12px}
    .featured-main h2{font-size:16px}
    .featured-main .featured-info{padding:12px 16px}
}