/* 在线工具站 · 宽屏门户风格 v3 */
:root {
  --blue: #337ab7;
  --blue-hover: #23527c;
  --blue-tab: #5bc0de;
  --green: #5cb85c;
  --text: #333;
  --muted: #777;
  --line: #e6e6e6;
  --bg: #f2f2f2;
  --w: 1180px;
  --font: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
img { max-width: 100%; border: 0; vertical-align: middle; }

.container {
  width: var(--w);
  max-width: calc(100% - 24px);
  margin-left: auto;
  margin-right: auto;
}

/* ===== 顶栏白底：Logo 左 + 搜索右 ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 16px 0;
}
.brand {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  flex-shrink: 0;
}
.brand-logo {
  height: 52px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
}
.brand-mark {
  width: 52px;
  height: 52px;
  background: #337ab7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  border-radius: 4px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  display: block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: #222;
  white-space: nowrap;
}
.brand-title .name-blue { color: #337ab7; }
.brand-slogan {
  display: block;
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.header-search {
  width: 400px;
  max-width: 42%;
  flex-shrink: 0;
}
.search-form {
  display: flex !important;
  flex-direction: row !important;
  width: 100%;
  height: 36px;
  border: 1px solid #bbb;
  background: #fff;
}
.search-form input[type="text"] {
  flex: 1;
  border: 0 !important;
  outline: none;
  padding: 0 12px;
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
  background: transparent;
}
.search-form button {
  width: 48px;
  height: 100%;
  border: 0 !important;
  background: #337ab7 !important;
  color: #fff !important;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  flex-shrink: 0;
}
.search-form button:hover { background: #286090 !important; }

.hot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.hot-links a {
  color: #337ab7;
  margin: 0 2px;
  text-decoration: none;
}
.hot-links a:hover { text-decoration: underline; }
.hot-links .dot {
  color: #ccc;
  margin: 0 4px;
  user-select: none;
}

/* ===== 主导航 Tab ===== */
.main-nav-wrap {
  background: #ececec;
  border-bottom: 1px solid #ddd;
}
.main-nav-wrap .container {
  display: flex;
  align-items: flex-end;
  position: relative;
}
.main-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
.main-nav a {
  display: block;
  padding: 11px 26px;
  font-size: 15px;
  color: #555;
  text-decoration: none !important;
  border-top: 3px solid transparent;
  background: transparent;
}
.main-nav a:hover { color: #337ab7; }
.main-nav a.active {
  background: #fff;
  color: #333;
  font-weight: 700;
  border-top-color: #5bc0de;
}

.nav-toggle {
  display: none;
  margin: 8px 0;
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

/* ===== 分类条 ===== */
.cat-nav-wrap {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.cat-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
}
.cat-nav a {
  padding: 5px 14px;
  font-size: 13px;
  color: #555;
  text-decoration: none !important;
}
.cat-nav a:hover,
.cat-nav a.active {
  color: #337ab7;
  font-weight: 700;
}

/* 公告 */
.announce {
  background: #fffbf0;
  border-bottom: 1px solid #f0e0b2;
  padding: 8px 0;
  font-size: 13px;
  color: #666;
}
.announce .container { display: flex; gap: 10px; }
.announce-tag {
  background: #f0ad4e;
  color: #fff;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== 内容 ===== */
.page-main { padding: 18px 0 36px; min-height: 48vh; }

.section { margin-bottom: 26px; }
.section-head {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-label {
  display: inline-block;
  background: #5cb85c;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  line-height: 1.5;
  border-radius: 2px;
  flex-shrink: 0;
}
.section-line {
  flex: 1;
  height: 1px;
  background: #ddd;
}
.section-more {
  font-size: 12px;
  color: #999;
  text-decoration: none !important;
  flex-shrink: 0;
}
.section-more:hover { color: #337ab7; }

.tool-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tool-card {
  background: #fff;
  border: 1px solid #eee;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 118px;
}
.tool-card:hover {
  border-color: #cce5f5;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.tool-card-body {
  display: flex;
  gap: 12px;
  flex: 1;
}
.tool-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}
.tool-icon.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaf4fb;
  color: #337ab7;
  font-size: 18px;
  font-weight: 700;
}
.tool-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.tool-card h3 a {
  color: #337ab7;
  text-decoration: none !important;
}
.tool-card h3 a:hover { text-decoration: underline !important; }
.tool-card .desc {
  margin: 0;
  color: #888;
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #f0f0f0;
  padding-top: 8px;
  margin-top: auto;
}
.tool-meta { font-size: 12px; color: #bbb; }
.tool-go {
  font-size: 12px;
  color: #337ab7;
  text-decoration: none !important;
}
.tool-go:hover { text-decoration: underline !important; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 0 4px;
  margin-left: 4px;
  font-weight: 400;
  vertical-align: middle;
}
.badge-new { background: #fcf8e3; color: #8a6d3b; }
.badge-hot { background: #f2dede; color: #a94442; }

.breadcrumb { font-size: 13px; color: #999; margin-bottom: 12px; }
.breadcrumb a { color: #666; text-decoration: none !important; }
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 14px;
}
.tool-main {
  background: #fff;
  border: 1px solid #eee;
  padding: 20px;
}
.tool-main h1 { margin: 0 0 8px; font-size: 20px; }
.tool-desc { color: #888; margin: 0 0 16px; font-size: 13px; }
.tool-docs {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed #e8e8e8;
  color: #555;
  font-size: 14px;
  line-height: 1.75;
}
.tool-docs h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: #333;
}
.tool-docs h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #333;
  border: none;
  padding: 0;
}
.tool-docs-intro {
  margin: 0 0 4px;
  color: #555;
}
.tool-docs ol {
  margin: 0;
  padding-left: 1.4em;
}
.tool-docs li {
  margin: 4px 0;
  color: #555;
}
.tool-side .side-box {
  background: #fff;
  border: 1px solid #eee;
  padding: 12px;
  margin-bottom: 12px;
}
.tool-side h3 {
  margin: 0 0 8px;
  font-size: 14px;
  border-left: 3px solid #5cb85c;
  padding-left: 8px;
}
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li {
  padding: 6px 0;
  border-bottom: 1px dashed #f0f0f0;
}
.related-list a { color: #555; text-decoration: none !important; font-size: 13px; }
.related-list a:hover { color: #337ab7; }

.page-body {
  background: #fff;
  border: 1px solid #eee;
  padding: 24px;
}
.page-body h1 { margin-top: 0; }

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 28px 0 18px;
  margin-top: 10px;
  color: #888;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.site-footer h4 { margin: 0 0 8px; color: #555; font-size: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: #888; }
.footer-copy {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 12px;
  color: #aaa;
}

.btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  text-decoration: none !important;
}
.btn-primary { background: #337ab7; color: #fff !important; }
.btn-primary:hover { background: #286090; color: #fff !important; }
.btn-ghost { background: #f5f5f5; color: #555 !important; border-color: #ddd; }

.tool-panel textarea,
.tool-panel input[type=text],
.tool-panel input[type=number],
.tool-panel select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-family: Consolas, monospace;
  font-size: 13px;
}
.tool-panel textarea { min-height: 160px; resize: vertical; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-msg { font-size: 13px; margin-top: 8px; color: #888; }
.tool-msg.ok { color: #3c763d; }
.tool-msg.err { color: #a94442; }
.empty-tip {
  color: #999;
  padding: 28px;
  text-align: center;
  background: #fff;
  border: 1px solid #eee;
}

@media (max-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .header-search { width: 100%; max-width: none; }
  .nav-toggle { display: inline-block; }
  .main-nav { display: none !important; width: 100%; flex-direction: column !important; background: #fff; }
  .main-nav.open { display: flex !important; }
  .main-nav a { border-top: 0; border-left: 3px solid transparent; }
  .main-nav a.active { border-left-color: #5bc0de; }
  .main-nav-wrap .container { flex-wrap: wrap; }
  .cat-nav { flex-wrap: nowrap; overflow-x: auto; }
  .cat-nav a { flex-shrink: 0; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .tool-grid { grid-template-columns: 1fr; }
  .brand-title { font-size: 18px; }
}

/* —— 文章 —— */
.article-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.article-cats a {
  font-size: 13px;
  color: #555;
  text-decoration: none !important;
  padding: 4px 10px;
  border: 1px solid #e5e5e5;
  background: #fff;
}
.article-cats a.on,
.article-cats a:hover {
  border-color: #5bc0de;
  color: #337ab7;
}
.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.article-card {
  display: flex;
  gap: 16px;
  background: #fff;
  border: 1px solid #eee;
  padding: 16px;
}
.article-cover {
  flex: 0 0 140px;
  width: 140px;
  height: 96px;
  overflow: hidden;
  background: #f5f5f5;
}
.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-card-body { flex: 1; min-width: 0; }
.article-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}
.article-card h2 a {
  color: #333;
  text-decoration: none !important;
}
.article-card h2 a:hover { color: #337ab7; }
.article-top {
  display: inline-block;
  font-size: 12px;
  background: #f0ad4e;
  color: #fff;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: middle;
  font-weight: 600;
}
.article-summary {
  margin: 0 0 8px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #999;
}
.article-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 8px;
}
.article-pager a,
.article-pager span {
  min-width: 32px;
  text-align: center;
  padding: 4px 8px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #555;
  text-decoration: none !important;
  font-size: 13px;
}
.article-pager span.on {
  background: #5bc0de;
  border-color: #5bc0de;
  color: #fff;
}
.article-detail-head h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.35;
}
.article-detail-cover {
  margin: 16px 0;
}
.article-detail-cover img {
  max-width: 100%;
  height: auto;
  display: block;
}
.article-lead {
  color: #666;
  font-size: 15px;
  line-height: 1.7;
  border-left: 3px solid #5bc0de;
  padding: 6px 0 6px 12px;
  margin: 0 0 18px;
  background: #f8fbfd;
}
.article-content {
  font-size: 15px;
  line-height: 1.85;
  color: #333;
}
.article-content h2,
.article-content h3 {
  margin: 1.4em 0 0.6em;
  line-height: 1.35;
}
.article-content p { margin: 0 0 1em; }
.article-content ul,
.article-content ol { margin: 0 0 1em; padding-left: 1.4em; }
.article-content img { max-width: 100%; height: auto; }
.article-back {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 14px;
}
.article-back a { color: #337ab7; text-decoration: none !important; }
.article-back a:hover { text-decoration: underline !important; }
.page-content { line-height: 1.8; }

@media (max-width: 640px) {
  .article-card { flex-direction: column; }
  .article-cover { width: 100%; flex-basis: auto; height: 160px; }
  .article-detail-head h1 { font-size: 22px; }
}
