/* 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
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: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* 主题变量 */
:root {
    --sun-moon-transition: .3s;
    --bg-color: #eaeaea;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --text-bg: rgba(255, 255, 255, 1);
    --text-color: #333;
    --main-text-color: white;
    --main-bg: none;
    --main-background-size: cover;
    --main-shadow-color: rgba(0, 0, 0, 0.6);
    --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;
    --search-button-color1: rgb(3, 169, 244);
    --search-button-color2: rgb(244, 65, 165);
    --search-button-color3: rgb(255, 235, 59);
    --search-button-color4: rgb(9, 168, 244);
    --home-label-color: black;
    --cost-color: gainsboro;
    --select-color: #7f8eb0;
    --select-border-color: #7f8eb0;
    --footer-color: #7f8eb0;
    --footer-a-hover-color: deepskyblue;
    --mimic-color1: rgb(46, 103, 161);
    --mimic-color2: rgb(46, 103, 161);
    --whois-db-time-color: rgba(255, 255, 255, 0.2);
    --watermark-color: rgba(200, 200, 200, 1);
    --screenshot-svg-color: rgba(90, 90, 90, 1);
    --status-registered-color: #282828;
    --dns-svg-color: #50628e;
    --scrollbar-color: #a2a0a0;
}

/* 深色主题 */
[data-theme="dark"] {
    --bg-color: #1B1E24;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --text-bg: rgba(37, 37, 37, 1);
    --text-color: #a3a3a3;
    --main-text-color: #ddd;
    --main-bg: black;
    --main-shadow-color: rgba(0, 0, 0, 0.6);
    --tabel-th-color: #bbb;
    --tabel-a-color: #4096ff;
    --search-box-color: #333b50;
    --price-box-color: lightgray;
    --search-input-color: #232931;
    --search-input-text-color: lightgrey;
    --search-button-text-color: #cecece;
    --search-button-color1: rgb(64, 72, 77);
    --search-button-color2: rgb(22, 40, 89);
    --search-button-color3: rgb(155, 150, 81);
    --search-button-color4: rgb(66, 113, 133);
    --home-label-color: #b1b0b0;
    --cost-color: #8d8d8d;
    --select-color: rgb(81, 108, 130);
    --select-border-color: rgb(81, 108, 130);
    --footer-color: rgb(81, 108, 130);
    --footer-a-hover-color: rgb(100, 158, 196);
    --mimic-color1: rgb(45, 94, 143);
    --mimic-color2: rgb(38, 66, 95);
    --screenshot-svg-color: rgba(58, 58, 58, 1);
    --status-registered-color: #aaa;
    --dns-svg-color: #5c677f;
    --scrollbar-color: black;
}

/* 背景层 */
.background {
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    background-size: 100% 100%;
    z-index: -1;
    position: absolute;
    transition: background var(--sun-moon-transition);
}

/* 布局容器 */
.container {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    max-width: 630px;
    width: 100%;
    height: calc(100% - 2px);
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

/* 搜索区域 */
.search_box {
    background-color: var(--search-box-color);
    padding: 0 15px 0 15px;
    border-radius: 10px 10px 0 0;
    transition: background-color var(--sun-moon-transition);
    height: 170px;
}

.head {
    position: relative;
    display: flex;
    justify-content: flex-end;
    top: 15px;
    height: 25px;
    margin-right: -3px;
}

.home_label {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 28px;
    color: var(--home-label-color);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--sun-moon-transition);
}

/* 日月切换 */
.sun-moon {
    display: inline-block;
    margin-left: 2px;
}
.sun-moon .moon, .sun-moon .sun {
    width: 25px;
    cursor: pointer;
    transition: var(--sun-moon-transition) all ease-in-out;
    -webkit-tap-highlight-color: transparent;
}
.sun-moon .sun:hover {
    animation: sun_rotate 5s infinite;
}
.sun-moon .hide {
    display: none;
}

@keyframes sun_rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 输入框区域 */
.input_btn {
    display: inline-flex;
    margin-top: 25px;
    width: 100%;
    position: relative;
}

