/* ============================================================
   B910Pro — Professional Chemistry Information Theme
   ============================================================ */

/* ---- Reset & Base ---- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;color:var(--text);background:var(--bg);line-height:1.7;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
a{color:var(--link);text-decoration:none}
a:hover{color:var(--link-hover)}
img{max-width:100%;height:auto;vertical-align:middle}
ul,ol{list-style:none}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
input,textarea{font:inherit;outline:none}
iframe{max-width:100%}

/* ---- Design Tokens ---- */
:root{
  --primary:#0d3b5c;
  --primary-light:#1a5f8a;
  --primary-tint:#e8f0f6;
  --accent:#c2410c;
  --accent-tint:#fff3e6;
  --bg:#f5f7fa;
  --surface:#ffffff;
  --text:#1a2332;
  --text-2:#475569;
  --muted:#8896a6;
  --border:#e2e8f0;
  --border-light:#f1f5f9;
  --link:#155e8a;
  --link-hover:#0d3b5c;
  --shadow-xs:0 1px 2px rgba(13,59,92,.05);
  --shadow-sm:0 2px 8px rgba(13,59,92,.06);
  --shadow-md:0 4px 16px rgba(13,59,92,.08);
  --r:8px;
  --r-lg:12px;
  --maxw:1100px;
  --header-h:60px;
  --pad:20px;
}

/* ---- Header ---- */
.site-header{
  position:sticky;top:0;z-index:100;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  box-shadow:var(--shadow-xs);
}
.header-inner{
  max-width:var(--maxw);
  margin:0 auto;
  padding:0 var(--pad);
  display:flex;
  align-items:center;
  height:var(--header-h);
  gap:24px;
}
.logo{flex-shrink:0;display:flex;align-items:center}
.logo img{height:36px;width:auto;display:block}
.logo-text{font-size:20px;font-weight:800;color:var(--primary);letter-spacing:-.02em}

.nav-main{display:flex;gap:2px;align-items:center}
.nav-main a{
  padding:8px 14px;
  font-size:15px;
  font-weight:500;
  color:var(--text);
  border-radius:var(--r);
  transition:color .15s,background .15s;
}
.nav-main a:hover,.nav-main a.active{
  color:var(--primary);
  background:var(--primary-tint);
}
.header-search{margin-left:auto;display:flex;align-items:center;gap:8px}
.header-search input{
  width:180px;
  padding:8px 12px;
  font-size:14px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--bg);
  transition:border-color .15s,background .15s;
}
.header-search input:focus{
  border-color:var(--primary);
  background:var(--surface);
}
.header-search button{
  padding:8px 16px;
  font-size:14px;
  font-weight:500;
  color:#fff;
  background:var(--primary);
  border-radius:var(--r);
  transition:background .15s;
}
.header-search button:hover{background:var(--primary-light)}

.search-toggle{display:none}
.read-progress{
  position:fixed;top:0;left:0;
  height:3px;background:var(--accent);
  z-index:300;width:0;
  transition:width .1s;
}

/* ---- Layout Containers ---- */
.list-page,.article-page{
  max-width:var(--maxw);
  margin:0 auto;
  padding:24px var(--pad) 60px;
}
.list-layout,.article-container{
  display:flex;
  gap:32px;
  align-items:flex-start;
}
.list-main,.article-main{
  flex:1;
  min-width:0;
}
.side-col{
  width:260px;
  flex-shrink:0;
}
.page-h1{
  position:absolute;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
}

/* ---- Breadcrumb ---- */
.breadcrumb{
  padding:0 0 16px;
  font-size:13px;
  color:var(--muted);
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
}
.breadcrumb a{color:var(--muted)}
.breadcrumb a:hover{color:var(--primary)}
.breadcrumb .sep{color:var(--border)}

/* ---- Search Info ---- */
.search-info{padding:0 0 20px}
.search-info h1{font-size:22px;font-weight:700;color:var(--text);margin-bottom:4px}
.search-info p{font-size:14px;color:var(--muted)}
.search-empty{
  text-align:center;
  padding:60px 20px;
  color:var(--muted);
}
.search-empty p{margin-bottom:8px}
.search-empty .hint{font-size:14px}

/* ---- Article List ---- */
.news-list{display:flex;flex-direction:column}
.news-item{
  display:flex;
  gap:16px;
  padding:20px 0;
  border-bottom:1px solid var(--border-light);
}
.news-item:last-child{border-bottom:0}

.news-thumb{
  flex-shrink:0;
  width:140px;
  height:90px;
  border-radius:var(--r);
  overflow:hidden;
  background:var(--bg);
}
.news-thumb img{
  width:100%;height:100%;
  object-fit:cover;
  display:block;
}
.news-item.no-thumb-item .news-body{flex:1}

