* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #333;
  background: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", "SimSun-ExtB", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 顶部深色欢迎条 */
.topbar {
  color: #a6a6a6;
  background: linear-gradient(#5a5a5a, #3f3f3f);
  font-size: 12px;
}

.topbar-inner {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  white-space: nowrap;
}

.topbar-left {
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-orange {
  color: #e3a24b;
}

.top-dim {
  color: #9b9b9b;
}

.topbar-right {
  color: #b0b0b0;
  flex: none;
}

/* 页头 */
.site-header {
  background: #f5f5f5;
  border-bottom: 1px solid #e3e3e3;
}

.header-inner {
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.logo-mark {
  width: 58px;
  height: 58px;
  display: block;
}

.logo-text {
  display: block;
}

.logo-title {
  display: block;
  color: #e35c0f;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 2px;
}

.logo-sub {
  display: block;
  margin-top: 3px;
  color: #0b8a4f;
  font-size: 13px;
  letter-spacing: 1px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 14px;
}

.main-nav a {
  display: block;
  padding: 9px 15px;
  color: #333;
  white-space: nowrap;
}

.main-nav a:hover {
  color: #e60012;
}

.main-nav a.active {
  padding: 9px 23px;
  color: #fff;
  background: #484848;
  border-radius: 4px;
}

.main-nav a.active:hover {
  color: #fff;
}

.main-nav a.red {
  color: #e60012;
}

/* 主内容 */
.page-main {
  flex: 1 0 auto;
  padding-top: 14px;
}

.member-bar {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 22px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
}

.member-chevron {
  color: #8a8a8a;
  font-size: 18px;
}

.member-greeting {
  flex: none;
}

.member-user {
  color: #e60012;
  font-weight: 700;
}

.member-link {
  flex: none;
  color: #333;
}

.member-link:hover {
  color: #e60012;
}

.member-link.red {
  color: #e60012;
}

/* 未登录态：登录条与会员条同宽同高 */
.member-bar.login-bar {
  min-height: 62px;
  gap: 14px;
  padding: 10px 14px;
  flex-wrap: wrap;
  white-space: normal;
  overflow: visible;
  font-size: 14px;
}

.login-field {
  display: flex;
  align-items: center;
  height: 38px;
  background: #fff;
  border: 1px solid #cfcfcf;
}

.login-icon {
  width: 36px;
  height: 100%;
  display: grid;
  place-items: center;
  flex: none;
  background: #f5f5f5;
  color: #9aa7b0;
}

.login-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.login-field input {
  height: 100%;
  padding: 0 10px;
  color: #333;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: inherit;
  font-size: 14px;
}

.login-user input {
  width: 320px;
}

.login-pass input {
  width: 400px;
}

.login-submit {
  width: 120px;
  height: 40px;
  color: #fff;
  background: #3f7ea6;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.login-submit:hover {
  background: #356a8c;
}

.login-error {
  color: #e60012;
  font-size: 13px;
  white-space: nowrap;
}

.panel {
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #d9dfdf;
  border-radius: 2px;
  overflow: hidden;
}

.panel-title {
  height: 44px;
  padding: 0 20px;
  line-height: 44px;
  color: #333;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(#fafbfb, #f7f7f7);
  border-bottom: 1px solid #e8ebeb;
}

.panel-body {
  padding: 20px;
}

.rare-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 20px;
}

/* 「英文数据库」三个类型：一行三列 */
.type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 20px;
}

.rare-btn {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: #333;
  background: #eef7fa;
  border: 1px solid #a9c7d0;
  border-radius: 2px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rare-btn:hover {
  color: #111;
  background: #e3f3f8;
  border-color: #6fb9cc;
}

/* 当前选中的类型 */
.rare-btn.active {
  color: #0b6f8a;
  background: #dceff5;
  border-color: #4b9db3;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.stat-btn {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  background: #fff;
  border: 1px solid #c9c9c9;
  font-size: 15px;
}

.stat-btn:hover {
  border-color: #8f8f8f;
  background: #fcfcfc;
}

.stat-btn.red {
  color: #ff2121;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 22px;
}

.tool-btn {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  background: #f8f8f8;
  border: 1px solid #9b9b9b;
  border-radius: 2px;
  font-size: 15px;
}

.tool-btn:hover {
  background: #fff;
  border-color: #6d6d6d;
}

/* 登录态：按钮带凭据回传，表单本身不参与 grid 布局 */
.btn-form {
  display: contents;
}

.btn-form button {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
}

/* 页脚 */
.site-footer {
  flex: none;
  margin-top: 40px;
  padding: 26px 0 24px;
  color: #ccc;
  background: #545454;
}

.footer-title {
  margin-bottom: 14px;
  color: #d9d9d9;
  font-size: 24px;
  font-weight: 400;
}

.footer-rule {
  height: 1px;
  margin-bottom: 18px;
  background: #666;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: 13px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-divider {
  color: #7c7c7c;
}

.footer-copy {
  margin-top: 14px;
  color: #c9c9c9;
  font-size: 13px;
  text-align: center;
}

/* ShowInfo 占位页 / 404 */
body.simple-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f0f0f0;
}

.placeholder-card {
  width: 100%;
  max-width: 560px;
  padding: 40px 36px;
  text-align: center;
  background: #fff;
  border: 1px solid #d9dfdf;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.placeholder-title {
  color: #333;
  font-size: 20px;
  font-weight: 700;
  word-break: break-all;
}

.placeholder-text {
  margin: 14px 0 24px;
  color: #777;
  font-size: 14px;
}

.placeholder-back {
  display: inline-block;
  padding: 8px 22px;
  color: #333;
  background: #f4f8fa;
  border: 1px solid #a9c7d0;
  border-radius: 2px;
  font-size: 14px;
}

.placeholder-back:hover {
  background: #eef7fa;
  border-color: #6fb9cc;
}

@media (max-width: 900px) {
  .header-inner {
    height: auto;
    padding-top: 18px;
    padding-bottom: 18px;
    flex-wrap: wrap;
    gap: 14px;
  }

  .main-nav {
    flex-wrap: wrap;
  }

  .member-bar {
    gap: 18px;
    overflow-x: auto;
  }

  .rare-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-grid,
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .logo-title {
    font-size: 24px;
  }

  .topbar-right {
    display: none;
  }

  .rare-grid,
  .stat-grid,
  .tools-grid,
  .type-grid {
    grid-template-columns: 1fr;
  }
}
