:root {
  --primary: #2d2d2d;
  --primary-dark: #1a1a1a;
  --primary-light: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #999999;
  --bg: #f5f5f5;
  --bg-white: #ffffff;
  --border: #dddddd;
  --border-light: #eeeeee;
  --danger: #c0392b;
  --success: #27ae60;
  --warning: #f39c12;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --radius: 6px;
  --max-w: 1200px;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

.container{max-width:var(--max-w);margin:0 auto;padding:0 20px}

/* Header */
.site-header{
  background:var(--bg-white);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:100;
}
.site-header .container{
  display:flex;
  align-items:center;
  height:60px;
  gap:24px;
}
.site-logo{
  display:flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  cursor:pointer;
}
.site-logo svg{width:24px;height:24px;color:var(--primary)}
.site-logo span{
  font-size:20px;
  font-weight:700;
  color:var(--text);
}
.header-search{flex:1;max-width:360px}
.header-search input{
  width:100%;
  height:38px;
  padding:0 16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  font-size:14px;
  outline:none;
  transition:border-color .2s;
}
.header-search input:focus{border-color:var(--primary)}
.header-nav{display:flex;gap:8px}
.header-nav a{
  padding:8px 16px;
  font-size:14px;
  color:var(--text-secondary);
  text-decoration:none;
  border-radius:var(--radius);
  transition:all .2s;
}
.header-nav a:hover{background:var(--primary-light);color:var(--text)}

/* Hero - 简短介绍 */
.hero{
  background:linear-gradient(180deg, var(--primary-light) 0%, var(--bg-white) 100%);
  border-bottom:1px solid var(--border);
  padding:36px 0 30px;
  text-align:center;
}
.hero-title{
  font-size:26px;
  font-weight:700;
  color:var(--text);
  margin:0 0 10px;
  letter-spacing:.5px;
}
.hero-sub{
  font-size:14px;
  line-height:1.7;
  color:var(--text-secondary);
  max-width:640px;
  margin:0 auto 14px;
}
.hero-meta{
  font-size:12px;
  color:var(--text-muted);
  letter-spacing:.3px;
}
.hero-meta span{font-weight:700;color:var(--text-secondary)}

/* Cat Tabs - 分类横排 */
.cat-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  background:var(--bg-white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:6px;
  margin-bottom:20px;
  position:sticky;
  top:60px;
  z-index:50;
}
.cat-tab{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px;
  font-size:13px;
  font-weight:500;
  color:var(--text-secondary);
  background:transparent;
  border:1px solid transparent;
  border-radius:var(--radius);
  cursor:pointer;
  transition:all .15s;
  font-family:inherit;
  white-space:nowrap;
}
.cat-tab:hover{
  background:var(--primary-light);
  color:var(--text);
  transform:translateY(-1px);
}
.cat-tab.active{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.cat-tab .ct-icon{
  width:16px;
  height:16px;
  flex-shrink:0;
}
.cat-tab .ct-count{
  font-size:11px;
  padding:1px 6px;
  border-radius:9px;
  background:rgba(0,0,0,.06);
  color:inherit;
  font-weight:500;
}
.cat-tab.active .ct-count{background:rgba(255,255,255,.22)}

.search-hint{
  font-size:13px;
  color:var(--text-secondary);
  margin:0 2px 14px;
}

/* FAQ */
.faq{
  max-width:800px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.faq details{
  background:var(--bg-white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:12px 16px;
  transition:border-color .2s;
}
.faq details[open]{
  border-color:var(--text-muted);
}
.faq summary{
  cursor:pointer;
  font-size:14px;
  font-weight:500;
  color:var(--text);
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  outline:none;
}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{
  content:'+';
  font-size:18px;
  color:var(--text-muted);
  font-weight:400;
  transition:transform .2s;
  flex-shrink:0;
}
.faq details[open] summary::after{content:'−';transform:rotate(180deg)}
.faq p{
  margin-top:10px;
  font-size:13px;
  color:var(--text-secondary);
  line-height:1.7;
}

/* Section */
.section{padding:32px 0}
.section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:20px;
}
.section-title{
  font-size:18px;
  font-weight:600;
  color:var(--text);
}

/* Categories - 简洁网格 */
.cat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
  gap:12px;
}
.cat-card{
  background:var(--bg-white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  text-decoration:none;
  color:var(--text);
  transition:all .2s;
}
.cat-card:hover{
  border-color:var(--text-muted);
  box-shadow:var(--shadow);
}
.cat-card .cat-icon{
  width:36px;
  height:36px;
  border-radius:var(--radius);
  background:var(--primary-light);
  color:var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:600;
  margin-bottom:10px;
}
.cat-card .cat-name{font-size:14px;font-weight:600;margin-bottom:2px}
.cat-card .cat-desc{font-size:12px;color:var(--text-muted)}
.cat-card .cat-count{font-size:12px;color:var(--text-muted);margin-top:4px}

/* Tools Grid - 紧凑卡片 */
.tools-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));
  gap:10px;
}
.tool-card{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--bg-white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:12px 14px;
  text-decoration:none;
  color:var(--text);
  transition:all .18s ease;
}
.tool-card:hover{
  border-color:var(--text-muted);
  transform:translateY(-2px);
  box-shadow:0 6px 16px rgba(0,0,0,.07);
  color:var(--text);
}
.tool-card .tc-icon{
  width:30px;
  height:30px;
  flex-shrink:0;
  border-radius:6px;
  background:var(--primary-light);
  color:var(--text-secondary);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:600;
  letter-spacing:.2px;
}
.tool-card .tc-icon svg{width:16px;height:16px;stroke-width:2}
.tool-card .tc-body{flex:1;min-width:0}
.tool-card .tc-name{
  font-size:13.5px;
  font-weight:500;
  margin-bottom:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tool-card .tc-desc{
  font-size:12px;
  color:var(--text-muted);
  line-height:1.4;
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* Tool Page */
.tool-page{padding:24px 0}
.tool-pg-header{
  margin-bottom:20px;
}
.tool-pg-header a{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:13px;
  color:var(--text-muted);
  text-decoration:none;
  margin-bottom:8px;
}
.tool-pg-header a:hover{color:var(--text)}
.tool-pg-header h2{font-size:22px;font-weight:600;color:var(--text)}
.tool-pg-body{
  background:var(--bg-white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
}
.tool-pg-body textarea,
.tool-pg-body input[type="text"],
.tool-pg-body input[type="number"],
.tool-pg-body select{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  font-size:14px;
  color:var(--text);
  background:var(--bg-white);
  font-family:inherit;
  outline:none;
  transition:border-color .2s;
}
.tool-pg-body textarea:focus,
.tool-pg-body input:focus,
.tool-pg-body select:focus{border-color:var(--primary)}
.tool-pg-body select{
  cursor:pointer;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:36px;
}
.tool-pg-body textarea{min-height:150px;resize:vertical;font-family:monospace;font-size:13px;line-height:1.5}
.tool-pg-body textarea.code-area{min-height:200px}
.tool-pg-body label{
  display:block;
  font-size:13px;
  font-weight:500;
  color:var(--text-secondary);
  margin-bottom:6px;
}
.tool-pg-body .field{margin-bottom:14px}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:8px 16px;
  font-size:13px;
  font-weight:500;
  border:none;
  border-radius:var(--radius);
  cursor:pointer;
  transition:all .15s;
  font-family:inherit;
  text-decoration:none;
}
.btn:active{transform:scale(.98)}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-outline{background:var(--bg-white);color:var(--text-secondary);border:1px solid var(--border)}
.btn-outline:hover{border-color:var(--text-muted);color:var(--text)}
.btn-sm{padding:6px 12px;font-size:12px}
.btn-group{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}

/* Layout */
.row-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}

/* Result */
.result-area{
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
  min-height:50px;
  font-family:monospace;
  font-size:13px;
  white-space:pre-wrap;
  word-break:break-word;
  line-height:1.5;
  color:var(--text);
  max-height:400px;
  overflow:auto;
}
.result-area.blank{color:var(--text-muted);font-style:italic}

/* Toast */
.toast{
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  padding:10px 20px;
  border-radius:var(--radius);
  font-size:13px;
  font-weight:500;
  color:#fff;
  background:var(--text);
  z-index:999;
  opacity:0;
  transition:opacity .3s;
  pointer-events:none;
}
.toast.show{opacity:1}
.toast.success{background:var(--success)}
.toast.error{background:var(--danger)}

/* Modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.4);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:200;
}
.modal-box{
  background:var(--bg-white);
  border-radius:var(--radius);
  width:90%;
  max-width:800px;
  max-height:80vh;
  overflow-y:auto;
  padding:24px;
  box-shadow:var(--shadow-md);
}
.modal-close{
  float:right;
  background:none;
  border:none;
  font-size:24px;
  cursor:pointer;
  color:var(--text-muted);
  line-height:1;
}

/* Hash cards */
.card-row{display:grid;grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));gap:10px}
.hash-card{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);padding:12px}
.hash-card .ha-title{font-size:12px;font-weight:500;color:var(--text-muted);margin-bottom:4px}
.hash-card .ha-val{font-family:monospace;font-size:12px;word-break:break-all}

