* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: #f5f5f5; color: #333; line-height: 1.6; }
a { text-decoration: none; color: #333; transition: color .2s; }
a:hover { color: #e74c3c; }
.clearfix::after { content: ""; display: table; clear: both; }
.clear { clear: both; }

#progress { position: fixed; top: 0; left: 0; height: 3px; background: #e74c3c; width: 0; z-index: 9999; transition: width .3s; }

.wrapper { min-height: 100vh; }
.box { max-width: 1200px; margin: 0 auto; padding: 20px; display: flex; gap: 20px; }

.sidebar { width: 240px; flex-shrink: 0; background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 20px; align-self: flex-start; max-height: calc(100vh - 40px); overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.logo { text-align: center; margin-bottom: 10px; }
.logo img { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 8px; }
.logo h1 { font-size: 24px; color: #e74c3c; }
.subtitle { text-align: center; color: #999; font-size: 13px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; }

.search { margin-bottom: 20px; }
.search form { display: flex; gap: 0; }
.search select { padding: 8px; border: 1px solid #ddd; border-right: none; border-radius: 4px 0 0 4px; background: #f8f8f8; font-size: 13px; }
.search input.txt { flex: 1; padding: 8px 10px; border: 1px solid #ddd; outline: none; font-size: 13px; }
.search button.btn { width: 38px; background: #e74c3c; border: none; border-radius: 0 4px 4px 0; color: #fff; cursor: pointer; font-size: 16px; }
.search button.btn::before { content: "\1F50D"; }

.menu { margin-bottom: 20px; }
.menu ul { list-style: none; }
.menu li { margin-bottom: 2px; }
.menu a { display: block; padding: 8px 12px; border-radius: 4px; font-size: 14px; color: #555; transition: all .2s; }
.menu a:hover { background: #fef0ef; color: #e74c3c; }
.menu li.active a { background: #e74c3c; color: #fff; }

.sns { display: flex; justify-content: center; gap: 12px; padding: 15px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; margin-bottom: 15px; }
.sns a { width: 32px; height: 32px; background: #f5f5f5; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #888; position: relative; }
.sns a.about::before { content: "关"; }
.sns a.tags::before { content: "标"; }
.sns a.privacy::before { content: "私"; }
.sns a.feed::before { content: "订"; }
.sns a.sitemap::before { content: "导"; }
.sns a:hover { background: #e74c3c; color: #fff; }

.sidefoot { text-align: center; color: #bbb; font-size: 12px; }

.main { flex: 1; min-width: 0; }

.main_top { background: #fff; border-radius: 8px; padding: 0 20px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.main_top > ul { list-style: none; display: flex; }
.main_top > ul > li { position: relative; }
.main_top > ul > li > a { display: block; padding: 15px 18px; font-size: 14px; color: #555; border-bottom: 2px solid transparent; }
.main_top > ul > li > a:hover { color: #e74c3c; border-bottom-color: #e74c3c; }
.main_top > ul > li > ul { position: absolute; top: 100%; left: 0; background: #fff; list-style: none; min-width: 140px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-radius: 4px; padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .2s; z-index: 100; }
.main_top > ul > li:hover > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.main_top > ul > li > ul a { display: block; padding: 8px 20px; font-size: 13px; }
.main_top > ul > li > ul a:hover { background: #fef0ef; }
.icon-down::after { content: " \25BC"; font-size: 10px; color: #999; }

.post { background: #fff; border-radius: 8px; padding: 25px 30px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.posttitle { font-size: 20px; margin-bottom: 18px; line-height: 1.4; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.posttitle a { color: #222; }
.posttitle a:hover { color: #e74c3c; }

.postintro { overflow: hidden; }
.postintro img { float: left; margin: 0 20px 10px 0; width: 180px; height: 240px; object-fit: cover; border-radius: 4px; box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
.postintro p { font-size: 14px; color: #666; line-height: 1.8; margin-bottom: 10px; }
.yueduall { display: inline-block; padding: 4px 12px; background: #f5f5f5; border-radius: 3px; font-size: 13px; color: #888; margin-left: 5px; }
.yueduall:hover { background: #e74c3c; color: #fff; }

.postinfo { margin-top: 20px; padding-top: 15px; border-top: 1px solid #f0f0f0; display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: #999; }
.postinfo .articate a { color: #e74c3c; }
.postinfo .articate::before { content: "\1F4C2"; margin-right: 4px; }
.postinfo .time::before { content: "\1F4C5"; margin-right: 4px; }
.postinfo .commnum a { color: #999; }
.postinfo .commnum::before { content: "\1F4AC"; margin-right: 4px; }
.postinfo .favorite a { color: #999; cursor: pointer; }
.postinfo .favorite::before { content: "\2B50"; margin-right: 4px; }
.postinfo .report a { color: #999; }
.postinfo .report::before { content: "\26A0"; margin-right: 4px; }

.pagebar { text-align: center; padding: 20px 0; }
.pagebar .page { display: inline-block; min-width: 36px; height: 36px; line-height: 36px; padding: 0 10px; margin: 0 3px; background: #fff; border-radius: 4px; font-size: 14px; color: #666; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.pagebar .page b { color: #e74c3c; }
.pagebar a:hover .page { background: #e74c3c; color: #fff; }

.postname h2 { font-size: 18px; padding: 15px 0; margin-bottom: 15px; border-bottom: 2px solid #e74c3c; display: inline-block; }
.relates .postcon ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.relates .postcon li { }
.relates .postcon span { display: block; margin-bottom: 8px; }
.relates .postcon img { width: 100%; height: 160px; object-fit: cover; border-radius: 4px; }
.relates .postcon a { font-size: 13px; line-height: 1.5; color: #555; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

#postdb { margin-bottom: 20px; }
#postdb table { width: 100%; border-collapse: collapse; margin-top: 10px; }
#postdb td { padding: 12px; vertical-align: top; }
#postdb .info { background: #fafafa; border-radius: 6px; font-size: 14px; line-height: 2; }
#postdb .info strong { color: #555; }
#postdb .functions { display: flex; gap: 10px; flex-wrap: wrap; }
#postdb .function { text-align: center; padding: 10px; background: #fafafa; border-radius: 6px; min-width: 90px; cursor: pointer; transition: all .2s; }
#postdb .function:hover { background: #fef0ef; }
#postdb .function .icon { display: block; font-size: 20px; font-weight: bold; color: #e74c3c; margin-bottom: 5px; }
#postdb .function .title { font-size: 12px; color: #888; }
#postdb .function.rating .icon { color: #f39c12; }
#postdb .function.dangdang .icon::before { content: "\1F4DA"; }
#postdb .function.jingdong .icon::before { content: "\1F6D2"; }
#postdb .function.kong .icon::before { content: "\1F4D6"; }
#postdb .function.like .icon::before { content: "\2764"; }
#postdb .function.allsearch .icon::before { content: "\1F50D"; }

.postintro h3 { font-size: 16px; margin: 20px 0 10px; padding-left: 10px; border-left: 3px solid #e74c3c; clear: both; }
.posttags { margin-top: 20px; padding-top: 15px; border-top: 1px dashed #eee; }
.posttags a { display: inline-block; padding: 4px 12px; background: #f5f5f5; border-radius: 15px; font-size: 12px; color: #888; margin-right: 8px; margin-bottom: 5px; }
.posttags a:hover { background: #e74c3c; color: #fff; }

.singlebar { display: flex; justify-content: space-between; padding: 20px 0; gap: 20px; margin-top: 20px; border-top: 1px solid #f0f0f0; }
.singlebar a { flex: 1; padding: 15px; background: #fafafa; border-radius: 6px; font-size: 13px; color: #666; transition: all .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.singlebar a:hover { background: #e74c3c; color: #fff; }
.singlebar a.l { text-align: left; }
.singlebar a.r { text-align: right; }

.postlist { border-bottom: 1px dotted #ccc; padding: 8px 10px; margin: 4px; box-shadow: inset 0px 0px 20px 1px #f6f6f6; border-radius: 2px; font-size: 14px; }
.postlist:hover { background: #eee; }
.postlist .articate { display: inline-block; width: 110px; }
.postlist .articate a { color: #e74c3c; font-size: 12px; }
.postlist time { display: inline-block; width: 55px; color: #999; font-size: 12px; }
.postlist .xiangyou a { color: #444; }
.postlist .xiangyou a:hover { color: #e74c3c; }

#post-rand { position: relative; max-width: 100%; width: 100%; margin-bottom: 10px; }
.masonry-css { columns: 4 220px; column-gap: 15px; }
.masonry-css .item { break-inside: avoid; margin-bottom: 15px; }
.post_box { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: all 0.3s ease-in-out; }
.post_box:hover { opacity: .9; transform: translateY(-3px); box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.thumbnail img { width: 100%; height: auto; display: block; }
.post_title { margin: 10px; padding: 10px 5px 0; font-size: 13px; border-top: 1px solid #f5f5f5; line-height: 1.5; max-height: 60px; overflow: hidden; }
.post_title a { color: #666; }
.loading { text-align: center; padding: 60px 20px; font-size: 16px; color: #999; line-height: 2; }

.footer { background: #fff; padding: 25px 20px; text-align: center; color: #888; font-size: 13px; line-height: 2; border-top: 1px solid #eee; margin-top: 20px; }

.night_button, .menu_button, .backtotop { position: fixed; right: 20px; width: 42px; height: 42px; line-height: 42px; text-align: center; border-radius: 50%; opacity: .85; font-size: 18px; color: #fff; cursor: pointer; background-color: #333; border: none; z-index: 999; font-family: inherit; transition: all .2s; }
.night_button:hover, .menu_button:hover, .backtotop:hover { opacity: 1; transform: scale(1.1); }
.night_button { bottom: 170px; }
.night_button::after { content: "\1F319"; }
.menu_button { bottom: 120px; }
.menu_button::after { content: "\2630"; }
.backtotop { bottom: 70px; display: none; }
.backtotop::after { content: "\2191"; }
.backtotop.show { display: block; }

body.night { background: #1a1a1a; color: #ccc; }
body.night .sidebar, body.night .main_top, body.night .post, body.night .footer, body.night .post_box, body.night #postdb td.info, body.night #postdb .function, body.night .singlebar a { background: #2a2a2a; }
body.night a, body.night .posttitle a, body.night .menu a { color: #bbb; }
body.night a:hover, body.night .posttitle a:hover { color: #ff6b6b; }
body.night .menu a:hover, body.night .main_top > ul > li > a:hover, body.night .yueduall:hover, body.night .singlebar a:hover, body.night .posttags a:hover { background: #3a3a3a; color: #ff6b6b; }
body.night .postinfo, body.night .subtitle, body.night .sidefoot, body.night .post_title a { color: #888; }
body.night .postintro img { box-shadow: 0 3px 10px rgba(0,0,0,0.4); }
body.night .search select, body.night .search input.txt, body.night .sns a { background: #3a3a3a; color: #ccc; border-color: #444; }
body.night .postlist { background: #252525; box-shadow: inset 0px 0px 20px 1px #2a2a2a; }
body.night .postlist:hover { background: #333; }
body.night .postintro h3 { color: #ddd; }
body.night #postdb .functions .function:hover { background: #3a3a3a; }
body.night .pagebar .page { background: #2a2a2a; color: #ccc; }

@media (max-width: 900px) {
    .box { flex-direction: column; padding: 10px; }
    .sidebar { width: 100%; position: fixed; top: 0; left: -100%; height: 100vh; max-height: 100vh; z-index: 1000; border-radius: 0; transition: left .3s; }
    .sidebar.show { left: 0; }
    .main_top > ul { overflow-x: auto; }
    .main_top > ul > li > a { padding: 12px 14px; font-size: 13px; white-space: nowrap; }
    .post { padding: 15px; }
    .postintro img { width: 120px; height: 160px; margin: 0 12px 8px 0; }
    .posttitle { font-size: 17px; }
    .masonry-css { columns: 2; }
    .relates .postcon ul { grid-template-columns: repeat(2, 1fr); }
    #postdb td { display: block; }
    #postdb table, #postdb tbody, #postdb tr { display: block; }
    .singlebar { flex-direction: column; }
}
@media (max-width: 500px) {
    .masonry-css { columns: 1; }
    .postintro img { float: none; display: block; margin: 0 auto 15px; width: 150px; height: 200px; }
    .relates .postcon ul { grid-template-columns: 1fr; }
}
