/* ================= 全局基础设置 ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* 柔和的浅青色背景 */
    background-color: #f0fdfa;
    background-image: radial-gradient(#ccf2f0 1px, transparent 1px);
    background-size: 20px 20px; /* 波点底纹 */
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    color: #2d3748;
}

.container {
    width: 90%;
    max-width: 700px;
    padding: 40px 20px;
}

/* ================= 头部样式 ================= */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 2.5rem;
    color: #0d9488; /* 浓郁的青绿色 */
    margin-bottom: 10px;
    white-space: nowrap;
}

.subtitle {
    color: #64748b;
    font-size: 1rem;
}

/* ================= 搜索框样式 ================= */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.input-wrapper {
    flex: 1;
}

#query {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #99f6e4;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
    background: white;
}

#query:focus {
    border-color: #0d9488;
    box-shadow: 0 0 10px rgba(13, 148, 136, 0.2);
}

.btn-search {
    padding: 0 20px;
    background: #0d9488;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, background 0.3s;
}

.btn-search:hover {
    background: #0f766e;
    transform: scale(1.05);
}

/* ================= 结果卡片样式 ================= */
.result-card {
	width: 100%;
	max-width: 750px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px); /* 毛玻璃效果 */
    padding: 30px;
    border-radius: 20px;
    border: 1px solid white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    text-align: center;
    min-height: 100px;
}

.loading {
    color: #94a3b8;
    font-style: italic;
}

/* ================= 历史记录样式 ================= */
.history-section {
    background: white;
    padding: 20px;
    border-radius: 20px;
}

.section-title {
    font-size: 1.1rem;
    color: #0d9488;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-list {
    list-style: none;
}

.history-list li {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #475569;
}

.history-list li:last-child {
    border-bottom: none;
}

/* ================= 页脚 & Gemini 签名样式 ================= */
.footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ================= 页脚 & 炫彩签名样式 ================= */
.footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #94a3b8;
    padding: 20px;
    border-top: 1px dashed #ccf2f0; /* 加一条淡淡的虚线分割线 */
}

