/* main.css */

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
    background: #0a1929;
    min-height: 100vh;
}

/* 导航栏样式 */
.navbar {
    background: transparent !important;
    padding: 0;
    width: 100%;
}

.nav-link {
    position: relative;
    padding: 1rem 1.2rem;
    color: #475569;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(56, 178, 172, 0.2), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.nav-link:hover:before {
    transform: translateX(100%);
}

.nav-link:hover {
    color: #38b2ac;
    text-shadow: 0 0 8px rgba(56, 178, 172, 0.5);
}

/* 基础布局样式 */
.container-fluid {
    padding: 0 !important;
    margin: 0;
}

/* 行布局 */
.row {
    display: flex;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* 左侧导航栏 */
.col-sm-3 {
    flex: 0 0 250px;
    max-width: 250px;
    padding: 0;
    background: rgba(8, 20, 35, 0.85);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(56, 178, 172, 0.1);
    min-height: calc(100vh - 200px);
}

/* 主内容区域 */
.col-sm-9 {
    flex: 1;
    padding: 20px 30px;
    max-width: none;
    background: rgba(255, 255, 255, 0.02);
    color: #334155;
}

/* 导航菜单样式 */
.nav-pills {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.nav-pills .nav-link {
    border-radius: 12px;
    padding: 12px 16px;
    color: #a3b1c2;
    transition: all 0.3s ease;
    margin: 0;
}

.nav-pills .nav-link:hover {
    background: rgba(56, 178, 172, 0.15);
    transform: translateX(5px);
    color: #38b2ac;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #38b2ac 0%, #2c5282 100%);
    color: white;
    box-shadow: 
        0 4px 6px -1px rgba(56, 178, 172, 0.2),
        0 2px 4px -1px rgba(56, 178, 172, 0.1);
}

/* 顶部导航栏调整 */
.navbar {
    padding: 1rem 2rem;
    width: 100%;
}

/* 内容区域容器 */
.right {
    margin: 0;
    height: 100%;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-sm-3 {
        flex: 0 0 auto;
        max-width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(99, 179, 237, 0.1);
    }
    
    .col-sm-9 {
        padding: 15px;
    }
    
    .nav-pills {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-pills .nav-link {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* 修复页脚定位 */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 25, 41, 0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(99, 179, 237, 0.1);
    padding: 10px 0;
    z-index: 1000;
}

/* 按钮样式 */
button {
    background: rgba(56, 178, 172, 0.1);
    color: #38b2ac;
    border: 2px solid rgba(56, 178, 172, 0.3);
    padding: 0.75rem 1.75rem;
    border-radius: 14px;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 按钮悬效果 */
button:hover {
    background: rgba(56, 178, 172, 0.15);
    border-color: #38b2ac;
    transform: translateY(-1px);
    box-shadow: 
        0 0 0 4px rgba(56, 178, 172, 0.1),
        0 4px 12px rgba(56, 178, 172, 0.2);
    color: #38b2ac;
}

/* 按钮激活状态 */
button:active {
    transform: translateY(1px);
    box-shadow: 
        0 0 0 3px rgba(56, 178, 172, 0.1),
        0 2px 6px rgba(56, 178, 172, 0.1);
}

/* 按钮发光动画 */
button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(56, 178, 172, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

button:hover::after {
    opacity: 1;
}

/* 按钮内部光效 */
button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 25%,
        rgba(56, 178, 172, 0.1) 50%,
        transparent 75%
    );
    background-size: 250% 250%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 200%;
    }
}

/* 主要按钮样式 */
button.primary {
    background: linear-gradient(135deg, #38b2ac 0%, #2c5282 100%);
    color: white;
    border: none;
}

button.primary:hover {
    background: linear-gradient(135deg, #319795 0%, #2b6cb0 100%);
    box-shadow: 
        0 0 0 4px rgba(56, 178, 172, 0.15),
        0 8px 20px rgba(56, 178, 172, 0.3);
}

/* 禁用状态 */
button:disabled {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button:disabled::before,
button:disabled::after {
    display: none;
}

/* 按钮尺寸变体 */
button.small {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    border-radius: 12px;
}

button.large {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    border-radius: 16px;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 12px;
}

.button-group button {
    flex: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    button {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
}

/* 输入框样式 */
input[type="text"], 
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    color: #1e293b;
    font-size: 14px;
}

textarea {
    min-height: 80px;
    height: auto;
    resize: vertical;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 
        0 0 0 4px rgba(56, 189, 248, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* 工具列表样式 */
.tool {
    list-style: none;
    padding: 0;
}

.tool li {
    margin-bottom: 1rem;
    color: #334155;
}

.tool a {
    display: block;
    padding: 1.2rem 1.5rem;
    color: #334155;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(56, 178, 172, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.tool a:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(56, 178, 172, 0.1), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.tool a:hover:before {
    transform: translateX(100%);
}

.tool a:hover {
    color: #38b2ac;
    transform: translateX(5px);
    border-color: #38b2ac;
    box-shadow: 
        0 12px 20px -5px rgba(56, 178, 172, 0.2),
        0 8px 10px -5px rgba(56, 178, 172, 0.1),
        0 0 15px rgba(56, 178, 172, 0.2);
    text-shadow: 0 0 8px rgba(56, 178, 172, 0.5);
}

/* 分割线样式 */
.line {
    margin: 2rem 0;
    height: 1px;
    background: linear-gradient(to right,
        rgba(226, 232, 240, 0) 0%,
        rgba(226, 232, 240, 1) 50%,
        rgba(226, 232, 240, 0) 100%
    );
}

/* 页脚样式 */
.mt-5.p-2.bg-dark {
    background: rgba(10, 25, 41, 0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(99, 179, 237, 0.1);
}

/* 加载动画样式 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, .8);
}

#loading div {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#loading div div {
    border: 16px solid rgba(8, 20, 35, 0.1);
    border-top: 16px solid #38b2ac;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* 页面加载动画 */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px);
        filter: blur(10px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
        filter: blur(0);
    }
}

/* IP显示样式 */
.showmyip {
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* 代码入框样式 */
.ip_aggregation_input,
.ip_info_input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    min-height: 300px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: #1e293b;
}

/* 动画效果 */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.2); }
    50% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); }
    100% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.2); }
}

