/* WHOISX - 模仿 hu.is 风格 */
:root {
  --bg-color: #eaeaea;
  --result-color: white;
  --text-bg: rgba(255, 255, 255, 1);
  --text-color: #333;
  --brand-color: #9aa6af;
  --brand-shadow-color: none;
  --scrollbar-color: #a2a0a0;
  --main-text-color: white;
  --main-bg: rgba(0, 0, 0, 0.8);
  --main-shadow-color: rgb(0 0 0 / 10%);
  --tabel-th-color: lightgray;
  --tabel-a-color: #a4dcff;
  --domain-color: #26caff;
  --search-box-color: #7f8eb0;
  --price-box-color: whitesmoke;
  --search-input-color: white;
  --search-input-text-color: black;
  --search-button-text-color: #fff;
  --home-label-color: black;
  --footer-color: #7f8eb0;
  --whois-db-time-color: rgba(255, 255, 255, 0.2);
  --watermark-color: rgba(200, 200, 200, 1);
}

html {
  line-height: 1.2;
  height: 100%;
  width: 100%;
  position: fixed;
  overflow-y: hidden;
}

body {
  display: flex;
  justify-content: center;
  margin: 0;
  height: 100%;
  overflow-y: hidden;
  font-family: Avenir, Helvetica, Arial, sans-serif;
}

.background {
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  background-image: linear-gradient(90deg, #3c0a1e0a 3%, transparent 0), linear-gradient(1turn, #3c0a1e0a 3%, transparent 0);
  background-size: 20px 20px;
  z-index: -1;
  position: absolute;
}

/* 主布局 */
.search {
  max-width: 630px;
  width: 100%;
  height: 100%;
  margin-top: 10px;
}

/* 搜索区域 */
.search_box {
  background-color: var(--search-box-color);
  padding: 15px;
  border-radius: 10px 10px 0 0;
  position: relative;
  width: 100%;
  max-width: 630px;
  margin: 0 auto;
  box-sizing: border-box;
}

.head {
  position: relative;
  display: flex;
  justify-content: space-between;
  top: 10px;
  height: 20px;
  margin-right: -3px;
}

.home_label {
  font-size: 28px;
  color: var(--main-text-color);
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 2px;
}

.head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#open-history-btn {
  width: 30px;
  height: 30px;
  cursor: pointer;
  fill: var(--main-text-color);
  vertical-align: middle;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--main-text-color);
  transition: opacity 0.2s;
}

#open-history-btn:hover { opacity: 0.8; }
#open-history-btn svg { width: 28px; height: 28px; }

/* 搜索输入 */
.input_btn {
  display: flex;
  margin-top: 45px;
  width: 100%;
  justify-content: flex-start;
  box-sizing: border-box;
}

.input-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

#search_input {
  border: none;
  outline: none;
  height: 48px;
  width: 100%;
  border-radius: 5px 0 0 5px;
  font-size: 21px;
  padding: 0 45px 0 10px;
  background-color: var(--search-input-color);
  color: var(--search-input-text-color);
  box-sizing: border-box;
}

#clear-input-btn {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  background: rgba(128, 128, 128, 0.2);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  user-select: none;
}

#clear-input-btn:hover { background: rgba(128, 128, 128, 0.3); }
#clear-input-btn svg { width: 12px; height: 12px; stroke: var(--main-text-color); }

#search_button {
  height: 48px;
  width: 85px;
  border: 0;
  cursor: pointer;
  color: var(--search-button-text-color);
  border-radius: 0 5px 5px 0;
  background: linear-gradient(to right, rgb(107 131 183), rgb(83 101 141));
  font-size: 15px;
  box-sizing: border-box;
  flex-shrink: 0;
}

#search_button:hover {
  background: linear-gradient(to right, rgb(90 115 170), rgb(70 88 130));
}

