/* ============================================================
 * Z.C.X.R SYS · DSH 技术档案风（dsh-startup-style 规范重制）
 * 设计令牌 / 版式原则 / 组件库 / 动效 / 遮挡防则
 * 适用于：首页 / 作品集 / 博客 / 工具 / 社区 / 登录 / 详情页
 * ============================================================ */

:root{
  /* 设计令牌：暖白/深黑双主题 + 橙红蓝分工（橙=当前/关键/强调，红=异常/告警/故障，蓝=信息/峰值光晕，其余灰阶） */
  --bg: #e5e3df;
  --bg-panel: #eeece8;
  --bg-invert: #0b0b0c;
  --ink: #222;
  --ink-2: #444;
  --ink-3: #777;
  --line: #d6d2cc;
  --accent: #b5561a;
  --alert: #b0423d;
  --info: #3d6a86;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --card-border: #d6d2cc;
}

*{ box-sizing: border-box; }

html, body{ margin:0; padding:0; }

body{
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(61,106,134,.07), transparent 40%),
    radial-gradient(circle at 88% 84%, rgba(181,86,26,.06), transparent 42%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.7;
}

/* ---------- 中央走廊：两侧发丝装饰带（不进入中央 60%） ---------- */
body::before, body::after{
  content: "";
  position: fixed; top:0; bottom:0; width: 1px;
  background: var(--line);
  z-index: 2; opacity:.85; pointer-events: none;
}
body::before{ left: 9%; }
body::after{ right: 9%; }

/* ---------- 装饰层（四角环形准星 / 十字定位 / 等宽角标 / 顶部扫描线） ---------- */
.deco{ position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.deco .scanline{
  position: absolute; left:0; right:0; top:0; height: 3px; z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(181,86,26,.38), transparent);
  animation: scan 8s linear infinite;
  opacity: .9;
}

.deco .ring{
  position: absolute; width: 54px; height: 54px;
  border: 1px solid var(--ink-3); border-radius: 50%; opacity: .42;
}
.deco .ring::before,
.deco .ring::after{
  content:""; position: absolute; background: var(--ink-3); opacity:.55;
}
.deco .ring::before{ left:50%; top:-7px; width:1px; height: calc(100% + 14px); }
.deco .ring::after{ top:50%; left:-7px; height:1px; width: calc(100% + 14px); }
.deco .ring-tl{ left:14px; top:14px; }
.deco .ring-tr{ right:14px; top:14px; }
.deco .ring-bl{ left:14px; bottom:14px; }
.deco .ring-br{ right:14px; bottom:14px; }

.deco .cross{ position: absolute; background: var(--line); }
.deco .cross-tl{ left:20px; top:0; width:1px; height:96px; }
.deco .cross-tr{ right:20px; top:0; width:1px; height:96px; }
.deco .cross-bl{ left:20px; bottom:0; width:1px; height:96px; }
.deco .cross-br{ right:20px; bottom:0; width:1px; height:96px; }

.deco .code-tag{
  position: absolute; font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; color: var(--ink-3); white-space: nowrap;
}
.deco .code-tag i{ font-style: normal; color: var(--accent); }
.deco .code-tl{ left:24px; top:84px; writing-mode: vertical-rl; }
.deco .code-tr{ right:24px; top:84px; writing-mode: vertical-rl; }
.deco .code-bl{ left:24px; bottom:84px; writing-mode: vertical-rl; }
.deco .code-br{ right:24px; bottom:84px; writing-mode: vertical-rl; }

