:root{
  --bg:#f5f7fa; --panel:#ffffff; --ink:#1f2937; --muted:#6b7280;
  --brand:#0f4c81; --brand2:#1469b8; --line:#e5e7eb;
  --shadow:0 1px 3px rgba(15,23,42,.08); --radius:10px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:"Microsoft YaHei","PingFang SC","Noto Sans SC",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--ink);line-height:1.7}
a{color:var(--brand2);text-decoration:none}
a:hover{text-decoration:underline}

/* 登录页 */
.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:16px;background:linear-gradient(rgba(7,35,63,.42),rgba(7,35,63,.58)),url('../img/SHANGHAI.jpg') center/cover no-repeat fixed}
.login-card{background:var(--panel);border-radius:14px;box-shadow:0 10px 30px rgba(0,0,0,.18);padding:36px 32px;width:100%;max-width:400px}
.brand{text-align:center;margin-bottom:24px}
.brand-logo{width:56px;height:56px;border-radius:14px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:22px;margin:0 auto 12px}
.brand h1{font-size:20px;margin:0 0 4px}
.brand p{color:var(--muted);margin:0;font-size:13px}
.login-card form{display:flex;flex-direction:column;gap:10px}
.login-card label{font-size:14px;color:var(--muted)}
input[type=password],input[type=text]{padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:15px;outline:none;width:100%}
input:focus{border-color:var(--brand2);box-shadow:0 0 0 3px rgba(20,105,184,.15)}
button[type=submit]{background:var(--brand2);color:#fff;border:0;padding:11px 16px;border-radius:8px;font-size:15px;cursor:pointer}
button[type=submit]:hover{background:var(--brand)}
button[type=submit]:disabled{opacity:.6;cursor:default}
.btn{background:var(--brand2);color:#fff;border:0;padding:8px 16px;border-radius:8px;font-size:14px;cursor:pointer}
.btn:hover{background:var(--brand)}
.btn.ghost{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.6);padding:6px 12px;font-size:13px;border-radius:20px}
.login-note{text-align:center;color:var(--muted);font-size:12px;margin-top:16px}
.notice{padding:10px 14px;border-radius:8px;font-size:14px;background:#eef6ff;border:1px solid #cfe3fb}
.notice h2{margin-top:0}
.notice.error{background:#fdecec;border-color:#f5c2c2;color:#b91c1c}

/* 顶栏 */
.topbar{background:var(--brand);color:#fff;position:sticky;top:0;z-index:50;box-shadow:0 1px 6px rgba(0,0,0,.15)}
.topbar-inner{max-width:1280px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;gap:12px}
.brand-mini{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none}
.brand-logo.small{width:32px;height:32px;font-size:14px;border-radius:9px;margin:0}
.icon-btn{background:none;border:0;color:#fff;font-size:22px;cursor:pointer;display:none}
.contact-link{color:#fff;font-size:13px;text-decoration:none;white-space:nowrap;display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border:1px solid rgba(255,255,255,.5);border-radius:18px}
.contact-link:hover{background:rgba(255,255,255,.16);text-decoration:none}

/* 顶栏第二行导航 */
.topnav{background:#0c3d68;border-top:1px solid rgba(255,255,255,.12)}
.topnav-inner{max-width:1280px;margin:0 auto;display:flex;gap:2px;padding:0 16px;overflow:visible}
.nav-item{position:relative}
.nav-btn{background:none;border:0;color:#dcebfa;font-size:14px;padding:10px 18px;cursor:pointer;white-space:nowrap}
.nav-btn:hover,.nav-item.open .nav-btn{background:rgba(255,255,255,.12);color:#fff}
.nav-drop{display:none;position:absolute;top:100%;left:0;min-width:210px;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 24px rgba(0,0,0,.18);padding:6px;text-align:left;z-index:300}
.nav-item:hover .nav-drop,.nav-item.open .nav-drop{display:block}
.dev-note{padding:14px 16px;color:var(--muted);font-size:13px;text-align:left;white-space:nowrap}
.nav-tree,.nav-sub{list-style:none;margin:0;padding:0}
#handbook-volumes{min-width:210px}
.nav-std-list li a{display:block;padding:8px 14px;font-size:13.5px;color:var(--ink);border-radius:6px;white-space:nowrap}
.nav-std-list li a:hover{background:#eef6ff;color:var(--brand2);text-decoration:none}
.nav-std-list li a.active{background:var(--brand2);color:#fff}
.nav-sub-parent{position:relative}
.nav-sub-title{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:8px 14px;color:var(--ink);font-size:13.5px;border-radius:6px;white-space:nowrap;text-align:left}
.nav-sub-title:after{content:"▶";font-size:10px;color:#9db8d1}
.nav-sub-title{cursor:pointer}
.nav-sub-parent:hover>.nav-sub-title,.nav-sub-parent.open>.nav-sub-title{background:#eef6ff;color:var(--brand2)}
.nav-tree .nav-sub,.nav-sub .nav-sub{display:none;position:absolute;top:0;left:100%;min-width:230px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 24px rgba(0,0,0,.18);padding:6px}
.nav-files{max-width:min(72vw,440px);max-height:min(60vh,calc(100vh - 260px));overflow-y:auto;overflow-x:hidden}
.nav-sub-parent:hover>.nav-sub,.nav-sub-parent.open>.nav-sub{display:block}
.nav-sub a{display:block;padding:7px 12px;font-size:13px;color:var(--ink);border-radius:6px;white-space:normal;word-break:break-all;line-height:1.45;text-align:left}
.nav-sub a:hover{background:#eef6ff;color:var(--brand2);text-decoration:none}
.nav-tree > li > a{display:block;padding:8px 14px;font-size:13px;color:var(--ink);border-radius:6px;white-space:normal;word-break:break-all;line-height:1.45;text-align:left}
.nav-tree > li > a:hover{background:#eef6ff;color:var(--brand2);text-decoration:none}

/* 布局 */
.layout{max-width:1280px;margin:0 auto;display:grid;grid-template-columns:300px 1fr;gap:20px;padding:20px 16px}
.sidebar{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow);align-self:start;position:sticky;top:140px;max-height:calc(100vh - 160px);overflow:auto}
.sidebar ul{list-style:none;margin:0;padding:0}
.vol-title{font-weight:700;font-size:14px;color:var(--brand);margin:14px 0 6px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.sidebar a{display:block;padding:5px 8px;border-radius:6px;font-size:13.5px;color:var(--ink)}
.sidebar a:hover{background:#eef6ff;text-decoration:none;color:var(--brand2)}
.sidebar a.active{background:var(--brand2);color:#fff}
.main{min-width:0}
.content{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:28px 32px;box-shadow:var(--shadow)}
.content.loading{color:var(--muted);text-align:center}
.content h1.doc-title{font-size:26px;color:var(--brand);margin:0 0 8px;padding-bottom:12px;border-bottom:2px solid var(--brand)}
.content h2{font-size:20px;color:var(--brand);margin:28px 0 10px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.content h3{font-size:17px;color:#164e8c;margin:20px 0 8px}
.content h4{font-size:15px;margin:16px 0 6px}
.content p{margin:8px 0}
.content p.list-item{padding-left:22px;position:relative}
.content p.list-item:before{content:"•";position:absolute;left:6px;color:var(--brand2)}
.content img{max-width:100%;height:auto;display:block;margin:10px 0}
.content table{border-collapse:collapse;width:100%;margin:12px 0;font-size:14px}
.content td,.content th{border:1px solid #cbd5e1;padding:7px 10px;text-align:left;vertical-align:top}
.content th{background:#eef4fb;color:var(--brand)}
.content td p{margin:2px 0}
.table-wrap{overflow-x:auto}

/* 目录 */
.toc{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:12px 16px;margin-bottom:14px;box-shadow:var(--shadow);font-size:14px}
.toc h4{margin:0 0 6px;color:var(--brand)}
.toc ul.toc-list{margin:0;padding-left:0;list-style:none}
.toc ul.toc-list li{padding:2px 0}
.toc ul.toc-list li.toc-l3{padding-left:22px}
.toc a{color:var(--brand2)}

/* 首页卡片 */
.hero{background:linear-gradient(135deg,#0f4c81,#1469b8);color:#fff;border-radius:var(--radius);padding:28px;margin-bottom:20px}
.hero h2{margin:0 0 8px;color:#fff;border:0}
.hero p{margin:0;opacity:.92}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:14px 0}
.card{background:#f8fafc;border:1px solid var(--line);border-radius:var(--radius);padding:16px}
.card h3{margin:0 0 6px;color:var(--brand)}

/* 回到顶部 */
#back-top{position:fixed;right:22px;bottom:22px;width:42px;height:42px;border-radius:50%;background:var(--brand2);color:#fff;border:0;font-size:20px;cursor:pointer;box-shadow:var(--shadow);display:none}

@media (max-width:900px){
  .layout{grid-template-columns:1fr;padding:12px}
  .sidebar{position:static;max-height:none;display:none}
  .sidebar.open{display:block}
  .icon-btn{display:inline-block}
  .content{padding:18px 16px}
}
@media (max-width:900px){
  .topnav-inner{overflow-x:auto}
}
/* 下载栏 */
.download-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#eef6ff;border:1px solid #cfe3fb;border-radius:8px;padding:10px 14px;margin-bottom:16px;font-size:14px}
.download-bar .btn{white-space:nowrap}

/* 下载密码弹窗 */
.dl-overlay{position:fixed;inset:0;background:rgba(7,35,63,.45);display:flex;align-items:center;justify-content:center;z-index:300;padding:16px}
.dl-modal{background:#fff;border-radius:12px;box-shadow:0 16px 40px rgba(0,0,0,.24);padding:24px 26px;width:100%;max-width:380px}
.dl-modal h4{margin:0 0 8px;color:var(--brand);font-size:17px}
.dl-modal p{margin:6px 0 10px;font-size:13.5px;color:var(--muted)}
.dl-modal input{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:15px;outline:none}
.dl-modal input:focus{border-color:var(--brand2);box-shadow:0 0 0 3px rgba(20,105,184,.15)}
.dl-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}
.dl-actions .btn.ghost{background:transparent;color:var(--muted);border:1px solid var(--line)}
.dl-err{color:#b91c1c;font-size:13px}

/* 资料库 PDF 阅读 */
.lib-view{display:flex;flex-direction:column;gap:12px}
.lib-view .download-bar{margin-bottom:0}
.pdf-frame{width:100%;height:82vh;border:1px solid var(--line);border-radius:8px;background:#fff}
.pdf-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#fff;color:var(--muted);font-size:14px;z-index:1}
.lib-view{position:relative}

/* 解决方案/工程项目 */
.sol-image-view{display:flex;flex-direction:column;gap:12px}
.sol-image-view img{max-width:100%;height:auto;border:1px solid var(--line);border-radius:8px}
.ppt-slide{background:#fff;border:1px solid var(--line);border-radius:10px;padding:18px 20px;margin:0 0 16px}
.ppt-slide h3{margin:0 0 10px;color:var(--brand);font-size:16px;border-bottom:1px solid var(--line);padding-bottom:8px}

/* 搜索 */
.search-wrap{position:relative;flex:1;max-width:560px;margin:0 auto;display:flex;justify-content:center}
#search-input{width:100%;max-width:420px;padding:8px 14px;border-radius:20px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.12);color:#fff;font-size:14px;outline:none}
#search-input::placeholder{color:rgba(255,255,255,.75)}
#search-input:focus{background:rgba(255,255,255,.2)}
.search-results{position:absolute;top:calc(100% + 8px);left:0;right:0;background:#fff;color:var(--ink);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.2);max-height:70vh;overflow:auto;z-index:100;text-align:left}
.search-results .sr-item{padding:10px 14px;border-bottom:1px solid var(--line);cursor:pointer}
.search-results .sr-item:last-child{border-bottom:0}
.search-results .sr-item:hover{background:#eef6ff}
.search-results .sr-title{font-size:14px;font-weight:600;color:var(--brand);margin-bottom:2px}
.search-results .sr-snippet{font-size:12.5px;color:var(--muted);line-height:1.5;word-break:break-all}
.search-results .sr-empty{padding:12px 14px;color:var(--muted);font-size:13px}
mark{background:#ffe58a;padding:0 1px;border-radius:2px}
@media (max-width:900px){
  .search-wrap{order:3;flex-basis:100%;max-width:none;margin:6px 0 0}
  #search-input{max-width:none}
  .search-results{top:calc(100% + 4px)}
}

/* 主页美化（Yokogawa 商务风） */
.hero{position:relative;border-radius:var(--radius);overflow:hidden;margin-bottom:24px;min-height:420px;display:flex;align-items:center}
.content .hero-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;margin:0;opacity:0;transition:opacity .8s ease-in-out}
.content .hero-bg.active{opacity:1}
.hero-overlay{position:absolute;inset:0;background:linear-gradient(105deg,rgba(7,35,63,.9) 0%,rgba(7,35,63,.58) 48%,rgba(7,35,63,.22) 100%)}
.hero-inner{position:absolute;inset:0;z-index:1;padding:46px 42px;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.hero-logo{width:330px;max-width:82%;height:auto;display:block;margin:0 0 20px}
.hero-titles{display:flex;flex-direction:column;align-items:flex-start;text-align:left;margin:52px 0 0}
.hero-title{color:#fff;border:0;margin:0 0 6px;font-size:38px;font-weight:700;letter-spacing:3px;text-shadow:0 3px 14px rgba(0,0,0,.35)}
.hero-en{color:rgba(255,255,255,.95);font-size:15px;letter-spacing:2px;margin:0;white-space:nowrap;text-shadow:0 1px 6px rgba(0,0,0,.3)}
.hero-foot{position:absolute;left:42px;right:42px;bottom:26px;margin:0;text-align:left}
.hero-welcome{color:rgba(255,255,255,.97);margin:0 0 10px;font-size:19px;font-weight:600}
.hero-desc{color:rgba(255,255,255,.9);margin:0;font-size:15px;max-width:760px;line-height:1.8}
.hero-btn{display:inline-block;background:#fff;color:var(--brand);padding:10px 24px;border-radius:24px;font-weight:600;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,.18)}
.hero-btn:hover{background:#e8f1fa;text-decoration:none}

/* 首页区块统一样式 */
#content > section{margin-bottom:30px}
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.section-head h2{margin:0;padding:0 0 8px;border-bottom:2px solid var(--brand);display:inline-block;font-size:21px}
.section-sub{color:var(--muted);font-size:13px;margin:0}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:18px 0}
.stat{background:linear-gradient(180deg,#f7fbff,#eef5fc);border:1px solid var(--line);border-radius:10px;padding:18px 12px;text-align:center;transition:transform .18s ease,box-shadow .18s ease}
.stat:hover{transform:translateY(-3px);box-shadow:0 8px 18px rgba(15,76,129,.12)}
.stat b{display:block;font-size:24px;color:var(--brand)}
.stat span{font-size:13px;color:var(--muted)}

.cards .card{padding:0;overflow:hidden}
.cards .card{position:relative;transition:transform .2s ease,box-shadow .2s ease}
.cards .card:hover{transform:translateY(-4px);box-shadow:0 12px 26px rgba(15,76,129,.16)}
.cards .card img{width:100%;height:150px;object-fit:cover;margin:0;transition:transform .3s ease}
.cards .card:hover img{transform:scale(1.04)}
.card-tag{position:absolute;top:10px;right:10px;background:rgba(15,76,129,.88);color:#fff;font-size:11px;font-weight:700;letter-spacing:.5px;padding:3px 9px;border-radius:12px}
.cards .card h3{margin:14px 16px 6px}
.cards .card p{margin:0 16px 16px;font-size:13.5px;color:var(--muted)}

.author-box{display:flex;gap:22px;align-items:flex-start;background:#f0f6fc;border:1px solid var(--line);border-radius:12px;padding:22px;margin:14px 0}
.avatar{width:110px;height:110px;border-radius:50%;flex:none;box-shadow:0 4px 14px rgba(0,0,0,.14)}
.author-title{font-weight:700;color:var(--brand);margin:0 0 8px}
.author-info p{margin:6px 0}
.author-note{font-size:12.5px;color:var(--muted)}
code{background:#e5edf5;padding:1px 5px;border-radius:4px;font-size:12px}

#content section.notice{background:linear-gradient(180deg,#eef6ff,#e3eefc);border:1px solid #cfe3fb;border-radius:12px;padding:18px 20px}
#content section.notice .section-head h2{border-bottom-color:#1469b8}
#content section.notice p{margin:0;font-size:14px;color:#33506b}
#content section.notice p.notice-warn{font-size:17px;font-weight:700;color:#d81e06}
#content section.notice p+p{margin-top:8px}

#content section.outlook{margin-bottom:30px;background:linear-gradient(135deg,#0b3d6b,#1469b8 65%,#1e88c7);color:#fff;border-radius:12px;padding:30px 34px;text-align:center}
#content section.outlook .section-head{justify-content:flex-start}
#content section.outlook .section-head h2{color:#fff;border-bottom-color:#7fd0ff}
#content section.outlook .section-sub{color:rgba(255,255,255,.82)}
#content section.outlook .outlook-quote{font-size:19px;font-weight:700;margin:0 0 12px;letter-spacing:.5px;color:#ffd98a}
#content section.outlook p{margin:7px 0;font-size:14px;color:rgba(255,255,255,.92);line-height:1.9}
#content section.outlook .outlook-body{text-align:left}
#content section.outlook p:last-child{margin-bottom:0;color:#ffd98a;font-weight:600}

.home-footer{margin-top:24px;padding:14px 16px;background:#eef4fb;border-radius:10px;font-size:12px;color:var(--muted);line-height:1.7}

img.brand-logo{background:none;border-radius:16px;box-shadow:0 6px 18px rgba(11,61,107,.28)}
img.brand-logo.small{background:none;border-radius:9px;box-shadow:0 2px 8px rgba(0,0,0,.22)}

@media (max-width:900px){
  .hero{min-height:340px}
  .hero-inner{padding:30px 20px}
  .hero-title{font-size:27px;letter-spacing:2px}
  .hero-welcome{font-size:17px}
  .hero-desc{font-size:13.5px}
  .author-box{flex-direction:column;align-items:center;text-align:center}
  .avatar{width:96px;height:96px}
}
.avatar{object-fit:cover}

/* 阅读密码门禁 */
.read-gate{display:flex;align-items:center;justify-content:center;min-height:46vh;padding:24px 8px}
.read-gate-card{background:#f0f6fc;border:1px solid #cfe3fb;border-radius:12px;padding:30px 34px;text-align:center;max-width:440px;width:100%;box-shadow:var(--shadow)}
.read-gate-card h2{margin:0 0 10px;color:var(--brand);font-size:20px}
.read-gate-card p{margin:0 0 18px;font-size:14px;color:var(--muted)}
.read-gate-card .btn{font-size:15px;padding:10px 32px}
/* OA LOGO 展示（覆盖旧 logo 尺寸） */
img.brand-logo{width:auto;height:56px;border-radius:14px}
img.brand-logo.small{width:auto;height:80px;border-radius:18px;box-shadow:0 3px 10px rgba(0,0,0,.25)}

@media (max-width:900px){
  img.brand-logo.small{height:64px}
}

/* 顶栏标题加粗 */
#topbar-title{font-weight:700;font-size:17px}



/* 主页横幅左上角 LOGO：小尺寸、无圆角/阴影、贴近左上角 */
.hero .hero-logo{position:absolute;top:12px;left:42px;width:auto;height:64px;max-width:none;margin:0;z-index:2}
@media (max-width:900px){
  .hero .hero-logo{height:32px;top:8px;left:20px}
  .hero-en{font-size:12px;letter-spacing:1px}
  .hero-foot{left:20px;right:20px;bottom:18px}
}

/* 作者简介：文字框高度不变，长文滚动，头像不动 */
.author-info{max-height:170px;overflow-y:auto;padding-right:10px;scrollbar-width:thin;scrollbar-color:#9db8d1 #eef4fb}
.author-info::-webkit-scrollbar{width:8px}
.author-info::-webkit-scrollbar-track{background:#eef4fb;border-radius:4px;margin:10px 0}
.author-info::-webkit-scrollbar-thumb{background:#9db8d1;border-radius:4px;border:1px solid #f7fafd}
.author-info .author-welcome{color:var(--brand);margin-top:10px}

.site-footer{margin-top:16px;text-align:center;font-size:12px;color:var(--muted);line-height:1.7}
.site-footer a{color:var(--muted);text-decoration:none}
.site-footer a:hover{color:var(--brand2);text-decoration:underline}