/* 价格/状态栏 */
#price_box {
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  z-index: 2;
  position: relative;
  top: 10px;
  color: var(--price-box-color);
}

#price_load {
  font-size: 15px;
  display: none;
  justify-content: flex-start;
  align-items: center;
  z-index: 2;
  position: relative;
  top: 10px;
  color: var(--price-box-color);
  width: 100%;
}

#status { visibility: hidden; height: 20px; line-height: 20px; }
#query-time { color: var(--watermark-color); white-space: nowrap; }

#price-tags {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  overflow: visible;
}

.price-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.15);
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.price-tag .price-logo {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.price-tag .price-type {
  font-size: 10px;
  opacity: 0.7;
  font-weight: 400;
}

.price-tag .price-value {
  font-size: 13px;
  font-weight: 700;
}

.price-tag .price-registrar {
  font-size: 10px;
  opacity: 0.6;
  font-weight: 400;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 结果区域 */
#result {
  background-color: var(--result-color);
  color: #2c3e50;
  position: relative;
  height: calc(100% - 170px);
  width: auto;
  font-weight: 500;
  font-size: 16px;
  overflow-y: auto;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#result::-webkit-scrollbar { display: none; }

body.querying-bg #result {
  background: radial-gradient(circle at 60% 90%, #2e67a1, transparent 60%), radial-gradient(circle at 20px 20px, #2e67a1, transparent 25%);
}

/* 品牌 Logo */
#brand {
  position: fixed;
  width: 100%;
  top: 200px;
  text-align: center;
  font-size: 60px;
  color: var(--brand-color);
  z-index: 0;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 8px;
  user-select: none;
  pointer-events: none;
}

#result-watermark {
  left: 50%;
  transform: translate(-50%, -50%);
  user-select: none;
  pointer-events: none;
  z-index: 0;
  display: none;
  position: fixed;
  width: 100%;
  top: 400px;
  text-align: center;
  color: #9aa6af;
  font-size: 60px;
  font-weight: 700;
  letter-spacing: 8px;
  opacity: 0.15;
}

/* 加载动画 */
@keyframes gb-loader-animation-expand {
  0% { transform: rotate(0deg); }
  70%, 80%, 90%, 100% { transform: rotate(720deg); }
  80%, 90% { top: calc(50% - .5em); box-shadow: 0 0 0 0 currentColor, 0 0 0 0 currentColor; }
  0%, 20%, 30%, 80%, 100% { top: calc(50% - 2em); box-shadow: -1.35em 2.25em 0 0 currentColor, 1.35em 2.25em 0 0 currentColor; }
}

.global-loader-scope {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.global-loader-scope .gb-loader {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: top;
}

.global-loader-scope .gb-loader::after {
  position: absolute;
  width: 1em;
  height: 1em;
  content: "";
  background-color: currentColor;
  border-radius: 50%;
  transform-origin: 50% 2em;
}

.global-loader-scope .gb-loader--lg {
  width: 64px;
  height: 64px;
  top: 60px;
  left: calc(50% - 32px);
}

.global-loader-scope .gb-loader--lg::after {
  will-change: transform, box-shadow;
  backface-visibility: hidden;
  animation-name: gb-loader-animation-expand;
  animation-duration: 2s;
  animation-iteration-count: infinite;
  color: rgb(154, 166, 175);
  font-size: 16px;
}

/* 结构化信息卡片 */
#main {
  box-shadow: 2px 3px 8px var(--main-shadow-color);
  background: var(--main-bg);
  border-radius: 0.8rem;
  font-size: 15px;
  display: none;
  position: relative;
  z-index: 10;
  word-break: break-word;
  border-spacing: 0 13px;
  width: 98%;
  max-width: 630px;
  margin: 10px auto;
  padding: 15px 23px;
  box-sizing: border-box;
}

.brand-pendant {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 16px;
  color: #9aa6af;
  opacity: 0.5;
  user-select: none;
  pointer-events: none;
  letter-spacing: 2px;
  font-weight: 700;
}