/* JWT */
.jwt-parts{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:10px}
.jwt-part{background:var(--bg);border-radius:var(--radius);padding:12px}
.jwt-part h4{font-size:11px;text-transform:uppercase;color:var(--text-muted);margin-bottom:6px}
.jwt-part pre{font-size:11px;margin:0;white-space:pre-wrap;word-break:break-word}

/* Footer */
.site-footer{
  background:var(--primary-dark);
  color:rgba(255,255,255,.6);
  padding:24px 0;
  margin-top:32px;
  text-align:center;
  font-size:13px;
}
.site-footer .footer-links{margin-top:8px;font-size:12px}
.site-footer .footer-links a{color:rgba(255,255,255,.6);text-decoration:none}
.site-footer .footer-links a:hover{color:#fff;text-decoration:underline}
.site-footer .footer-links .sep{color:rgba(255,255,255,.28);margin:0 8px}
.site-footer .footer-beian{margin-top:6px;font-size:12px}
.site-footer .footer-beian a{color:rgba(255,255,255,.6);text-decoration:none}
.site-footer .footer-beian a:hover{color:#fff;text-decoration:underline}

/* Responsive */
@media (max-width:768px){
  .site-header .container{flex-wrap:wrap;height:auto;padding:12px 16px;gap:10px}
  .header-search{max-width:100%;order:3;width:100%}
  .hero{padding:26px 0 22px}
  .hero-title{font-size:21px}
  .hero-sub{font-size:13px;padding:0 4px}
  .cat-tabs{top:auto;position:static}
  .cat-tab{padding:6px 10px;font-size:12px}
  .row-2,.row-3{grid-template-columns:1fr}
  .tools-grid{grid-template-columns:repeat(2,1fr)}
  .cat-grid{grid-template-columns:repeat(2,1fr)}
  .jwt-parts{grid-template-columns:1fr}
  .tool-pg-body{padding:16px}
}
