/* ==========================================================
   IP地址查询 - 视觉参照 t.bt.cn（宝塔拨测）
   设计语言：灰底白卡、宝塔绿 #20a53a、2px 圆角、扁平无渐变
   ========================================================== */

:root {
    /* 品牌色 */
    --bt-green: #20a53a;
    --bt-green-hover: #63c075;
    --bt-green-dark: #187e2d;
    --bt-green-bg: #ebffe4;
    --bt-green-ring: rgba(32, 165, 58, .1);

    /* 背景 */
    --page-bg: #f2f3f5;
    --card-bg: #fff;

    /* 文字 */
    --text-title: #1a1a1a;
    --text-primary: #303133;
    --text-strong: #484848;
    --text-secondary: #606266;
    --text-muted: #909399;
    --text-placeholder: #bfbfbf;

    /* 描边 */
    --border: #efefef;
    --border-soft: #f5f5f5;
    --border-input: #e5e5e5;

    /* 状态色 */
    --danger: #db2828;
    --danger-bg: #fff5f5;
    --danger-ring: rgba(219, 40, 40, .1);

    --radius: 2px;
    --container: 1300px;
    --font: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
            "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--page-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color .2s;
}

a:hover {
    color: var(--bt-green);
}

/* ========== 顶部导航 ========== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 12px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--bt-green);
    letter-spacing: 1px;
}

/* 宝塔盾牌标，等比例 546:585 */
.nav-logo-mark {
    display: block;
    width: 28px;
    height: 30px;
    flex-shrink: 0;
}

.nav-logo:hover {
    color: var(--bt-green-dark);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    position: relative;
    font-size: 14px;
    color: var(--text-primary);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--bt-green);
}

.nav-link.is-active {
    font-weight: 500;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
    color: var(--text-strong);
    background: #fff;
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    transition: color .2s, border-color .2s;
}

.btn-outline:hover {
    color: var(--bt-green);
    border-color: var(--bt-green);
}

/* ========== 容器 ========== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 12px 40px;
}

/* 无 Hero 的页面（结果页/错误页）顶部留白 */
.page {
    margin-top: 28px;
}

/* ========== Hero ========== */
.hero {
    margin-top: 4rem;
    padding: 40px 0 12px;
}

.hero-text {
    text-align: center;
    margin-bottom: 36px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-title);
    margin: 0 0 20px;
    line-height: 1.3;
    letter-spacing: 8px;
}

.gradient-text {
    background: linear-gradient(to right, #abc13d, #68b43c, #29a73a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--bt-green);
}

.hero-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.hero-ip-echo {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 20px 0 0;
    line-height: 1.6;
    letter-spacing: .5px;
}

.ip-echo-divider {
    display: inline-block;
    width: 1px;
    height: 10px;
    vertical-align: middle;
    margin: 0 16px;
    background: #a7a7a7;
}

.ip-echo-value {
    color: var(--bt-green);
}

/* ========== 查询框 ========== */
.tool-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
}

.tool-row.has-error {
    margin-bottom: 36px;
}

.tool-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.tool-composite {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--bt-green);
    border-radius: var(--radius);
    transition: box-shadow .2s, border-color .2s;
}

.tool-composite:focus-within {
    box-shadow: 0 0 0 3px var(--bt-green-ring);
}

.tool-input-wrap.is-error .tool-composite {
    border-color: var(--danger);
}

.tool-input-wrap.is-error .tool-composite:focus-within {
    box-shadow: 0 0 0 3px var(--danger-ring);
}

.tool-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 44px;
    padding: 0 18px;
    font-size: 15px;
    line-height: 1.6;
    color: #222;
    font-family: inherit;
    border: none;
    outline: none;
    background: transparent;
}

.tool-input::placeholder {
    color: var(--text-placeholder);
}

.tool-input-err {
    position: absolute;
    top: calc(100% + 6px);
    left: 2px;
    margin: 0;
    font-size: 12px;
    color: var(--danger);
    line-height: 1.6;
    white-space: nowrap;
}

.start-btn {
    flex-shrink: 0;
    min-width: 140px;
    height: 44px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--bt-green);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .5s;
}