#main table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
#main tbody th { text-align: right; color: var(--tabel-th-color); font-weight: normal; min-width: 5rem; width: 100px; padding: 0 8px; }
#main tbody td { padding-left: 0.8rem; padding-right: 0.8rem; font-size: 15px; color: var(--main-text-color); word-break: break-word; font-weight: normal; }
#main tr:nth-child(n + 2) td { line-height: 20px; }

#domain_href {
  color: var(--domain-color) !important;
  text-decoration: none !important;
  font-weight: 600;
  cursor: pointer;
  font-size: 19px;
  word-break: break-all;
  margin-right: 5px;
  line-height: 16px;
  width: fit-content;
}

#domain_href:hover {
  text-shadow: 0 0 10px var(--domain-color), 0 0 20px var(--domain-color);
}

/* 状态标签 */
.status-tag {
  padding: 0 6px;
  font-size: 11px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  height: 20px;
  line-height: 1;
  font-weight: 600;
  margin-right: 5px;
}

.status-available { background: rgba(50, 198, 50, 0.15); color: #2e7d32; }
.status-registered { background: rgba(128, 128, 128, 0.15); color: #666; }
.status-redemption { background: rgba(253, 126, 20, 0.15); color: #fd7e14; }
.status-pending_delete { background: rgba(220, 53, 69, 0.15); color: #dc3545; }
.status-grace { background: rgba(255, 193, 7, 0.15); color: #e6a700; }
.status-error { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.status-unknown { background: rgba(52, 58, 64, 0.1); color: #343a40; }

/* 元数据开关 */
#metadata-toggle-box {
  text-align: center;
  margin: 10px 0;
  display: none;
  transition: margin-bottom 0.3s;
}

.switch-simple {
  display: inline-block;
  position: relative;
  width: 92px;
  height: 32px;
  cursor: pointer;
  user-select: none;
  margin: 5px 0;
}

.switch-simple input { opacity: 0; width: 0; height: 0; }

.switch-inner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(67, 76, 99, 0.72), rgba(126, 135, 158, 0.42));
  backdrop-filter: blur(8px);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  padding: 0 12px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.12), 0 10px 24px rgba(34, 46, 73, 0.12);
}

.switch-inner::before {
  content: '原始数据';
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  transition: all 0.3s;
}

.switch-inner::after {
  content: '';
  position: absolute;
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 12px rgba(12, 18, 33, 0.28);
}

.switch-simple input:checked + .switch-inner {
  background: linear-gradient(135deg, rgba(107, 131, 183, 0.9), rgba(83, 101, 141, 0.9));
}

.switch-simple input:checked + .switch-inner::before {
  content: '收起';
  right: auto;
  left: 10px;
}

.switch-simple input:checked + .switch-inner::after {
  transform: translateX(60px);
}

/* 元数据卡片 */
#metadata-card {
  box-shadow: 2px 4px 8px var(--main-shadow-color);
  background: var(--main-bg);
  border-radius: 0.8rem;
  width: 98%;
  margin: 0 auto 70px auto;
  padding: 15px;
  box-sizing: border-box;
  display: none;
  color: var(--main-text-color);
  position: relative;
  z-index: 10;
}

.meta-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(128,128,128,0.2);
  padding-bottom: 5px;
}

#text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 14px;
  color: #eee;
  margin: 0;
  padding: 15px;
  overflow-y: auto;
  max-height: 200px;
  border: none;
  display: block;
}

/* 历史记录 */
#history-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  z-index: 99;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#history {
  position: fixed;
  top: 0;
  right: -350px;
  width: 320px;
  height: 100%;
  background: var(--bg-color);
  z-index: 120;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  color: var(--main-text-color);
}

#history.show { right: 0 !important; }

.history-header {
  padding: 20px;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid var(--tabel-th-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--home-label-color);
}