.news-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.news-title{
  font-size:17px;
  font-weight:600;
  line-height:1.45;
  color:var(--text);
  margin-bottom:6px;
}
.news-title a{color:inherit}
.news-title a:hover{color:var(--primary)}
.news-excerpt{
  font-size:14px;
  color:var(--text-2);
  line-height:1.65;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin-bottom:8px;
}
.news-meta{
  display:flex;
  gap:12px;
  font-size:13px;
  color:var(--muted);
  flex-wrap:wrap;
  align-items:center;
}
.news-meta .cat{
  padding:2px 8px;
  background:var(--primary-tint);
  color:var(--primary);
  border-radius:4px;
  font-weight:500;
  font-size:12px;
}

/* ---- Pagination ---- */
.pagination{
  display:flex;
  gap:6px;
  justify-content:center;
  padding:32px 0 8px;
  flex-wrap:wrap;
}
.pagination a,.pagination span{
  min-width:38px;
  height:38px;
  padding:0 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:500;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--surface);
  color:var(--text-2);
  transition:border-color .15s,color .15s;
}
.pagination a:hover{
  border-color:var(--primary);
  color:var(--primary);
}
.pagination span.current{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}

/* ---- Article Detail ---- */
.article-main{
  background:var(--surface);
  border-radius:var(--r-lg);
  padding:28px var(--pad);
  box-shadow:var(--shadow-xs);
}
.article-header{
  padding-bottom:20px;
  border-bottom:2px solid var(--primary);
  margin-bottom:28px;
}
.article-cat-tag{
  display:inline-block;
  padding:3px 10px;
  margin-bottom:12px;
  font-size:12px;
  font-weight:600;
  color:var(--accent);
  background:var(--accent-tint);
  border-radius:4px;
}
.article-title{
  font-size:26px;
  font-weight:800;
  line-height:1.35;
  color:var(--text);
  margin-bottom:14px;
}
.article-meta{
  display:flex;
  gap:16px;
  font-size:13px;
  color:var(--muted);
  flex-wrap:wrap;
  align-items:center;
}
.article-meta .author{font-weight:500;color:var(--text-2)}

/* ---- Article Body ---- */
.article-body{
  font-size:17px;
  line-height:1.85;
  color:var(--text);
  word-wrap:break-word;
  overflow-wrap:break-word;
  overflow-x:hidden;
}
.article-body p{margin-bottom:1.3em}
.article-body h2{
  font-size:1.5em;
  font-weight:700;
  color:var(--text);
  margin:1.8em 0 .6em;
  padding-left:12px;
  border-left:4px solid var(--primary);
}
.article-body h3{
  font-size:1.25em;
  font-weight:600;
  color:var(--text);
  margin:1.5em 0 .5em;
}
.article-body blockquote{
  margin:1.5em 0;
  padding:14px 18px;
  border-left:3px solid var(--accent);
  background:var(--accent-tint);
  border-radius:0 var(--r) var(--r) 0;
  font-size:.95em;
  color:var(--text-2);
}
.article-body ul,.article-body ol{margin:1em 0;padding-left:1.5em}
.article-body li{margin-bottom:.4em}
.article-body strong{font-weight:700}
.article-body a{color:var(--link)}
.article-body a:hover{text-decoration:underline}
.article-body hr{
  border:0;
  border-top:1px solid var(--border);
  margin:2em 0;
}

/* Legacy inline style neutralization */
.article-body img{
  max-width:100%!important;
  height:auto!important;
  width:auto!important;
  border-radius:var(--r);
  margin:1em 0;
  display:block;
}
.article-body span[style*="background"]{background:none!important}
.article-body span[style*="font-family"]{font-family:inherit!important}
.article-body table{
  display:block;
  overflow-x:auto;
  max-width:100%;
  width:100%!important;
  border-collapse:collapse;
  margin:1.2em 0;
  font-size:.95em;
}
.article-body th,.article-body td{
  padding:8px 12px;
  border:1px solid var(--border);
  text-align:left;
}
.article-body th{background:var(--bg);font-weight:600}