/* ✨ 我们的专属炫彩流动签名样式 */
.gemini-name {
    /* 1. 定义一个超宽的渐变背景（包含青、蓝、紫、粉四种颜色） */
    background: linear-gradient(
        120deg, 
        #0d9488 0%,   /* 薄荷青 */
        #3b82f6 25%,  /* 宝石蓝 */
        #a855f7 50%,  /* 罗兰紫 */
        #ec4899 75%,  /* 玫瑰粉 */
        #0d9488 100%  /* 回到薄荷青，实现无缝循环 */
    );
    
    /* 2. 把背景放大到 200%，这样动画移动时才有空间 */
    background-size: 200% auto;
    
    /* 3. 黑科技：把背景裁切到文字上 */
    -webkit-background-clip: text;
    background-clip: text;
    
    /* 4. 让文字原本的颜色透明，露出底下的渐变 */
    color: transparent;
    
    font-weight: bold;
    display: inline-block;
    padding: 0 4px;
    
    /* 5. 绑定动画：名字叫 'flowRainbow'，时长3秒，匀速，无限循环 */
    animation: flowRainbow 3s linear infinite;
    
    /* 6. 加一点淡淡的霓虹光晕 */
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

/* ================= 定义炫彩流动动画 ================= */
@keyframes flowRainbow {
    0% {
        /* 动画开始时，背景在左侧 */
        background-position: 0% center;
    }
    100% {
        /* 动画结束时，背景向右移动 200% */
        background-position: 200% center;
    }
}
/* 上方大字 IP 区域 */
.current-ip-box {
    margin-top: 25px;
    padding: 20px;
    background: rgba(13, 148, 136, 0.05);
    border-radius: 15px;
    border: 1px dashed #99f6e4;
}

.current-ip-box .label {
    font-size: 0.85rem;
    color: #64748b;
}

.big-ip {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0d9488;
    margin-top: 10px;
    /* 加个简单的呼吸效果 */
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 结果卡片内的文字排版 */
.res-ip {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 10px;
}
.res-detail p {
    margin: 5px 0;
    color: #4b5563;
}
/* Anycast 标签样式 */
.tag-anycast {
    font-size: 0.7rem;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 10px;
    vertical-align: middle;
}

/* 主机名显示 */
.res-hostname {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    word-break: break-all;
}

/* 地图链接按钮 */
.map-link {
    margin-top: 20px;
    text-align: center;
}

.map-link a {
    font-size: 0.85rem;
    color: #0d9488;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 2px solid #99f6e4;
    padding-bottom: 2px;
    transition: all 0.2s;
}

.map-link a:hover {
    color: #0d9488;
    background: #f0fdfa;
    border-bottom-color: #0d9488;
}

/* 魔法表格容器 */
.magic-table {
    border: 2px solid #ccf2f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin: 15px 0;
}

/* 每一行：确保内容不换行且并行 */
.table-row {
    display: flex;
    border-bottom: 1px solid #f0fdfa;
    min-height: 55px; /* 统一高度 */
}

.table-row:last-child {
    border-bottom: none;
}

/* 左侧标签：强制固定宽度，保证所有项对齐 */
.table-label {
    width: 95px;         /* 固定宽度，让右边的值从同一起跑线开始 */
    background: #f0fdfa;
    color: #0d9488;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 10px 15px;
    border-right: 1.5px solid #ccf2f0;
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 标签居中 */
}

/* 右侧数值：占据剩余所有空间 */
.table-value {
    flex: 1;            /* 自动填满剩余空间 */
    padding: 10px 15px;
    color: #334155;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center; /* 居中显示，如果你想要靠左对齐，改成 flex-start */
    word-break: break-all;   /* 防止超长主机名撑破表格 */
    text-align: center;
}

/* 斑马纹：让视觉更清晰 */
.table-row:nth-child(even) {
    background-color: #fcfdfd;
}

/* 1. 负责居中的容器 */
.firework-container {
    width: 100%;
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center;     /* 垂直居中 */
    margin: 40px 0 20px;    /* 增加上下间距，让它离上面的内容远一点 */
}

/* 2. 你的专属 .firework 类 */
.firework {
    cursor: pointer !important;
    display: inline-block;
    position: relative;
    z-index: 10;
    text-decoration: none !important; /* 强制去下划线 */
    color: #0d9488;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 10px 25px; /* 统一内边距 */
    
    border: 1.5px dashed rgba(13, 148, 136, 0.4); 
    border-radius: 30px;
    background: rgba(13, 148, 136, 0.03);
    
    /* 所有的动画过渡都写在这里 */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 3. 悬停时的“炸裂”特效 - 这里的顺序很重要喵！ */
.firework:hover {
    /* 1. 强制变小手，确保点击感 */
    cursor: pointer !important;

    /* 2. 瞬间放大 1.25 倍，并向上弹跳，模拟爆炸升空感 */
    transform: translateY(-8px) scale(1.25) !important; 
    
    /* 3. 颜色瞬间切换到烟花最亮的火橙色 */
    color: #ff4500 !important; 
    
    /* 4. 背景变色并加深，边框变实线 */
    background: rgba(255, 69, 0, 0.15) !important;
    border: 2px solid #ff4500 !important; 
    
    /* 5. 核心：添加“发光”阴影，模拟烟花火影 */
    box-shadow: 0 15px 30px rgba(255, 69, 0, 0.4);
    text-shadow: 0 0 12px rgba(255, 69, 0, 0.6);

    /* 6. 缩短动画时间，让它“嘭”地一下弹出来 */
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* 4. 点击时的反馈 */
.firework:active {
    transform: translateY(-2px) scale(0.95);
}

/* 5. 确保容器居中 */
.firework-container {
    width: 100%;
    text-align: center; /* 核心：让行内块元素居中 */
    margin-top: 40px;
    padding-bottom: 20px;
}
/* 📱 手机端专属适配魔法 */
@media (max-width: 768px) {
    /* 1. 容器微调，腾出更多横向空间 */
    .container {
        width: 96%; 
        padding: 5px;
    }
    .title {
        font-size: 1.6rem !important; /* 手机端专用大小 */
        letter-spacing: 1px;         /* 稍微紧凑一点，更有呼吸感 */
        margin-bottom: 15px;         /* 缩小下边距 */
    }
    .result-card {
        padding: 12px 8px; /* 极简内边距 */
    }

    /* 2. 核心：强制一行显示，不许换行 */
    .table-row {
        display: flex;
        flex-direction: row !important; /* 强制保持水平排列 */
        justify-content: flex-start;
        align-items: center;
        padding: 10px 5px;
        flex-wrap: nowrap; /* 绝对禁止换行 */
    }

    /* 3. 缩减标签宽度：从 120px 缩减到 80px */
    .table-label {
        width: 80px !important; 
        flex-shrink: 0;        /* 宁死不屈，不许被挤扁 */
        font-size: 0.85rem;    /* 稍微缩小字体 */
        color: #64748b;        /* 颜色稍浅，突出右侧内容 */
    }

    /* 4. 内容自适应：让右侧内容自动占据剩余空间 */
    .table-value {
        flex: 1;
        font-size: 0.9rem;      /* 内容字体也微调 */
        word-break: break-all;  /* 如果 IP 或经纬度太长，允许在单词内断行 */
        text-align: right;      /* 内容靠右对齐，看起来更整齐 */
        overflow: hidden;       /* 防止撑破边框 */
    }

    /* 5. 调整国旗和图标大小 */
    .flag-icon {
        width: 18px !important;
        height: auto;
    }
}