.start-btn:hover {
    background: var(--bt-green-hover);
    box-shadow: 0 4px 16px rgba(32, 165, 58, .4);
    transform: translateY(-1px);
}

.start-btn:active {
    transform: translateY(0);
}

/* 结果页里的紧凑表单 */
.tool-row.is-compact {
    max-width: 640px;
}

/* ========== 卡片 ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 24px;
}

/* 结果单行（整页唯一的 h1） */
.result-line {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-strong);
    line-height: 1.8;
}

.result-line mark {
    padding: 2px 8px;
    color: var(--bt-green);
    background: var(--bt-green-bg);
    border-radius: var(--radius);
    font-weight: 600;
}

.result-line .region {
    color: var(--bt-green);
}

/* ========== 区块标题（绿色标签 + 绿线） ========== */
.section {
    margin-top: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--bt-green);
}

.section-title-text {
    display: inline-block;
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
    background: var(--bt-green);
    border-radius: var(--radius);
}

/* ========== 归属信息明细行 ========== */
.detail {
    font-size: 14px;
    color: #000;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 9px 0;
}

.detail-label {
    flex-shrink: 0;
    width: 120px;
    color: var(--text-secondary);
    line-height: 18px;
}

.detail-value {
    flex: 1;
    min-width: 0;
    color: var(--text-strong);
    line-height: 18px;
    word-break: break-word;
}

.detail-value.is-ip {
    color: var(--bt-green);
    font-weight: 600;
}

/* ========== 错误提示 ========== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    font-size: 13px;
}

.alert.is-error {
    color: var(--danger);
    background: var(--danger-bg);
}

.alert-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

/* ========== 最近查询 ========== */
.recent-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.recent-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    transition: border-color .2s, box-shadow .2s;
}

.recent-item:hover {
    border-color: var(--bt-green);
    box-shadow: 0 2px 10px rgba(32, 165, 58, .12);
}

.recent-item a {
    display: block;
}

.recent-ip {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.recent-region {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

/* ========== 页脚 ========== */
.footer {
    margin-top: 48px;
    background: #2c2c2c;
    color: #b7b7b7;
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 12px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    padding: 32px 0 24px;
}

.footer-brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.footer-slogan {
    margin-top: 8px;
    font-size: 14px;
    color: #b7b7b7;
}

.footer-heading {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

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

.footer-list li {
    margin-bottom: 8px;
}

.footer-link {
    font-size: 13px;
    color: #b7b7b7;
}

.footer-link:hover {
    color: #fff;
}

.footer-bottom {
    padding: 16px 0;
    border-top: 1px solid #3d3d3d;
    font-size: 12px;
    color: #8a8a8a;
    text-align: center;
    line-height: 1.8;
}

.footer-bottom a {
    color: #8a8a8a;
}

.footer-bottom a:hover {
    color: #fff;
}

/* ========== 响应式 ========== */
@media (max-width: 767px) {
    .nav-inner {
        gap: 16px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-link {
        font-size: 13px;
    }

    .nav-logo {
        gap: 6px;
        font-size: 16px;
    }

    .nav-logo-mark {
        width: 24px;
        height: 26px;
    }

    .btn-outline {
        display: none;
    }

    .hero {
        margin-top: 2rem;
        padding: 24px 0 16px;
    }

    .hero-text {
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 22px;
        letter-spacing: 2px;
    }

    .hero-subtitle {
        font-size: 12px;
        line-height: 1.5;
    }

    .hero-ip-echo {
        margin-top: 12px;
        font-size: 12px;
    }

    .ip-echo-divider {
        margin: 0 8px;
    }

    .tool-row {
        flex-direction: column;
        gap: 12px;
    }

    .tool-input {
        padding: 0 14px;
        font-size: 14px;
    }

    .tool-input-err {
        white-space: normal;
    }

    .start-btn {
        width: 100%;
        min-width: 0;
        padding: 0 24px;
        font-size: 15px;
    }

    .card {
        padding: 16px;
    }

    .result-line {
        font-size: 15px;
    }

    .detail-label {
        width: 78px;
    }

    .recent-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 0 16px;
    }
}