.history-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--home-label-color);
  opacity: 0.6;
  transition: opacity 0.2s;
}

.history-close-btn:hover { opacity: 1; }
.history-close-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }

.history-search-container {
  padding: 10px 20px;
  background: rgba(128, 128, 128, 0.05);
  border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.history-search-box { position: relative; display: flex; align-items: center; }

#history-search-input {
  width: 100%;
  height: 36px;
  padding: 0 35px 0 12px;
  border-radius: 18px;
  border: 1px solid rgba(128, 128, 128, 0.2);
  background: var(--search-input-color);
  color: var(--search-input-text-color);
  font-size: 14px;
  outline: none;
}

#history-search-input:focus {
  border-color: var(--domain-color);
  box-shadow: 0 0 0 3px rgba(38, 202, 255, 0.1);
}

#history-search-clear {
  position: absolute;
  right: 10px;
  width: 20px;
  height: 20px;
  background: rgba(128, 128, 128, 0.1);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
}

#history-list-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 10px;
}

#history-list-container::-webkit-scrollbar { width: 4px; }
#history-list-container::-webkit-scrollbar-thumb { background: var(--scrollbar-color); border-radius: 2px; }

.history-item {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.history-item:hover { background: rgba(128, 128, 128, 0.05); }

.history-item-domain {
  font-size: 16px;
  font-weight: 500;
  color: #272b2d;
}

.history-item-time {
  font-size: 12px;
  color: #9a9898;
}

.history-item-status {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(128, 128, 128, 0.1);
  color: #403636;
  font-weight: 500;
}

.history-footer {
  padding: 12px 20px;
  font-size: 11px;
  color: #9a9898;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  opacity: 0.8;
  flex-shrink: 0;
}

/* 底部 */
#footer-info {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 630px;
  text-align: center;
  color: #8c8c8c;
  font-size: 13px;
  font-weight: 300;
  z-index: 110;
  letter-spacing: 1px;
  padding: 15px 0;
  background: rgb(235 231 231 / 20%);
  backdrop-filter: blur(10px);
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  user-select: none;
  box-sizing: border-box;
}

body.querying-bg #footer-info {
  color: rgba(255, 255, 255, 1);
  background: rgba(0, 0, 0, 0.2);
}

/* 滚动条 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, 0.5); }

/* PC */
@media screen and (min-width: 630px) {
  #price_box, #price_load { width: 580px; margin-left: 5px; margin-right: 5px; }
  #main { padding: 10px 0; margin: 10px auto; }
  #main tbody th { width: 100px; }
}

/* 移动端 */
@media screen and (max-width: 630px) {
  .search { height: 100%; margin: 0; }
  .input_btn { width: 100%; }
  .search_box { border-radius: 0; }
  #search_button { width: 85px; flex-shrink: 0; }
  .head { top: 12px; }
  .home_label { top: 6px; }
  #main tbody th { width: 88px; }
  #main { padding: 5px 10px; margin: 5px auto 10px auto; width: 98%; }
  #text { padding: 15px 10px; }
  #history { width: 85vw; right: -85vw; }
  #history.show { right: 0 !important; }
  #footer-info { max-width: 100%; font-size: 12px; padding: 12px 10px; left: 0; transform: none; width: 100%; }
}

/* 小屏 */
@media only screen and (max-width: 380px) {
  #main { font-size: 13px; }
  #main tbody td { font-size: 15px; padding-left: 0.6rem; }
  #main tbody th { width: 70px; }
  #domain_href { font-size: 17px; }
  #result { font-size: 15px; height: calc(100% - 140px); }
  .search_box { height: 140px; }
  .head { top: 8px; }
  .home_label { font-size: 25px; }
  .input_btn { margin-top: 35px; }
  #search_input { height: 43px; font-size: 18px; padding-right: 35px; }
  #search_button { height: 43px; width: 70px; font-size: 14px; }
}