/* ---------- 顶部导航（深黑反色块） ---------- */
.nav{
  position: relative; z-index: 4;
  background: var(--bg-invert); color: #f2efe9;
}
.nav::after{
  content:""; display:block; height:2px;
  background: linear-gradient(90deg, var(--accent) 0 110px, var(--line) 110px);
}
.nav-inner{
  max-width: 1120px; margin:0 auto;
  display: flex; align-items: center; gap: 26px;
  padding: 14px 22px; flex-wrap: wrap;
}
.nav-brand{
  font-family: var(--mono); font-size: 14px; letter-spacing: .06em; color: #f2efe9;
}
.nav-brand::before{ content: "◈ "; color: var(--accent); }
.nav-links{ display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a{
  color: #cfcbc2; text-decoration: none; font-size: 14px;
  padding: 6px 12px; border: 1px solid transparent; transition: .18s;
}
.nav-links a:hover{ color:#fff; border-color: var(--ink-3); }
.nav-links a.active{
  color: var(--accent); border-color: var(--accent);
  background: rgba(181,86,26,.1);
}
.nav-user{ margin-left: auto; display:flex; align-items:center; gap:10px; font-size:13px; color:#cfcbc2; flex-wrap:wrap; }
.nav-user a{ color:#f2efe9; text-decoration:none; }
.nav-user b{ color: var(--accent); }

/* ---------- 按钮（过曝洗白 / 扫光） ---------- */
.btn{
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  padding: 9px 18px; position: relative; overflow: hidden;
  transition: color .15s, border-color .15s, background .15s;
}
.btn::after{
  content:""; position:absolute; top:0; left:-130%; width:55%; height:100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); transition: left .55s;
}
.btn:hover{ color:#fff; background: var(--ink); border-color: var(--ink); box-shadow: 0 0 16px rgba(34,34,34,.35); }
.btn:hover::after{ left: 140%; }
.btn:active{
  color: var(--ink); background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 24px #fff;
  transform: translateY(1px);
}
.btn.ghost{ border-color: var(--ink-3); color: var(--ink-2); }
.btn.ghost:hover{ background: var(--ink-3); border-color: var(--ink-3); color:#fff; }
.btn.danger{ border-color: var(--alert); color: var(--alert); }
.btn.danger:hover{ background: var(--alert); border-color: var(--alert); color:#fff; }
.btn.small{ padding: 5px 10px; font-size: 12px; }
.btn.full{ width: 100%; }

/* ---------- 通用容器 ---------- */
.container{ max-width: 760px; margin: 0 auto; padding: 0 22px; position: relative; z-index: 4; }
main > .container, main.container{ animation: reveal .6s ease both; }

/* ---------- 首页 hero ---------- */
.hero{ position: relative; z-index: 4; padding: 84px 0 54px; }
.k-tag{
  display: inline-block; font-family: var(--mono); font-size: 12px;
  color: var(--accent); border: 1px solid var(--accent);
  padding: 3px 8px; letter-spacing: .1em; margin-bottom: 12px;
  transition: .15s;
}
.k-tag:hover{ animation: glitch .5s steps(2) infinite; }
.mono-sub{
  display: block; font-family: var(--mono); font-size: 12px;
  color: var(--ink-3); letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 14px;
}
.mono-sub::after{ content: "▍"; color: var(--accent); animation: blink 1.2s steps(2) infinite; }

.hero-badge{
  display: inline-block; font-family: var(--mono); font-size: 12px;
  letter-spacing: .38em; color: #f2efe9; background: var(--bg-invert);
  padding: 8px 16px; position: relative;
  text-shadow: -1px 0 var(--alert), 1px 0 var(--info);
  animation: glitch 6s steps(2) infinite;
}
.hero h1{
  font-size: 38px; line-height: 1.32; margin: 26px 0 18px; letter-spacing: .01em;
  background: linear-gradient(90deg, var(--ink) 0, var(--ink) 50%, var(--ink-3) 50.4%, var(--ink-3) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: typefill 1.2s .2s cubic-bezier(.2,.8,.2,1) both;
}
.hero h1::after{ content: "▍"; color: var(--accent); animation: blink 1.2s steps(2) infinite; }
.hero p{ color: var(--ink-2); max-width: 560px; margin: 0; }

/* ---------- 板块入口卡片 ---------- */
.section-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 6px; }
.sec-card{
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-panel); border: 1px solid var(--line);
  padding: 26px 22px; position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.sec-card::before{
  content:""; position:absolute; inset:0;
  background: linear-gradient(100deg, transparent, rgba(181,86,26,.14), transparent);
  transform: translateX(-130%); transition: transform .5s;
}
.sec-card:hover{ transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(34,34,34,.12); }
.sec-card:hover::before{ transform: translateX(130%); }
.sec-card::after{ content:""; position:absolute; top:0; right:0; width:16px; height:2px; background: var(--accent); }
.sec-card .icon{ font-size: 26px; display: block; margin-bottom: 10px; }
.sec-card h3{ margin: 0 0 6px; font-size: 17px; }
.sec-card p{ margin: 0; font-size: 13px; color: var(--ink-2); }

/* ---------- 页头（各板块） ---------- */
.page-head{
  position: relative; z-index: 4; padding: 58px 0 28px;
  border-bottom: 1px solid var(--line); margin-bottom: 30px;
}
.page-head h1{ margin: 4px 0 6px; font-size: 30px; }
.page-head p{ margin: 0; color: var(--ink-2); }

/* ---------- 博客 ---------- */
.blog-list{ display: flex; flex-direction: column; gap: 14px; }
.post-item{
  background: var(--bg-panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); padding: 20px 22px; cursor: pointer;
  transition: .18s; position: relative;
}
.post-item:hover{ border-color: var(--accent); transform: translateX(3px); box-shadow: 0 6px 18px rgba(34,34,34,.08); }
.post-item h3{ margin: 0 0 6px; font-size: 18px; }
.post-meta{ font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.post-excerpt{ margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.news{ color: var(--ink-3); font-family: var(--mono); font-size: 13px; }
.news a{ color: var(--info); }

.article{ max-width: 760px; }
.article-back{ font-family: var(--mono); font-size: 13px; color: var(--info); text-decoration: none; }
.article-back:hover{ color: var(--accent); }
.article h1{ font-size: 28px; line-height: 1.35; margin: 14px 0 8px; }
.content{ margin-top: 14px; }
.content p{ margin: 0 0 16px; color: var(--ink); }

/* ---------- 作品集 ---------- */
.pf-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.pf-card{ background: var(--bg-panel); border: 1px solid var(--line); overflow: hidden; transition: .18s; }
.pf-card:hover{ border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 26px rgba(34,34,34,.12); }
.pf-cover{
  height: 112px; display: flex; align-items: center; justify-content: center; font-size: 40px;
  position: relative; color: #fff;
}
.pf-cover::after{
  content: "DISH//ARCHIVE"; position: absolute; right: 10px; bottom: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: rgba(255,255,255,.85);
}
.pf-body{ padding: 16px 18px; }
.pf-body h3{ margin: 0 0 6px; font-size: 16px; }
.pf-body p{ margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.tags{ display: flex; flex-wrap: wrap; gap: 6px; }
.tag{ font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); padding: 2px 8px; color: var(--ink-2); }

/* ---------- 工具 ---------- */
.tools-wrap{ display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.tool-panel{
  background: var(--bg-panel); border: 1px solid var(--line); padding: 26px 24px;
  position: relative; overflow: hidden;
}
.tool-panel::before{
  content: "TOOL"; position: absolute; top: 0; right: 0;
  background: var(--bg-invert); color: var(--accent);
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; padding: 3px 8px;
}
.tool-panel h2{ margin: 0 0 2px; font-size: 18px; }
.sub{ font-family: var(--mono); font-size: 12px; color: var(--ink-3); display: block; margin-bottom: 16px; }
.field{ margin-bottom: 14px; }
.field label{ display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field label b{ color: var(--accent); }
input[type="text"], input[type="password"], textarea{
  width: 100%; background: #f4f2ee; border: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: 14px;
  padding: 9px 12px; outline: none; border-radius: 0;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus{
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(181,86,26,.14);
}
textarea{ resize: vertical; min-height: 96px; }
input[type="range"]{ accent-color: var(--accent); width: 100%; }
.row{ display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tool-result{ margin-top: 16px; font-family: var(--mono); font-size: 15px; color: var(--ink); min-height: 26px; }
.big{
  font-family: var(--mono); font-size: 52px; color: var(--accent);
  letter-spacing: .06em; text-shadow: 0 0 18px rgba(181,86,26,.35);
  line-height: 1.2;
}

/* ---------- 卡片（编辑器 / 表单 / 回复框） ---------- */
.card{
  background: var(--bg-panel); border: 1px solid var(--line); padding: 24px;
  position: relative;
}
.card::before{ content:""; position:absolute; top:0; left:0; width: 38px; height: 3px; background: var(--accent); }

/* ---------- 社区 ---------- */
.topic-item{
  background: var(--bg-panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); padding: 18px 20px; cursor: pointer;
  margin-bottom: 14px; transition: .18s;
}
.topic-item:hover{ border-color: var(--accent); transform: translateX(3px); }
.topic-item h3{ margin: 0 0 6px; font-size: 17px; }
.topic-item p{ margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.topic-stats{ display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.reply{ border-left: 3px solid var(--line); padding: 12px 16px; margin-bottom: 12px; background: var(--bg-panel); }
.reply .meta{ font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.reply .meta button{ margin-left: 8px; }
.reply .body{ font-size: 14px; color: var(--ink); }
.sub-title{
  font-size: 14px; font-weight: 700; color: var(--ink);
  margin: 22px 0 10px; position: relative; padding-left: 12px;
}
.sub-title::before{
  content:""; position: absolute; left:0; top:50%; transform: translateY(-50%);
  width: 5px; height: 14px; background: var(--accent);
}

/* ---------- 登录 / 注册 ---------- */
.auth-wrap{ max-width: 520px; padding-top: 48px; }
.auth-tabs{ display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tabs button{
  font-family: var(--mono); font-size: 13px; padding: 9px 22px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: .15s;
}
.auth-tabs button.active{ border-color: var(--accent); color: var(--accent); background: rgba(181,86,26,.06); }
.auth-form .field{ margin-bottom: 16px; }
.hint{ font-size: 12px; color: var(--ink-3); margin-top: 14px; line-height: 1.8; }

/* ---------- 消息条 ---------- */
#toast{
  position: fixed; left: 50%; bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--bg-invert); color: #f2efe9;
  font-family: var(--mono); font-size: 13px;
  padding: 12px 20px; border: 1px solid var(--card-border);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 99;
}
#toast.show{ opacity: 1; transform: translate(-50%, 0); }

/* ---------- 页脚（深黑反色块） ---------- */
.footer{
  margin-top: 76px; background: var(--bg-invert); color: #8a877f;
  text-align: center; font-family: var(--mono); font-size: 12px;
  letter-spacing: .12em; padding: 18px 14px;
  border-top: 2px solid var(--accent);
}

/* ---------- 动效 ---------- */
@keyframes blink{ 50%{ opacity: 0; } }
@keyframes scan{ 0%{ transform: translateY(-12vh); } 100%{ transform: translateY(112vh); } }
@keyframes reveal{
  from{ opacity:0; transform: translateY(14px); filter: blur(4px); }
  to{ opacity:1; transform: none; filter: none; }
}
@keyframes typefill{
  from{ background-position: 100% 0; }
  to{ background-position: 0 0; }
}
@keyframes glitch{
  0%, 100%{ transform:none; text-shadow: -1px 0 var(--alert), 1px 0 var(--info); }
  90%{ transform:none; text-shadow: -1px 0 var(--alert), 1px 0 var(--info); }
  92%{ transform: translate(-1px,1px); text-shadow: 2px 0 var(--alert), -2px 0 var(--info); }
  94%{ transform: translate(1px,-1px); text-shadow: -2px 0 var(--alert), 2px 0 var(--info); }
  96%{ transform: none; text-shadow: -1px 0 var(--alert), 1px 0 var(--info); }
}

/* ---------- 遮挡防则：移动端收起四角装饰，只留中央走廊 ---------- */
@media (max-width: 760px){
  body::before, body::after{ display: none; }
  .deco .ring, .deco .cross, .deco .code-tag{ display: none; }
  .hero h1{ font-size: 28px; }
  .nav-inner{ gap: 12px; }
}