/* ---- Article Footer ---- */
.article-footer{
  margin-top:32px;
  padding-top:20px;
  border-top:1px solid var(--border);
}
.article-tags{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
}
.article-tags .label{
  font-size:13px;
  color:var(--muted);
  margin-right:4px;
}
.article-tags a{
  padding:4px 10px;
  font-size:13px;
  color:var(--primary);
  background:var(--primary-tint);
  border-radius:4px;
  transition:background .15s,color .15s;
}
.article-tags a:hover{background:var(--primary);color:#fff}

/* ---- Related List ---- */
.related-list{
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid var(--border);
}
.related-title{
  font-size:16px;
  font-weight:700;
  color:var(--text);
  margin-bottom:12px;
  padding-left:10px;
  border-left:3px solid var(--primary);
}
.related-list ul{display:flex;flex-direction:column;gap:6px}
.related-list li{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:6px 0;
  font-size:14px;
}
.related-list li a{
  color:var(--text-2);
  flex:1;
  min-width:0;
  overflow:hidden;
  word-break:break-all;
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
}
.related-list li a:hover{color:var(--primary)}
.related-date{
  font-size:12px;
  color:var(--muted);
  flex-shrink:0;
}

/* ---- Article Nav (prev/next) ---- */
.article-nav{
  display:flex;
  gap:12px;
  margin-top:24px;
}
.article-nav .prev,.article-nav .next{
  flex:1;
  min-width:0;
}
.article-nav a{
  display:block;
  padding:14px 16px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  font-size:14px;
  transition:border-color .15s;
}
.article-nav a:hover{
  border-color:var(--primary);
  box-shadow:var(--shadow-sm);
}
.article-nav .nav-label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:2px;
}
.article-nav .nav-title{
  display:block;
  font-weight:500;
  color:var(--text);
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.article-nav .next{text-align:right}

/* ---- Sidebar ---- */
.side-box{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:18px 20px;
  margin-bottom:16px;
  box-shadow:var(--shadow-xs);
}
.side-title{
  font-size:16px;
  font-weight:700;
  color:var(--text);
  margin-bottom:14px;
  padding-bottom:10px;
  border-bottom:2px solid var(--primary);
  display:flex;
  align-items:center;
  gap:6px;
}
.side-title::before{
  content:"";
  width:4px;height:16px;
  background:var(--accent);
  border-radius:2px;
}
.side-list li{
  padding:8px 0;
  border-bottom:1px solid var(--border-light);
  font-size:14px;
  line-height:1.5;
}
.side-list li:last-child{border-bottom:0}
.side-list li a{color:var(--text-2)}
.side-list li a:hover{color:var(--primary)}
.side-meta{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}
.tag-cloud{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.tag-cloud a{
  padding:4px 10px;
  font-size:13px;
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--text-2);
  background:var(--surface);
  transition:border-color .15s,color .15s,background .15s;
}
.tag-cloud a:hover{
  border-color:var(--primary);
  color:var(--primary);
  background:var(--primary-tint);
}

/* ---- Footer ---- */
.site-footer{
  background:var(--surface);
  border-top:1px solid var(--border);
  padding:24px var(--pad);
  margin-top:40px;
}
.footer-inner{
  max-width:var(--maxw);
  margin:0 auto;
  padding:0 var(--pad);
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
}
.footer-copy{
  font-size:13px;
  color:var(--muted);
  line-height:1.8;
  text-align:center;
}
.footer-copy a{color:var(--text-2)}
.footer-copy a:hover{color:var(--primary)}

/* ---- Search Overlay ---- */
.search-overlay{
  display:none;
  position:fixed;
  top:0;left:0;right:0;
  background:var(--surface);
  padding:16px;
  z-index:200;
  box-shadow:var(--shadow-md);
  border-bottom:1px solid var(--border);
}
.search-overlay.open{
  display:flex;
}
.search-overlay form{
  display:flex;
  gap:8px;
  width:100%;
  max-width:var(--maxw);
  margin:0 auto;
  align-items:center;
}
.search-overlay input{
  flex:1;
  padding:10px 14px;
  font-size:16px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--bg);
}
.search-overlay input:focus{
  border-color:var(--primary);
  background:var(--surface);
}
.search-overlay button[type="submit"]{
  padding:10px 18px;
  font-size:14px;
  font-weight:500;
  color:#fff;
  background:var(--primary);
  border-radius:var(--r);
}
.search-overlay #searchClose{
  padding:8px 12px;
  font-size:20px;
  color:var(--muted);
  cursor:pointer;
}

/* ---- Mobile (≤768px) ---- */
@media(max-width:1024px){
  :root{
    --pad:16px;
    --header-h:54px;
  }

  .header-inner{
    gap:12px;
    height:var(--header-h);
  }
  .logo img{height:32px}
  .logo-text{font-size:18px}

  .nav-main,.header-search{display:none}
  .search-toggle{
    display:flex;
    align-items:center;
    justify-content:center;
    margin-left:auto;
    padding:8px;
    cursor:pointer;
    color:var(--text);
  }
  


  .list-page,.article-page{
    max-width:100%;
  }

  .list-layout,.article-container{
    flex-direction:column;
    gap:0;
  }
  .side-col{display:none}

  .article-main{
    padding:20px 16px;
    border-radius:0;
    width:100%;
    max-width:100%;
  }
  .article-title{font-size:20px}
  .article-body{font-size:16px;line-height:1.8}
  .article-body h2{font-size:1.35em}

  .news-thumb{width:100px;height:66px}
  .news-item{gap:12px;padding:16px 0}
  .news-title{font-size:16px}
  .news-excerpt{font-size:13px;-webkit-line-clamp:1}

  .article-nav{flex-direction:column}
  .article-nav .next{text-align:left}

  .related-list li{
    flex-direction:column;
    align-items:flex-start;
    gap:2px;
  }

  .footer-copy{font-size:12px}
}