/* ============================================================
 * 域名解析查询工具 - 样式表
 * 深色科技风 + 金色主题 + 鼠标四态 + 手机竖版自适应
 * ============================================================ */

/* 基础重置与全局变量 */
:root {
    --bg-1: #0b0f1a;
    --bg-2: #141a2b;
    --card: rgba(22, 28, 46, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #e8ecf5;
    --text-dim: #9aa5bd;
    --gold: #f5c542;
    --gold-light: #ffe08a;
    --gold-dark: #c89b1e;
    --gold-deep: #8f6d0c;
    --red: #ff5d5d;
    --red-dark: #b03a3a;
    --green: #4ade80;
    --radius: 14px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 55%, #1a1530 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    padding: 32px 16px 48px;
    -webkit-font-smoothing: antialiased;
}

/* 背景装饰光斑 */
body::before {
    content: "";
    position: fixed;
    top: -120px; right: -120px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(245, 197, 66, 0.16) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    bottom: -140px; left: -100px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(76, 120, 255, 0.14) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* 金色粒子特效背景（最顶层显示） */
.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

/* 卡片容器 */
.container {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 28px 30px 32px;
}

/* 头部 */
.header { text-align: center; margin-bottom: 26px; }

.header .icon {
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, rgba(245, 197, 66, 0.2), rgba(245, 197, 66, 0.05));
    border: 1px solid rgba(245, 197, 66, 0.35);
    border-radius: 16px;
    box-shadow: 0 0 24px rgba(245, 197, 66, 0.25);
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--gold-light), var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p { margin-top: 6px; font-size: 13px; color: var(--text-dim); }

/* 查询表单 */
.form {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 12px;
    margin-bottom: 6px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    padding-left: 2px;
}

.field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--text);
    background: rgba(13, 17, 29, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
}

/* ============================================================
 * 自定义下拉组件
 * 触发器四态：hover 金边 / focus 金色光晕
 * 菜单项：划过金色 / 选中深金色
 * ============================================================ */
.cselect {
    position: relative;
    width: 100%;
}

.cselect-trigger {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    color: var(--text);
    text-align: left;
    background: rgba(13, 17, 29, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cselect-trigger:hover {
    border-color: rgba(245, 197, 66, 0.55);
    background: rgba(13, 17, 29, 0.9);
}

.cselect.open .cselect-trigger,
.cselect-trigger:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.18), 0 0 16px rgba(245, 197, 66, 0.22);
    background: rgba(13, 17, 29, 0.95);
}

.cselect-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cselect-arrow {
    margin-left: 8px;
    font-size: 12px;
    color: var(--gold);
    transition: transform 0.22s ease;
}

.cselect.open .cselect-arrow { transform: rotate(180deg); }

/* 弹出菜单 */
.cselect-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #10151f;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(245, 197, 66, 0.08);
    max-height: 264px;
    overflow-y: auto;
    animation: fadeIn 0.18s ease;
}

.cselect.open .cselect-menu { display: block; }

.cselect-item {
    position: relative;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s ease, color 0.18s ease;
}

/* 鼠标划过：金色 */
.cselect-item:hover {
    background: var(--gold);
    color: #1a1405;
    box-shadow: 0 0 14px rgba(245, 197, 66, 0.4);
}

/* 选中项：深金色 */
.cselect-item.selected {
    background: var(--gold-deep);
    color: #fff8e0;
    font-weight: 600;
}

.cselect-item.selected::after {
    content: "\2713";
    position: absolute;
    right: 12px;
    color: #fff8e0;
}

.cselect-item:hover::after { color: #1a1405; }

/* 输入框四态 */
.field input:hover { border-color: rgba(245, 197, 66, 0.55); }

.field input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.18), 0 0 16px rgba(245, 197, 66, 0.22);
    background: rgba(13, 17, 29, 0.95);
}

.field input::placeholder { color: #5c6577; }

/* ============================================================
 * 状态提示
 * ============================================================ */
.status {
    display: none;
    margin-top: 18px;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 10px;
    line-height: 1.5;
}

.status.show { display: block; animation: fadeIn 0.3s ease; }

.status-error {
    color: #ffb3b3;
    background: rgba(255, 93, 93, 0.12);
    border: 1px solid rgba(255, 93, 93, 0.4);
}

.status-empty {
    color: #ffd98a;
    background: rgba(245, 197, 66, 0.1);
    border: 1px solid rgba(245, 197, 66, 0.35);
}

/* 加载动画 */
.loading {
    display: none;
    margin-top: 18px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 0;
}

.loading.show { display: flex; animation: fadeIn 0.3s ease; }

.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(245, 197, 66, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading .tip { font-size: 13px; color: var(--text-dim); letter-spacing: 0.5px; }

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
 * 细线金色滚动条（下拉菜单 / 表格滚动容器）
 * ============================================================ */
.cselect-menu::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.cselect-menu::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cselect-menu::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
    background: rgba(245, 197, 66, 0.45);
    border-radius: 999px;
}

.cselect-menu::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.cselect-menu::-webkit-scrollbar-corner,
.table-scroll::-webkit-scrollbar-corner {
    background: transparent;
}

.cselect-menu,
.table-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 197, 66, 0.45) transparent;
}

/* ============================================================
 * 结果表格
 * ============================================================ */
.result-wrap { display: none; margin-top: 22px; }

.result-wrap.show { display: block; animation: fadeIn 0.35s ease; }

.result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.result-title .badge {
    padding: 3px 10px;
    font-size: 12px;
    color: #1a1405;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    border-radius: 999px;
    font-weight: 700;
}

.result-title .count { font-size: 12px; color: var(--green); }

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    padding: 11px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--gold-light);
    background: rgba(245, 197, 66, 0.08);
    border-bottom: 1px solid rgba(245, 197, 66, 0.22);
    white-space: nowrap;
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
    word-break: break-all;
}

tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }

tbody tr:hover { background: rgba(245, 197, 66, 0.07); }

tbody tr:last-child td { border-bottom: none; }

td .mono {
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 13px;
}

td .tag {
    display: inline-block;
    padding: 2px 9px;
    font-size: 12px;
    border-radius: 6px;
    background: rgba(76, 120, 255, 0.14);
    border: 1px solid rgba(76, 120, 255, 0.35);
    color: #9fc0ff;
    white-space: nowrap;
}

td .tag-mx {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
    color: #7de8a4;
}

td .ttl { color: var(--text-dim); font-size: 13px; }

/* 页脚 */
.footer {
    margin-top: 22px;
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0.75;
}

/* ============================================================
 * 手机竖版自适应
 * ============================================================ */
@media (max-width: 640px) {
    body { padding: 18px 12px 36px; }

    .card { padding: 22px 18px 26px; border-radius: 12px; }

    .form { grid-template-columns: 1fr; gap: 10px; }

    .field input, .cselect-trigger { height: 48px; font-size: 16px; }

    .cselect-menu { max-height: 300px; }

    .cselect-item { padding: 12px; font-size: 15px; }

    .header h1 { font-size: 20px; }

    .result-head { flex-direction: column; align-items: flex-start; gap: 8px; }

    table { min-width: 520px; font-size: 13px; }

    td, th { padding: 10px 12px; }
}
