/* ==========================================================================
   Wordnet 词典站 —— 全站样式
   2026-12-03 重写：原来依赖 Bootstrap 2.3.2（2012 年）+ jQuery 1.8.3，
   外链 CDN 卡住整页渲染。现在改成原生 CSS（自定义属性 + Flex），
   视觉与旧版逐像素对齐，零框架、零外链。
   基准视口 1920×1080，几何值来自旧版 getComputedStyle 实测。
   ========================================================================== */

:root {
  /* 顶栏 */
  --nav-h: 40px;
  --nav-bg-top: #333;
  --nav-bg-bottom: #222;
  --nav-fg: #999;
  --nav-fg-active: #fff;
  --nav-active-bg: #111;

  /* 页面 */
  --fg: #333;
  --fg-muted: #555;
  --link: #08c;
  --panel: #e6e6e6;
  --rule: #ccc;

  /* 内容区（旧版 .container.fill1 绝对定位的实测值） */
  --content-left: 10px;
  --content-top: 200px;
  --content-w: 970px;

  /* 搜索控件 */
  --field-w: 570px;
  --field-h: 30px;
  --btn-w: 70px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 14px/20px "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: #fff;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 下标：旧版 Bootstrap 2.3.2 的 reset 把它设为 line-height:0，
   默认样式会把关系行撑高 5~11px，这里保持一致 */
sub,
sup {
  line-height: 0;
}

/* ── 顶栏 ───────────────────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: stretch;
  height: var(--nav-h);
  font-size: 14px;
  line-height: 20px;
  color: var(--nav-fg);
  background-color: var(--nav-bg-bottom);
  background-image: linear-gradient(to bottom, var(--nav-bg-top), var(--nav-bg-bottom));
}

.topbar a {
  color: inherit;
}

.topbar .brand {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 20px;
  font-weight: 200;
  color: var(--nav-fg);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.topbar .brand:hover {
  color: #fff;
  text-decoration: none;
}

.topnav {
  display: flex;
}

.topnav ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topnav li {
  display: flex;
}

.topnav a {
  display: flex;
  align-items: center;
  padding: 0 15px;
  color: var(--nav-fg);
}

.topnav a:hover {
  color: #fff;
  text-decoration: none;
}

.topnav .is-active a {
  color: var(--nav-fg-active);
  background-color: var(--nav-active-bg);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.topbar-text {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 20px;
}

/* ── 搜索控件 ───────────────────────────────────────────────────────── */

.field {
  width: var(--field-w);
  height: var(--field-h);
  padding: 4px 6px;
  font: 14px/20px inherit;
  color: var(--fg-muted);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px 0 0 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.field:focus {
  outline: 0;
  border-color: #66afe9;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(102, 175, 233, 0.6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-w);
  height: var(--field-h);
  margin-left: -1px;
  padding: 0 12px;
  font: 14px/20px inherit;
  color: var(--fg);
  background-color: #f5f5f5;
  background-image: linear-gradient(to bottom, #fff, #e6e6e6);
  border: 1px solid var(--rule);
  border-radius: 0 14px 14px 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.btn:hover {
  background-image: linear-gradient(to bottom, #fff, #e0e0e0);
  text-decoration: none;
}

/* ── 搜索条（词条页：固定在顶栏下方） ─────────────────────────────── */

.searchbar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 1020;
  height: 66px;
  background: var(--panel);
}

.searchbar-inner {
  display: flex;
  align-items: flex-start;
  height: 100%;
}

.searchbar-title {
  flex: 0 0 220px;
  padding: 0 10px 0 20px;
  line-height: 20px;
}

.searchbar-form {
  display: flex;
  align-items: flex-start;
  padding-top: 15px;
}

/* ── 内容区（词条页） ───────────────────────────────────────────────── */

.content {
  width: var(--content-w);
  max-width: calc(100% - var(--content-left) - 20px);
  margin-top: var(--content-top);
  margin-left: var(--content-left);
}

.pos-title {
  margin: 0 0 1px;
  font-size: 18px;
  font-weight: 400;
  line-height: 20px;
}

.pos-title b {
  font-weight: 700;
}

.pos-title .term {
  color: var(--fg);
}

.senses {
  margin: 0 0 0 25px;
  padding: 0;
  list-style: decimal;
}

.sense {
  margin: 0;
  line-height: 20px;
}

/* 释义里的首个词：旧版靠 <a name> 继承到链接色，这里显式给色 */
.sense .term {
  color: var(--link);
}

/* 关系行（is a kind of / derived forms / antonyms …）
   旧版每个关系后面跟一个 <br>（多出一个空行），这里用 margin-bottom 复刻同样的行距 */
.rel {
  margin-bottom: 20px;
  color: var(--link);
}

.rel .term,
.rel-label {
  color: var(--link);
}

.rel-table {
  display: inline-table;
  vertical-align: top;
  border-collapse: collapse;
  margin: 0;
}

.rel-gutter {
  width: 2px;
  padding: 0;
}

.rel-body {
  padding: 0;
}

.rel-links {
  font-size: 13px;
}

.site-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--fg-muted);
}

.site-footer p {
  margin: 0;
}

.ad-slot {
  display: block;
}

/* ── 首页 ───────────────────────────────────────────────────────────── */

.page-home .topbar {
  position: static;
}

.home-wrap {
  max-width: 1170px;
  margin: 0 auto;
}

.home-search {
  width: 570px;
  max-width: 100%;
  margin-top: 100px;
  padding-bottom: 20px;
}

.home-title {
  margin: 10px 0;
  font-size: 24.5px;
  font-weight: 700;
  line-height: 40px;
  text-align: center;
}

.home-slogan {
  width: 570px;
  max-width: 100%;
  margin: 10px 0 0 30px;
  text-align: center;
}

.home-slogan p {
  margin: 0 0 10px;
}

.addthis_toolbox {
  margin-top: 10px;
}

/* ── 小屏适配（旧版是固定像素，窄屏会溢出，这里只做最小兜底） ─────── */

@media (max-width: 900px) {
  :root {
    --field-w: 100%;
    --content-w: auto;
  }

  .searchbar-title {
    display: none;
  }

  .searchbar-form {
    width: 100%;
    padding: 15px 20px 0;
  }

  .content {
    margin-left: 20px;
    margin-right: 20px;
    max-width: none;
  }

  .topbar {
    overflow-x: auto;
  }
}