#search_input {
    flex: 1;
    height: 48px;
    border: none;
    outline: none;
    border-radius: 5px 0 0 5px;
    font-size: 21px;
    padding: 0 35px 0 10px;
    background-color: var(--search-input-color);
    color: var(--search-input-text-color);
    transition: background-color var(--sun-moon-transition), color var(--sun-moon-transition);
}

/* 清除按钮 */
.delete {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    background-color: rgba(128, 128, 128, 0.6);
    border: none;
    border-radius: 99px;
    cursor: pointer;
    pointer-events: auto;
    display: inline-block;
    flex-grow: 0;
    flex-shrink: 0;
    font-size: 0;
    outline: 0;
    position: absolute;
    vertical-align: top;
    width: 28px;
    height: 28px;
    right: 115px;
    top: 10px;
}
.delete::before {
    height: 2px;
    width: 50%;
}
.delete::after {
    height: 50%;
    width: 2px;
}
.delete::after, .delete::before {
    background-color: #eee;
    content: "";
    display: block;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
    transform-origin: center center;
    border-radius: 10px;
}
.delete:hover {
    background-color: gray;
}

/* 查询按钮 */
#search_button {
    width: 110px;
    height: 48px;
    border: 0;
    cursor: pointer;
    color: var(--search-button-text-color);
    border-radius: 0 5px 5px 0;
    background: linear-gradient(to right, var(--search-button-color1), var(--search-button-color2), var(--search-button-color3), var(--search-button-color4));
    background-size: 400%;
    font-size: 15px;
    transition: background var(--sun-moon-transition);
}
#search_button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 价格区域 */
#price_box, #price_load {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    z-index: 2;
}
#price_box {
    position: relative;
    top: 2px;
    height: 42px;
    overflow: visible;
    color: var(--price-box-color);
}
#price_load {
    position: absolute;
    top: 132px;
    color: var(--price-box-color);
    visibility: hidden;
    line-height: 20px;
    height: 42px;
}
#premium, #register, #renew, #status {
    visibility: hidden;
    height: 20px;
    line-height: 20px;
}
#register, #renew {
    display: flex;
    align-items: center;
    position: relative;
}
#register_val, #renew_val {
    text-shadow: -1px 0 #3d3d3d, 0 1px #3d3d3d, 1px 0 #3d3d3d, 0 -1px #3d3d3d;
}
#register-a, #renew-a {
    color: white;
    text-decoration-line: none;
    width: 20px;
    height: 20px;
    margin-right: 4px;
}
#register-text, #renew-text {
    display: inline-block;
    cursor: default;
}
#register-tip, #renew-tip {
    padding: 1px 5px 1px 5px;
    border-radius: 5px;
    font-weight: lighter;
    font-size: 13px;
    color: white;
    background-color: #000000;
    position: absolute;
    line-height: 19px;
    white-space: pre;
    bottom: 120%;
    z-index: 999;
    display: none;
}

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

.mimic {
    background: radial-gradient(circle at 60% 90%, var(--mimic-color1), transparent 60%),
                radial-gradient(circle at 20px 20px, var(--mimic-color2), transparent 25%);
}

/* 品牌水印 */
#brand {
    position: absolute;
    width: 100%;
    top: 200px;
    text-align: center;
    font-size: 60px;
    color: var(--watermark-color);
    z-index: 0;
    opacity: 0.1;
    pointer-events: none;
}

/* 加载动画 */
#loader {
    display: flex;
    justify-content: center;
    padding-top: 50px;
}
.gb-loader {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: top;
}
.gb-loader::after {
    position: absolute;
    width: 1em;
    height: 1em;
    content: "";
    background-color: currentColor;
    border-radius: 50%;
    transform-origin: 50% 2em;
}
.gb-loader--lg {
    width: 64px;
    height: 64px;
    top: 130px;
    left: calc(50% - 32px);
}
.gb-loader--lg::after {
    will-change: transform, box-shadow;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    animation-name: gb-loader-animation-expand;
    animation-duration: 3s;
    animation-iteration-count: infinite;
}
.gb-loader--lg::after {
    color: rgb(154, 166, 175);
    font-size: 16px;
}

