/* ============================================================
   94CTO 全站样式
   适用于：content.phtml（文章页） / reg.phtml（注册页）
   ============================================================ */

/* ---------- 变量 ---------- */
:root{
  --brand:#2096f3;
  --brand-dark:#1577cc;
  --brand-soft:#eaf4fe;
  --text:#1f2329;
  --text-2:#5c6570;
  --text-3:#8b949e;
  --line:#e8eaed;
  --bg:#f5f6f8;
  --card:#ffffff;
  --radius:12px;
  --header-h:64px;
  --shadow:0 1px 3px rgba(16,24,40,.06), 0 8px 24px -12px rgba(16,24,40,.14);
}

/* ---------- Reset ---------- */
*,*::before,*::after{box-sizing:border-box;}
html,body{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd{margin:0;}
ul,ol{list-style:none;margin:0;padding:0;}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;border:0;}
button,input,textarea,select{font-family:inherit;font-size:inherit;color:inherit;}
button{border:0;background:none;cursor:pointer;}
table{border-collapse:collapse;width:100%;}
th,td{border:1px solid #ddd;padding:6px 8px;}
tr:nth-child(odd){background-color:#f7f8fa;}

/* ---------- 基础 ---------- */
body{
  font-family:"Segoe UI","Open Sans","Microsoft YaHei",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
  font-size:15px;
  line-height:1.75;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.wrap{
  width:100%;
  max-width:1100px;
  margin:0 auto;
  padding:0 20px;
}

/* ============================================================
   顶部导航
   ============================================================ */
.header{
  position:sticky;
  top:0;
  z-index:100;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.header .wrap{
  display:flex;
  align-items:center;
  gap:24px;
  min-height:var(--header-h);
}

/* Logo */
.logo{
  flex:none;
  font-family:Arial,"Helvetica Neue",sans-serif;
  font-size:24px;
  font-weight:800;
  letter-spacing:2px;
  text-transform:uppercase;
  background:linear-gradient(90deg,#FF5722,#FFC107);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  color:transparent;
  white-space:nowrap;
}
.logo .highlight{
  -webkit-text-fill-color:var(--brand);
  color:var(--brand);
  font-style:italic;
}

/* 搜索框 */
.searchbar{
  position:relative;
  flex:1 1 auto;
  max-width:400px;
}
.searchbar input[type="text"]{
  width:100%;
  height:38px;
  padding:0 44px 0 14px;
  border:1px solid var(--line);
  background:#f7f8fa;
  border-radius:19px;
  font-size:14px;
  outline:none;
  transition:border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance:none;
  appearance:none;
}
.searchbar input[type="text"]::placeholder{color:#a8b0ba;}
.searchbar input[type="text"]:hover{border-color:#d6dbe1;}
.searchbar input[type="text"]:focus{
  background:#fff;
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(32,150,243,.12);
}
.searchbar button{
  position:absolute;
  right:4px;
  top:4px;
  width:30px;
  height:30px;
  border-radius:50%;
  background:var(--brand);
  color:#fff;
  font-size:14px;
  line-height:1;
  display:grid;
  place-items:center;
  transition:background .2s;
}
.searchbar button:hover{background:var(--brand-dark);}

/* 导航链接 */
.nav{
  display:flex;
  align-items:center;
  gap:2px;
  margin-left:auto;
}
.nav a{
  padding:8px 12px;
  font-size:14px;
  color:var(--text-2);
  border-radius:8px;
  white-space:nowrap;
  transition:color .2s, background .2s;
}
.nav a:hover{
  color:var(--brand);
  background:var(--brand-soft);
}
.nav a.accent{
  color:var(--brand);
  font-weight:600;
}
.nav a.user{
  color:var(--brand);
  font-weight:600;
  max-width:120px;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* 移动端汉堡按钮 */
.menu-toggle{
  display:none;
  width:38px;
  height:38px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  margin-left:auto;
  padding:9px 8px;
  flex-direction:column;
  justify-content:space-between;
}
.menu-toggle span{
  display:block;
  height:2px;
  background:var(--text-2);
  border-radius:2px;
  transition:transform .25s, opacity .25s;
}
.menu-toggle.open span:nth-child(1){transform:translateY(7px) rotate(45deg);}
.menu-toggle.open span:nth-child(2){opacity:0;}
.menu-toggle.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

/* ============================================================
   通用内容容器
   ============================================================ */
.content{
  padding:32px 0 0;
}

/* ============================================================
   文章页（content.phtml）
   ============================================================ */
.single-page{
  max-width:860px;
  margin:0 auto;
  padding:0 20px;
}
.single-page .cover{
  width:100%;
  max-height:400px;
  object-fit:cover;
  border-radius:var(--radius) var(--radius) 0 0;
  background:#eceff3;
}

.artical-content{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:32px;
}
.single-page .cover + .artical-content{
  border-top-left-radius:0;
  border-top-right-radius:0;
}

.artical-content h1{
  font-size:28px;
  line-height:1.35;
  font-weight:700;
  letter-spacing:-.2px;
  color:var(--text);
  margin:0 0 12px;
}

.artical-meta{
  display:flex;
  flex-wrap:wrap;
  gap:18px;
  padding-bottom:20px;
  margin-bottom:22px;
  border-bottom:1px solid var(--line);
  font-size:13px;
  color:var(--text-3);
}
.artical-meta span{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

/* 操作按钮 */
.action-box{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:0 0 26px;
}
.action-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:12px 22px;
  border-radius:10px;
  font-size:15px;
  font-weight:600;
  line-height:1.4;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  transition:transform .15s, box-shadow .2s, background .2s, border-color .2s, color .2s;
}
.action-btn:hover{
  border-color:var(--brand);
  color:var(--brand);
  box-shadow:0 4px 14px -6px rgba(32,150,243,.4);
  transform:translateY(-1px);
}
.action-btn:active{transform:translateY(0);}
.action-btn.primary{
  background:linear-gradient(135deg,#2096f3,#1577cc);
  border-color:transparent;
  color:#fff;
  box-shadow:0 6px 18px -8px rgba(32,150,243,.75);
}
.action-btn.primary:hover{
  color:#fff;
  background:linear-gradient(135deg,#1a86e0,#0f66b8);
  box-shadow:0 8px 22px -8px rgba(32,150,243,.85);
}
.action-btn .ico{font-size:14px;line-height:1;}

/* 正文富文本 */
.article-body{
  font-size:16px;
  line-height:1.95;
  color:var(--text-2);
  word-wrap:break-word;
  overflow-wrap:break-word;
}
.article-body p{margin:0 0 1.1em;}
.article-body h2,
.article-body h3,
.article-body h4{
  color:var(--text);
  font-weight:700;
  line-height:1.4;
  margin:1.8em 0 .8em;
}
.article-body h2{font-size:22px;}
.article-body h3{font-size:19px;}
.article-body h4{font-size:17px;}
.article-body a{
  color:var(--brand);
  text-decoration:underline;
  text-underline-offset:3px;
}
.article-body a:hover{color:var(--brand-dark);}
.article-body ul,
.article-body ol{
  margin:0 0 1.1em;
  padding-left:1.5em;
}
.article-body ul{list-style:disc;}
.article-body ol{list-style:decimal;}
.article-body li{margin:.3em 0;}
.article-body img{
  margin:1.2em auto;
  border-radius:8px;
  height:auto;
}
.article-body blockquote{
  margin:1.2em 0;
  padding:12px 18px;
  border-left:3px solid var(--brand);
  background:var(--brand-soft);
  border-radius:0 8px 8px 0;
  color:var(--text-2);
}
.article-body code{
  background:#f0f2f5;
  padding:2px 6px;
  border-radius:4px;
  font-family:Consolas,Monaco,"Courier New",monospace;
  font-size:14px;
  color:#c7254e;
}
.article-body pre{
  background:#1e222a;
  color:#e6edf3;
  padding:16px 18px;
  border-radius:10px;
  overflow-x:auto;
  margin:1.2em 0;
  font-size:14px;
  line-height:1.7;
}
.article-body pre code{
  background:none;
  padding:0;
  color:inherit;
  font-size:inherit;
}
.article-body table{
  margin:1.2em 0;
  font-size:14px;
}
.article-body th{
  background:#f5f6f8;
  font-weight:600;
  text-align:left;
}
.article-body th,
.article-body td{border-color:var(--line);}

/* ============================================================
   注册 / 登录 认证页（reg.phtml / login.phtml 通用）
   ============================================================ */
.auth-page{
  width:80%;
  margin:0 auto;
  padding:0 20px;
}
.auth-card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:36px 36px 32px;
}

.auth-head{
  text-align:center;
  margin-bottom:28px;
}
.auth-head h1{
  font-size:24px;
  font-weight:700;
  color:var(--text);
  margin:0 0 8px;
}
.auth-head p{
  font-size:14px;
  color:var(--text-3);
  margin:0;
}

/* 表单 */
.auth-form .form-row{
  margin-bottom:18px;
}
.auth-form .form-row label{
  display:block;
  font-size:13px;
  font-weight:600;
  color:var(--text-2);
  margin-bottom:6px;
}
.auth-form .form-row input{
  width:100%;
  height:44px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fafbfc;
  font-size:15px;
  outline:none;
  transition:border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance:none;
  appearance:none;
}
.auth-form .form-row input::placeholder{color:#a8b0ba;}
.auth-form .form-row input:hover{border-color:#d6dbe1;}
.auth-form .form-row input:focus{
  background:#fff;
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(32,150,243,.14);
}

/* 主按钮 */
.btn-submit{
  width:100%;
  height:46px;
  margin-top:6px;
  border-radius:10px;
  background:linear-gradient(135deg,#2096f3,#1577cc);
  color:#fff;
  font-size:16px;
  font-weight:600;
  letter-spacing:2px;
  cursor:pointer;
  transition:background .2s, box-shadow .2s, transform .15s;
  box-shadow:0 6px 18px -8px rgba(32,150,243,.75);
}
.btn-submit:hover{
  background:linear-gradient(135deg,#1a86e0,#0f66b8);
  box-shadow:0 8px 22px -8px rgba(32,150,243,.85);
}
.btn-submit:active{transform:translateY(1px);}

/* 次按钮（跳转登录） */
.btn-ghost{
  display:block;
  width:100%;
  height:44px;
  line-height:42px;
  margin-top:12px;
  text-align:center;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text-2);
  font-size:15px;
  transition:border-color .2s, color .2s, background .2s;
}
.btn-ghost:hover{
  border-color:var(--brand);
  color:var(--brand);
  background:var(--brand-soft);
}

/* 底部提示 */
.notice-list{
  margin-top:26px;
  padding-top:20px;
  border-top:1px dashed var(--line);
}
.notice{
  font-size:12.5px;
  line-height:1.75;
  color:var(--text-3);
  margin:0 0 6px;
}
.notice:last-child{margin-bottom:0;}
.notice.is-blue{color:var(--brand);}
.notice a{
  color:var(--brand);
  text-decoration:underline;
  text-underline-offset:2px;
}
.notice a:hover{color:var(--brand-dark);}

/* ============================================================
   页脚
   ============================================================ */
.footer{
  max-width:860px;
  margin:24px auto 40px;
  padding:0 20px;
  text-align:center;
  font-size:13px;
  color:var(--text-3);
}

/* ============================================================
   响应式
   ============================================================ */

/* 中屏 —— 平板 */
@media (max-width:860px){
  .content{padding-top:24px;}
  .artical-content{padding:22px 20px 28px;}
  .artical-content h1{font-size:22px;}
  .article-body{font-size:15px;line-height:1.85;}
  .single-page .cover{max-height:280px;}
  .action-btn{padding:11px 18px;font-size:14px;}
  .auth-card{padding:28px 24px 26px;}
}

/* 小屏 —— 手机 */
@media (max-width:680px){
  /* 顶部导航折叠 */
  .header .wrap{
    flex-wrap:wrap;
    gap:12px;
    padding:10px 16px;
    min-height:auto;
  }
  .logo{font-size:20px;letter-spacing:1px;}
  .menu-toggle{display:flex;}

  .searchbar{
    order:4;
    flex:1 1 100%;
    max-width:none;
    margin-bottom:6px;
  }

  .nav{
    order:5;
    display:none;
    flex:1 1 100%;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    margin:0;
    padding-top:8px;
    border-top:1px solid var(--line);
  }
  .nav.open{display:flex;}
  .nav a{
    padding:11px 4px;
    border-radius:0;
    font-size:15px;
  }
  .nav a:hover{background:transparent;color:var(--brand);}

  /* 文章页 */
  .content{padding-top:16px;}
  .single-page{padding:0 16px;}
  .single-page .cover{max-height:200px;}
  .artical-content{padding:20px 16px 24px;}
  .artical-content h1{font-size:20px;line-height:1.4;}
  .artical-meta{gap:12px;font-size:12px;padding-bottom:16px;margin-bottom:18px;}
  .action-box{flex-direction:column;gap:10px;}
  .action-btn{width:100%;justify-content:center;}
  .article-body{font-size:15px;line-height:1.8;}
  .article-body pre{font-size:13px;padding:14px;}

  /* 注册页 */
  .auth-page{padding:0 16px;}
  .auth-card{padding:24px 20px 22px;}
  .auth-head h1{font-size:21px;}
  .auth-head{margin-bottom:22px;}
  .auth-form .form-row input{height:42px;}
  .btn-submit{height:44px;font-size:15px;}
  .btn-ghost{height:42px;line-height:40px;font-size:14px;}
  .notice{font-size:12px;}

  /* 页脚 */
  .footer{margin:16px auto 28px;font-size:12px;}
}

/* 超小屏 */
@media (max-width:380px){
  .logo{font-size:18px;letter-spacing:0;}
  .artical-content h1{font-size:18px;}
  .action-btn{padding:10px 14px;font-size:13px;}
  .auth-head h1{font-size:19px;}
}
