:root {
  --nav-primary-bg: #8e2323;
  --nav-primary-bg-darker: #6a1a1a;
  --nav-accent-color: #d4a76a;
  --nav-text-color: #ffffff;
  --nav-height: 70px;
  --content-bg: #ffffff;
  --light-bg: #f8f9fa;
  --text-color: #333;
  --light-text: #666;
  --medium-text: #555;
  --heading-color: #8e2323;
  --accent-border: var(--nav-accent-color);
  --input-border: var(--nav-accent-color);
  --button-bg: var(--nav-primary-bg);
  --button-hover-bg: var(--nav-primary-bg-darker);
  --border-color-light: #eee;
  --result-section-border: var(--nav-primary-bg);
  --box-bg: #f9f9f9;
  --box-border: var(--nav-accent-color);
}
body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background-color: var(--light-bg);
  padding-top: var(--nav-height);
}
/* 导航背景全屏宽度，居中内容容器 */
.navbar {
  background: linear-gradient(135deg, var(--nav-primary-bg), var(--nav-primary-bg-darker));
  height: var(--nav-height);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
/* 内部容器宽度固定最大 1200px，居中 - 核心修改：justify-content: flex-end */
.navbar-container {
  display: flex;
  justify-content: flex-end; /* 改为flex-end让所有内容靠右对齐 */
  align-items: center;
  height: var(--nav-height);
  width: 100%;
  max-width: 1200px;
  padding: 0 24px;
  margin: 0 auto;
}

/* 导航菜单：保持当前设置 */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: 20px;
}

/* Logo样式：保持当前设置 */
.navbar-logo {
  color: var(--nav-text-color);
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  margin-right: 0;
}
.navbar-logo:hover {
  color: var(--nav-accent-color);
  transform: scale(1.02);
}
.menu-icon {
  display: none;
  color: var(--nav-text-color);
  font-size: 1.8rem;
  cursor: pointer;
}

.nav-item {
  height: var(--nav-height);
}
.nav-link {
  color: var(--nav-text-color);
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 0 1rem;
  height: 100%;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.95rem;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--nav-accent-color);
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--nav-accent-color);
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 60%;
}

/* 统一 .container 和 #result 的宽度设置 */
.container,
#result {
  background-color: var(--content-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  margin: 20px auto; /* 居中 */
  width: 90%; /* 占据父容器宽度的90% */
  max-width: 600px; /* 最大宽度为600px */
}

/* #result 特有样式（非宽度相关）*/
#result {
  padding: 0; /* 外部padding可能不同，内部padding在.result-content控制 */
  border-top: 3px solid var(--result-section-border); /* 顶部边框 */
  overflow: hidden;
  min-height: 600px; /* 确保最小可见高度 */
}


h1 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--heading-color);
}
.input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}
label {
  margin-bottom: 5px;
  color: var(--medium-text);
}
input {
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  width: 50%;
  font-size: 16px;
}
button {
  padding: 10px 20px;
  border: none;
  background-color: var(--button-bg);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  width: 50%;
  font-size: 16px;
  transition: all 0.3s ease;
}
button:hover {
  background-color: var(--button-hover-bg);
}
p {
  margin: 10px 0;
  color: var(--text-color);
}
a {
  color: var(--button-bg);
  text-decoration: none;
}
a:hover {
  color: var(--button-hover-bg);
  text-decoration: underline;
}

.result-content {
  padding: 20px;
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  text-align: left;
}
.qq-avatar-wrapper {
  width: clamp(80px, 20vw, 120px);
  height: clamp(80px, 20vw, 120px);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--nav-accent-color);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}
.qq-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qq-info-block {
  flex-grow: 1;
  color: var(--text-color);
}
.qq-info-block h2 {
  font-size: 1.6em;
  color: var(--heading-color);
  margin-bottom: 10px;
  line-height: 1.2;
  word-break: break-all;
}
.qq-info-block .estimated-value {
  font-size: 1.3em;
  color: var(--nav-primary-bg);
  font-weight: bold;
  margin-top: 5px;
}
.estimated-value span {
  color: var(--nav-accent-color);
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  text-align: left;
  border-top: 1px solid var(--border-color-light);
  padding-top: 20px;
  margin-top: 20px;
}
.detail-item {
  background-color: var(--box-bg);
  border: 1px solid var(--border-color-light);
  border-radius: 5px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  word-break: break-word;
}
.detail-item .label {
  font-weight: bold;
  color: var(--medium-text);
  margin-bottom: 5px;
  font-size: 0.95em;
}
.detail-item .value {
  color: var(--text-color);
  font-size: 1em;
}
.error {
  color: #c62828;
  font-size: 14px;
  margin-top: 10px;
  padding: 20px;
}
.disclaimer {
  margin-top: 20px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-color-light);
  text-align: left;
  font-size: 14px;
  color: var(--medium-text);
}
.disclaimer h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--heading-color);
}
.disclaimer ul {
  list-style-type: disc;
  padding-left: 20px;
  margin: 0;
}
.disclaimer ul li {
  margin-bottom: 5px;
}

/* Back to top button - slightly adjusted for always visible result section */
#back-to-top {
  display: none; /* Initial state remains hidden, JS will control its visibility */
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--heading-color);
  color: white;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 20px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}
#back-to-top:hover {
  background-color: var(--nav-primary-bg-darker);
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
}
footer {
  text-align: center;
  padding: 25px 20px;
  margin-top: 30px;
  background-color: #e9ecef;
  color: #6c757d;
  font-size: 0.9em;
  border-top: 1px solid #dee2e6;
}
footer p {
  margin: 5px 0;
  line-height: 1.5;
}
footer a {
  color: #6c757d;
  text-decoration: none;
  transition: color 0.3s;
}
footer a:hover {
  color: #495057;
  text-decoration: underline;
}
@media (max-width: 960px) {
  .navbar-container {
    max-width: 100%;
    padding: 0 15px;
    position: relative;
    justify-content: space-between; /* 移动端保持两端对齐，以显示菜单按钮 */
  }
  .menu-icon {
    display: block;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: var(--nav-height);
    left: -100%;
    opacity: 0;
    transition: all 0.5s ease;
    background: linear-gradient(
      135deg,
      var(--nav-primary-bg-darker),
      var(--nav-primary-bg)
    );
    padding: 10px 0;
    z-index: 998;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-menu.active {
    display: flex;
    left: 0;
    opacity: 1;
  }
  .nav-item {
    width: 100%;
    height: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-item:last-child {
    border-bottom: none;
  }
  .nav-link {
    padding: 0.8rem 1.5rem;
    width: 100%;
    display: block;
    font-size: 1rem;
    height: auto;
    text-align: center;
  }
  .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--nav-accent-color);
  }
  .nav-link::after {
    display: none;
  }
  /* 移动端也统一宽度 */
  .container,
  #result {
    width: 95%; /* 移动端调整为95% */
    /* max-width 依然有效，但因为屏幕窄，通常会使用95%的宽度 */
  }
  input,
  button {
    width: 80%;
  }
  .result-header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .qq-info-block h2 {
    font-size: 1.4em;
  }
  .qq-info-block .estimated-value {
    font-size: 1.1em;
  }
  .details-grid {
    grid-template-columns: 1fr;
  }
  .detail-item {
    padding: 10px 12px;
  }
  .detail-item .label {
    margin-bottom: 3px;
    font-size: 0.9em;
  }
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  footer {
    padding: 20px 15px;
    font-size: 0.85em;
  }
}