@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; }
    0%, 20%, 30%, 100% { animation-timing-function: cubic-bezier(0.45, 0.1, 0.15, 1); }
}

/* 主表格 */
#main {
    box-shadow: 2px 4px 8px var(--main-shadow-color);
    background: var(--main-bg);
    border-radius: 0.8rem;
    font-size: 15px;
    display: none;
    position: relative;
    z-index: 1;
    word-break: break-word;
    background-size: var(--main-background-size);
    border-spacing: 0 13px;
    padding: 10px 20px;
    margin: 5px 3px 5px 5px;
}
#main tbody th {
    text-align: right;
    color: var(--tabel-th-color);
    width: 100px;
    font-weight: normal;
}
#main tbody td {
    padding-left: 0.8rem;
    font-size: 17px;
    color: var(--main-text-color);
    word-break: break-word;
}
#main a {
    color: var(--main-text-color);
    text-decoration-color: var(--tabel-a-color);
    text-decoration-line: underline;
}
#domain_href {
    color: var(--domain-color) !important;
    text-decoration: none !important;
    font-weight: 600;
    cursor: pointer;
    font-size: 19px;
    word-break: break-all;
}

/* DNS表格 */
#dns {
    border-collapse: collapse;
    position: relative;
    z-index: 1;
    background-color: white;
    display: none;
    margin: 5px 3px;
    border-radius: 8px;
    overflow: hidden;
}
#dns th, #dns td {
    border: 1px solid #ccc;
    padding: 8px 12px;
}
#dns thead th {
    background-color: #337ab7;
    color: white;
    font-size: 14px;
}
#dns td {
    font-size: 14px;
    color: black;
}

/* 原始文本 */
#text {
    white-space: pre-line;
    word-break: break-word;
    line-height: 22px;
    padding: 15px;
    display: none;
    margin: 0 15px;
    position: relative;
    z-index: 1;
    color: var(--text-color);
    background: var(--text-bg);
    border-radius: 10px;
    font-size: 13px;
}
#text a {
    color: var(--text-color);
    transition: color var(--sun-moon-transition);
}
#text a:hover {
    color: deepskyblue;
}

/* 时区标签 */
.TimeZone {
    font-size: 10px;
    color: var(--tabel-th-color);
    word-break: keep-all;
    white-space: pre;
    display: inline-block;
    line-height: 10px;
}
.TimeStr {
    display: inline-block;
    white-space: pre-wrap;
    vertical-align: middle;
}

/* 状态标签 */
.label {
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 3px;
    margin-right: 5px;
    font-family: "Microsoft JhengHei", "Apple LiGothic Medium,Microsoft YaHei", "Arial", cursive;
    max-height: 14px;
    display: inline-flex;
    align-items: center;
}
.NewReg { background-color: #00c500; color: white; }
.RedemptionPeriod { background-color: #25addb; color: white; }
.PendingTransfer, .TransferPeriod { background-color: yellow; color: black; }
.WillExpire, .AutoRenewPeriod { background-color: #ec8c00; color: white; }
.Expired, .PendingDelete { background-color: #f52d63; color: white; }
.ServerHold { background-color: whitesmoke; color: black; font-weight: bold; }
.PendingVerification { background-color: rgb(192, 192, 192); color: black; }
.RenewTenYears { background-color: cyan; color: black; }
.TenYearsOld { background-color: #d614d6; color: white; }
.RenewPeriod { background-color: pink; color: black; }

/* 页脚 */
#foot {
    position: relative;
    top: max(calc(100% - 230px), 300px);
    display: flex;
    flex-direction: column;
    align-items: center;
}
footer {
    color: var(--footer-color);
}
footer div {
    text-align: center;
    padding: 3px 0;
}
footer a {
    text-decoration: none;
    outline: none;
    color: var(--footer-color);
    cursor: pointer;
    display: inline-block;
    position: relative;
    transition: color var(--sun-moon-transition);
    margin: 0 10px;
}
footer a:hover {
    color: var(--footer-a-hover-color);
}

/* 设置区域 */
#set {
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    row-gap: 10px;
    column-gap: 7px;
    text-align: right;
    justify-content: center;
}
#set label {
    color: var(--select-color);
    white-space: pre;
    padding-left: 5px;
}
#set select {
    font-size: 14px;
    color: var(--select-color);
    border-radius: 4px;
    outline: none;
    background: transparent;
    text-align-last: center;
    cursor: pointer;
    border: 1px solid var(--select-border-color);
    transition: color var(--sun-moon-transition), border var(--sun-moon-transition);
    padding: 2px 5px;
}
#set select option {
    color: black;
    background-color: whitesmoke;
}