.tool a:hover,
button:hover {
    animation: glow 2s infinite;
}

/* 按钮容器样式 */
.button-wrapper {
    display: flex;
    gap: 12px;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.button-wrapper button {
    flex: 1 1 auto;
    min-width: 160px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .button-wrapper {
        flex-direction: column;
    }
    
    .button-wrapper button {
        width: 100%;
    }
}

/* 顶部标题区域 */
.p-5.bg-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

/* DNS查询结果样式 */
.dns-results {
    margin-top: 20px;
}

.dns-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(56, 178, 172, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dns-section h3 {
    color: #1e293b;
    font-size: 18px;
    margin-bottom: 15px;
}

.dns-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px solid rgba(56, 178, 172, 0.1);
}

.json-display {
    background: transparent;
    padding: 15px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #334155;
    margin: 0;
}

/* JSON语法高亮 */
.json-key {
    color: #38b2ac;
    font-weight: 600;
}

.json-string {
    color: #9f7aea;
}

.json-number {
    color: #63b3ed;
}

.json-boolean {
    color: #b794f4;
}

.json-null {
    color: #fc8181;
}

/* 导航栏背景 */
.bg-dark {
    background-color: #212529 !important;
}

.navbar-dark {
    width: 100%;
}

/* 列布局 */
.col-sm-3, .col-sm-9, .col-sm-10, .col-sm-12 {
    padding: 0;  /* 移除列的内边距 */
}

/* 列样式调整 */
.col-sm-8, .col-sm-4 {
    padding: 0;  /* 移除列的内边距 */
}

/* 导航栏内部间距 */
.navbar {
    padding: 1rem 2rem;  /* 导航栏内部保持间距 */
}

/* 行样式 */
.row.bg-dark {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
}

/* 列样式 */
.col-sm-8, .col-sm-4 {
    padding: 0;
}

/* 导航项目 */
.nav-item {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* IP计算器布局 */
.ip-calculator-container {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.ip-calculator-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(56, 178, 172, 0.1);
}

.ip-calculator-section label {
    display: block;
    margin-bottom: 10px;
    color: #334155;
}

.ip-calculator-section .input {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.ip-calculator-section input,
.ip-calculator-section select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(56, 178, 172, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: #475569;
}

.ip-calculator-section button {
    width: 100%;
}