/*
Theme Name: Ink Blog JustNews
Description: Ink品牌博客站 · JustNews风格 · 原生HTML/CSS/JS · 亮/暗双主题
Version: 3.1.0
*/

/* ===== 颜色变量（亮色/暗色） ===== */
:root {
  --bg-body: #f5f6f9;
  --bg-card: #ffffff;
  --text: #232323;
  --text-light: #8a92b0;
  --text-muted: #999;
  --border: #eef1f5;
  --accent: #297af4;
  --accent-hover: #045fe6;
  --header-start: #0f2b5e;
  --header-end: #297af4;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --input-bg: #f5f6f9;
  --cta-bg: linear-gradient(90deg, #0f2b5e 0%, #297af4 100%);
  --footer-bg: #1a1a2e;
  --tag-bg: #f5f6f9;
  --overlay: rgba(0,0,0,0.55);
  --divider: #eef1f5;
}
html.dark-mode {
  --bg-body: #0c0e1a;
  --bg-card: #141830;
  --text: #e0e4f0;
  --text-light: #8890b0;
  --text-muted: #5a6290;
  --border: #1e2340;
  --accent: #4a8cff;
  --accent-hover: #6ba0ff;
  --header-start: #080a16;
  --header-end: #142050;
  --shadow: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.5);
  --input-bg: #1a1f32;
  --cta-bg: linear-gradient(90deg, #080a16 0%, #142050 100%);
  --footer-bg: #080a16;
  --tag-bg: #1a1f32;
  --overlay: rgba(0,0,0,0.75);
  --divider: #1e2340;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:10px;-webkit-font-smoothing:antialiased}
body{
  font-family:-apple-system,"Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px;line-height:1.6;
  color:var(--text);
  background-color:var(--bg-body);
  background-image:repeating-linear-gradient(
    45deg,
    transparent,
    transparent 28px,
    rgba(41,122,244,0.035) 28px,
    rgba(41,122,244,0.035) 29px
  );
  overflow-x:hidden;
  transition:background .3s,color .3s
}
html.dark-mode body {
  background-image:repeating-linear-gradient(
    45deg,
    transparent,
    transparent 28px,
    rgba(74,140,255,0.05) 28px,
    rgba(74,140,255,0.05) 29px
  );
}
a{color:var(--accent);text-decoration:none;transition:color .2s}
a:hover{color:var(--accent-hover)}
img{max-width:100%;height:auto;vertical-align:middle}
ul,ol{list-style:none}
h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.4;color:var(--text)}
h1{font-size:28px}h2{font-size:22px}h3{font-size:18px}
.container{max-width:1200px;margin:0 auto;padding:0 15px}
@media(max-width:1239px){.container{max-width:970px}}
@media(max-width:991px){.container{max-width:100%}}

/* ===== Header ===== */
.header{
  position:fixed;top:0;left:0;right:0;height:64px;z-index:1000;
  background:var(--header-start);
  background:linear-gradient(90deg,var(--header-start) 0%,var(--header-end) 100%);
  box-shadow:0 2px 8px rgba(0,0,0,0.12)
}
.header-inner{
  max-width:1200px;margin:0 auto;height:100%;padding:0 15px;
  display:flex;align-items:center;justify-content:space-between
}
.logo{flex-shrink:0}
.logo a{display:flex;align-items:center;color:#fff;font-size:1.7rem;font-weight:700;letter-spacing:-0.5px}
.logo span{margin-left:8px}
.nav-wrap{display:flex;align-items:center;gap:16px}
.nav-list{display:flex;align-items:center;gap:2px}
.nav-list>li>a{
  display:block;padding:8px 14px;color:rgba(255,255,255,0.88);
  font-size:14px;font-weight:500;border-radius:4px;transition:all .2s
}
.nav-list>li>a:hover,
.nav-list>li.current-menu-item>a{background:rgba(255,255,255,0.15);color:#fff}
.navbar-action{display:flex;align-items:center;gap:8px}

/* 主题切换按钮 */
.theme-toggle{
  background:rgba(255,255,255,0.12);border:1px solid rgba(255,255,255,0.2);
  color:rgba(255,255,255,0.85);width:34px;height:34px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  font-size:16px;transition:all .2s;line-height:1
}
.theme-toggle:hover{background:rgba(255,255,255,0.2);color:#fff}

.search-icon{
  color:rgba(255,255,255,0.85);font-size:18px;cursor:pointer;
  padding:6px;border-radius:50%;transition:all .2s;line-height:1;background:none;border:none
}
.search-icon:hover{background:rgba(255,255,255,0.15);color:#fff}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:6px 16px;font-size:13px;font-weight:500;
  border-radius:4px;cursor:pointer;border:none;transition:all .2s;line-height:1.5;white-space:nowrap
}
.btn-white{background:#fff;color:#297af4}
.btn-white:hover{background:#f0f4ff;color:#045fe6}
html.dark-mode .btn-white{background:var(--bg-card);color:var(--accent)}
html.dark-mode .btn-white:hover{background:#1e2850}

.btn-outline-light{background:transparent;color:#fff;border:1px solid rgba(255,255,255,0.4)}
.btn-outline-light:hover{background:rgba(255,255,255,0.12);border-color:rgba(255,255,255,0.7)}
.menu-toggle{display:none;background:none;border:none;width:28px;height:20px;position:relative;cursor:pointer}
.menu-toggle span{display:block;width:100%;height:2px;background:#fff;border-radius:2px;position:absolute;left:0;transition:all .3s}
.menu-toggle span:nth-child(1){top:0}
.menu-toggle span:nth-child(2){top:9px}
.menu-toggle span:nth-child(3){top:18px}
.menu-toggle.active span:nth-child(1){transform:rotate(45deg);top:9px}
.menu-toggle.active span:nth-child(2){opacity:0}
.menu-toggle.active span:nth-child(3){transform:rotate(-45deg);top:9px}

/* ===== 搜索弹窗 ===== */
.search-popup{
  position:fixed;top:0;left:0;right:0;bottom:0;background:var(--overlay);z-index:2000;
  display:none;align-items:center;justify-content:center;backdrop-filter:blur(4px)
}
.search-popup.active{display:flex}
.search-popup-inner{
  width:600px;max-width:90vw;background:var(--bg-card);border-radius:12px;
  padding:30px;position:relative;box-shadow:var(--shadow-hover);
  transition:background .3s
}
.search-popup-close{
  position:absolute;top:12px;right:16px;font-size:24px;color:var(--text-light);cursor:pointer;
  line-height:1;background:none;border:none;transition:color .2s
}
.search-popup-close:hover{color:var(--text)}
.search-popup h3{font-size:18px;margin-bottom:16px;color:var(--text)}
.search-form{display:flex;gap:10px}
.search-form input{
  flex:1;padding:10px 16px;font-size:15px;
  border:2px solid var(--border);border-radius:5px;outline:none;transition:border-color .2s;
  background:var(--input-bg);color:var(--text)
}
.search-form input:focus{border-color:var(--accent)}
.search-form button{
  padding:10px 24px;background:var(--accent);color:#fff;
  border:none;border-radius:5px;font-size:14px;cursor:pointer;transition:background .2s
}
.search-form button:hover{background:var(--accent-hover)}

/* ===== 主体 ===== */
#wrap{padding-top:64px;transition:background .3s}
@media(max-width:991px){#wrap{padding-top:58px}}

/* ===== Hero 轮播 ===== */
.hero-section{padding:30px 0 20px}
.hero-slider{
  position:relative;border-radius:12px;overflow:hidden;
  max-width:1200px;margin:0 auto;box-shadow:var(--shadow)
}
.hero-slides{position:relative;overflow:hidden}
.hero-slide{display:none;position:relative;aspect-ratio:1200/450}
.hero-slide.active{display:block}
.hero-slide img{width:100%;height:100%;object-fit:cover}
.hero-slide-overlay{
  position:absolute;bottom:0;left:0;right:0;padding:40px 30px 25px;
  background:linear-gradient(transparent,rgba(0,0,0,0.75));color:#fff
}
.hero-slide-overlay .cat-tag{
  display:inline-block;padding:3px 12px;font-size:12px;font-weight:500;
  background:var(--accent);color:#fff;border-radius:3px;margin-bottom:8px
}
.hero-slide-overlay h2{font-size:24px;font-weight:600;color:#fff;margin-bottom:4px}
.hero-slide-overlay p{font-size:14px;color:rgba(255,255,255,0.85)}
.hero-dots{position:absolute;bottom:14px;right:30px;display:flex;gap:8px;z-index:10}
.hero-dot{
  width:10px;height:10px;border-radius:50%;background:rgba(255,255,255,0.4);cursor:pointer;transition:all .3s
}
.hero-dot.active{background:#fff;transform:scale(1.3)}
.hero-arrow{
  position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;
  border-radius:50%;background:rgba(0,0,0,0.35);color:#fff;border:none;font-size:22px;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:all .2s;opacity:0;z-index:10
}
.hero-arrow:hover{background:rgba(0,0,0,0.6)}
.hero-arrow.prev{left:14px}
.hero-arrow.next{right:14px}
.hero-section:hover .hero-arrow{opacity:1}
@media(max-width:767px){
  .hero-section{padding:15px 0 10px}
  .hero-slide-overlay h2{font-size:18px}
  .hero-slide-overlay{padding:20px 16px 16px}
  .hero-arrow{width:34px;height:34px;font-size:18px}
}

/* ===== 通用面板 ===== */
.sec-panel{margin-bottom:30px}
.sec-panel-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid var(--divider)
}
.sec-panel-head h2,.sec-panel-head h3{
  font-size:18px;font-weight:600;color:var(--text);
  position:relative;padding-left:14px
}
.sec-panel-head h2::before,.sec-panel-head h3::before{
  content:'';position:absolute;left:0;top:4px;bottom:4px;
  width:3px;background:var(--accent);border-radius:2px
}
.sec-panel-more a{color:var(--text-light);font-size:13px}
.sec-panel-more a:hover{color:var(--accent)}

/* ===== 分类 Tabs ===== */
.tabs-wrap{display:flex;gap:0;flex-wrap:wrap}
.tab-btn{
  padding:8px 18px;font-size:14px;font-weight:500;color:var(--text-light);
  cursor:pointer;transition:all .2s;border-radius:4px 4px 0 0;background:transparent;border:none
}
.tab-btn:hover{color:var(--accent)}
.tab-btn.active{color:var(--accent);background:var(--bg-card);box-shadow:0 -2px 4px rgba(0,0,0,0.04)}
.tab-pane{display:none}
.tab-pane.active{display:block}

/* ===== 内容布局 ===== */
.content-layout{
  display:flex;gap:28px;align-items:flex-start;
  max-width:1200px;margin:0 auto;padding:0 15px
}
.content-main{flex:1;min-width:0}
.content-sidebar{width:300px;flex-shrink:0}
@media(max-width:991px){.content-sidebar{display:none}}

/* ===== 博客卡片网格 ===== */
.post-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:20px
}
.post-card{
  background:var(--bg-card);border-radius:8px;overflow:hidden;
  box-shadow:var(--shadow);transition:all .3s
}
.post-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-hover)}
.post-card .card-img{
  width:100%;aspect-ratio:1/1;overflow:hidden;position:relative;display:block
}
.post-card .card-img img{
  width:100%;height:100%;object-fit:cover;transition:transform .4s
}
.post-card:hover .card-img img{transform:scale(1.06)}
.post-card .card-cat{
  position:absolute;top:12px;left:12px;padding:2px 10px;font-size:11px;font-weight:500;
  background:var(--accent);color:#fff;border-radius:3px;z-index:2
}
.post-card .card-body{padding:14px 16px 12px}
.post-card .card-body .card-title{font-size:15px;font-weight:600;line-height:1.5;margin-bottom:6px}
.post-card .card-body .card-title a{color:var(--text)}
.post-card .card-body .card-title a:hover{color:var(--accent)}
.post-card .card-body .card-desc{
  font-size:13px;color:var(--text-light);line-height:1.6;display:-webkit-box;
  -webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden
}
.post-card .card-meta{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 16px 14px;font-size:12px;color:var(--text-muted);border-top:1px solid var(--divider)
}
@media(max-width:1239px){.post-grid{gap:16px}}
@media(max-width:991px){.post-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:479px){.post-grid{gap:10px}}
@media(max-width:479px){.post-card .card-body{padding:8px 10px 10px}}
@media(max-width:479px){.post-card .card-body .card-title{font-size:13px}}
@media(max-width:479px){.post-card .card-body .card-desc{display:none}}
@media(max-width:479px){.post-card .card-meta{padding:6px 10px 10px;font-size:11px}}

/* ===== 文章列表 ===== */
.post-list{display:flex;flex-direction:column;gap:16px}
.post-list-item{
  background:var(--bg-card);border-radius:8px;box-shadow:var(--shadow);
  overflow:hidden;display:flex;transition:all .3s
}
.post-list-item:hover{box-shadow:var(--shadow-hover)}
.post-list-item .item-img{width:220px;flex-shrink:0;overflow:hidden;position:relative}
.post-list-item .item-img img{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.post-list-item:hover .item-img img{transform:scale(1.06)}
.post-list-item .item-body{padding:16px 20px;flex:1;display:flex;flex-direction:column;justify-content:center}
.post-list-item .item-title{font-size:16px;font-weight:600;margin-bottom:6px}
.post-list-item .item-title a{color:var(--text)}
.post-list-item .item-title a:hover{color:var(--accent)}
.post-list-item .item-desc{font-size:13px;color:var(--text-light);line-height:1.6;margin-bottom:8px}
.post-list-item .item-meta{font-size:12px;color:var(--text-muted);display:flex;gap:16px}
@media(max-width:767px){
  .post-list-item{flex-direction:column}
  .post-list-item .item-img{width:100%;aspect-ratio:16/9}
}

/* ===== 侧边栏 ===== */
.widget{
  background:var(--bg-card);border-radius:8px;box-shadow:var(--shadow);margin-bottom:20px;overflow:hidden;
  transition:background .3s;
  background-image:repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 24px,
    rgba(41,122,244,0.015) 24px,
    rgba(41,122,244,0.015) 25px
  );
}
html.dark-mode .widget{
  background-image:repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 24px,
    rgba(74,140,255,0.025) 24px,
    rgba(74,140,255,0.025) 25px
  );
}
.widget-title{
  padding:14px 16px;font-size:15px;font-weight:600;border-bottom:1px solid var(--divider);color:var(--text)
}
.widget-content{padding:12px 16px}
.widget ul li{
  padding:7px 0;border-bottom:1px solid var(--divider);font-size:13px
}
.widget ul li:last-child{border-bottom:none}
.widget ul li a{color:var(--text-light)}
.widget ul li a:hover{color:var(--accent)}
.widget .contact-widget p{font-size:13px;color:var(--text-light);line-height:1.8}

/* ===== 联系表单 ===== */
.contact-form-section{margin-bottom:30px}
.contact-form-section .form-wrap{
  background:var(--bg-card);border-radius:8px;box-shadow:var(--shadow);
  padding:28px 30px;transition:background .3s
}
.contact-form-section .form-desc{font-size:14px;color:var(--text-light);margin-bottom:20px;line-height:1.6}
.contact-form-section .form-row{display:flex;gap:18px;margin-bottom:16px}
.contact-form-section .form-group{flex:1;min-width:0}
.contact-form-section .form-group label{
  display:block;font-size:13px;font-weight:500;color:var(--text);margin-bottom:5px
}
.contact-form-section .form-group input,
.contact-form-section .form-group select,
.contact-form-section .form-group textarea{
  width:100%;padding:9px 13px;font-size:14px;font-family:inherit;color:var(--text);
  background:var(--input-bg);border:1px solid var(--border);border-radius:5px;outline:none;transition:all .2s
}
.contact-form-section .form-group input:focus,
.contact-form-section .form-group select:focus,
.contact-form-section .form-group textarea:focus{
  border-color:var(--accent);background:var(--bg-card)
}
.contact-form-section .form-group textarea{resize:vertical;min-height:80px}
.contact-form-section .form-submit-row{margin-top:6px}
.contact-form-section .btn-submit{
  display:inline-block;padding:10px 36px;font-size:15px;font-weight:600;
  color:#fff;background:var(--accent);border:none;border-radius:5px;cursor:pointer;transition:background .2s;line-height:1.5
}
.contact-form-section .btn-submit:hover{background:var(--accent-hover)}
.contact-form-section .btn-submit:disabled{opacity:0.6;cursor:not-allowed}
.contact-form-section .form-status{margin-top:10px;padding:10px 16px;border-radius:5px;font-size:14px;display:none}
.contact-form-section .form-status.success{display:block;background:#1b2e1b;color:#6fcf97}
.contact-form-section .form-status.error{display:block;background:#2e1b1b;color:#cf6f6f}
@media(max-width:767px){
  .contact-form-section .form-row{flex-direction:column;gap:12px}
  .contact-form-section .form-wrap{padding:18px 14px}
}

/* ===== CTA ===== */
.cta-section{
  background:var(--cta-bg);color:#fff;padding:48px 0;text-align:center
}
.cta-section h2{font-size:26px;font-weight:700;color:#fff;margin-bottom:8px}
.cta-section p{font-size:15px;opacity:0.85;margin-bottom:22px}
.cta-grid{display:flex;justify-content:center;gap:36px;flex-wrap:wrap}
.cta-item{display:flex;align-items:center;gap:8px;font-size:15px}
.cta-item .icon{font-size:20px}

/* ===== Footer ===== */
.footer{
  background:var(--footer-bg);color:rgba(255,255,255,0.5);
  padding:0;text-align:center;font-size:13px;
  position:relative;
}
/* 顶部多色彩条 — 像印刷校色条 */
.footer::before{
  content:'';display:block;height:4px;
  background:linear-gradient(90deg,
    #297af4 0%,#297af4 20%,
    #e53e3e 20%,#e53e3e 40%,
    #38a169 40%,#38a169 60%,
    #d69e2e 60%,#d69e2e 80%,
    #805ad5 80%,#805ad5 100%
  );
}
html.dark-mode .footer::before{
  background:linear-gradient(90deg,
    #4a8cff 0%,#4a8cff 20%,
    #f56565 20%,#f56565 40%,
    #68d391 40%,#68d391 60%,
    #f6e05e 60%,#f6e05e 80%,
    #b794f4 80%,#b794f4 100%
  );
}
.footer-inner{padding:30px 0}
.footer a{color:rgba(255,255,255,0.65)}
.footer a:hover{color:#fff}

/* ===== 文章详情 ===== */
.post-single{
  background:var(--bg-card);border-radius:8px;box-shadow:var(--shadow);
  padding:28px;margin-bottom:30px;transition:background .3s
}
.post-single .post-meta{font-size:13px;color:var(--text-light);margin-bottom:14px;display:flex;gap:14px;flex-wrap:wrap}
.post-single .post-title{font-size:24px;font-weight:700;margin-bottom:16px;line-height:1.3;color:var(--text)}
.post-single .post-thumb{margin-bottom:20px;border-radius:6px;overflow:hidden}
.post-single .post-content{font-size:15px;line-height:1.8;color:var(--text)}
.post-single .post-content p{margin-bottom:16px}
.post-single .post-content img{border-radius:6px;margin:16px 0}
.post-single .post-tags{margin-top:20px;padding-top:14px;border-top:1px solid var(--divider)}
.post-single .post-tags a{
  display:inline-block;padding:2px 10px;margin:2px 3px;background:var(--tag-bg);
  border-radius:3px;font-size:12px;color:var(--text-light)
}
.post-single .post-tags a:hover{background:var(--accent);color:#fff}
.post-nav{display:flex;justify-content:space-between;margin-top:24px;padding-top:16px;border-top:1px solid var(--divider);font-size:13px}
.post-nav a{color:var(--text-light)}
.post-nav a:hover{color:var(--accent)}

/* ===== 页面 ===== */
.page-single{
  background:var(--bg-card);border-radius:8px;box-shadow:var(--shadow);
  padding:28px;margin-bottom:30px;transition:background .3s
}
.page-single .post-title{font-size:24px;font-weight:700;margin-bottom:16px;color:var(--text)}
.page-single .post-content{font-size:15px;line-height:1.8;color:var(--text)}
.page-single .post-content p{margin-bottom:16px}

/* ===== 响应式 ===== */
@media(max-width:991px){
  .header{height:58px}
}
@media(max-width:767px){
  .menu-toggle{display:block}
  .nav-list{
    display:none;position:absolute;top:58px;left:0;right:0;
    background:var(--header-start);flex-direction:column;padding:8px 0;border-top:1px solid rgba(255,255,255,0.1)
  }
  .nav-list.open{display:flex}
  .nav-list>li>a{padding:10px 20px;border-radius:0}
  .content-layout{flex-direction:column}
  .sec-panel-head h2{font-size:16px}
  .navbar-action{gap:5px}
  .theme-toggle{width:30px;height:30px;font-size:14px}
}