/* 滚动条样式 */
#result::-webkit-scrollbar-track {
    -webkit-border-radius: 5px;
    border-radius: 5px;
    background-color: transparent;
}
#result::-webkit-scrollbar-track-piece {
    background-color: transparent;
}
#result::-webkit-scrollbar-thumb {
    -webkit-border-radius: 5px;
    border-radius: 5px;
    background: var(--scrollbar-color);
}
#result::-webkit-scrollbar-thumb:window-inactive {
    background: dimgrey;
}
#result::-webkit-scrollbar-thumb:hover {
    background-color: dimgrey;
}
#result::-webkit-scrollbar {
    width: 5px;
}

/* 历史记录弹窗 */
#history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.history-content {
    background: var(--glass-bg);
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}
.history-content h3 {
    color: var(--main-text-color);
    margin-bottom: 15px;
    text-align: center;
}
#close-history {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--main-text-color);
    font-size: 20px;
    cursor: pointer;
}
#history-table {
    width: 100%;
    border-collapse: collapse;
}
#history-table th, #history-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: var(--main-text-color);
}
#history-table tr:hover {
    background: rgba(255,255,255,0.1);
    cursor: pointer;
}

/* PC端 */
@media screen and (min-width: 630px) {
    #search_input {
        width: calc(100% - 110px);
    }
    #price_box, #price_load {
        width: calc(100% - 30px);
    }
}

/* 移动端 */
@media screen and (max-width: 630px) {
    .container {
        height: 100%;
        margin: 0;
    }
    .search_box {
        border-radius: 0;
        height: 160px;
    }
    .input_btn {
        width: 100%;
    }
    #search_input {
        width: calc(100% - 90px);
        font-size: 18px;
    }
    #search_button {
        width: 90px;
    }
    .delete {
        right: 95px;
    }
    .head {
        top: 12px;
    }
    .home_label {
        top: 6px;
        font-size: 24px;
    }
    #main, #text {
        padding: 10px 15px;
        margin: 5px 10px;
    }
    #main tbody th {
        width: 80px;
        font-size: 13px;
    }
    #main tbody td {
        font-size: 15px;
    }
    #result {
        height: calc(100% - 160px);
    }
    #result::-webkit-scrollbar {
        width: 0;
    }
    #price_load {
        top: 125px;
    }
}

/* 移动端小屏手机 */
@media only screen and (max-width: 380px) {
    #main, #dns {
        font-size: 13px;
    }
    #main tbody td {
        font-size: 14px;
        padding-left: 0.6rem;
    }
    #main tbody th {
        width: 70px;
    }
    #domain_href {
        font-size: 16px;
    }
    #result {
        font-size: 15px;
    }
    #text {
        line-height: 19px;
    }
    .search_box {
        height: 140px;
    }
    .head {
        top: 8px;
    }
    .home_label {
        font-size: 22px;
    }
    .input_btn {
        margin-top: 15px;
    }
    #search_input, #search_button {
        height: 43px;
    }
    #price_box {
        font-size: 13px;
        height: 33px;
    }
    #price_load {
        font-size: 13px;
        height: 34px;
        top: 105px;
    }
}
