/* ============================================================
   测量转换工具 · 独立样式表
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    padding: 48px 20px;
    color: #e5e7eb;

    background:
        radial-gradient(circle at 20% 30%, rgba(0, 229, 255, .12), transparent 45%),
        radial-gradient(circle at 80% 20%, rgba(168, 85, 247, .12), transparent 40%),
        #050816;

    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, .03),
        rgba(255, 255, 255, .03) 1px,
        transparent 3px,
        transparent 6px
    );
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: .4;
}

/* =========================
   玻璃卡片
========================= */
.card {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 38px 42px;
    border-radius: 18px;

    background: rgba(17, 24, 39, .55);
    backdrop-filter: blur(18px);

    border: 1px solid rgba(0, 229, 255, .18);

    box-shadow:
        0 0 25px rgba(0, 229, 255, .08),
        0 0 60px rgba(168, 85, 247, .06);

    position: relative;
    transition: box-shadow .3s;
}

.card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 18px;
    background: linear-gradient(45deg, #00e5ff, #a855f7, #00ffcc, #00e5ff);
    z-index: -1;
    filter: blur(14px);
    opacity: .25;
}

/* =========================
   标题
========================= */
h1 {
    text-align: center;
    font-size: 34px;
    margin-bottom: 26px;
    font-weight: 800;

    background: linear-gradient(90deg, #00e5ff, #a855f7, #00ffcc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    letter-spacing: 1px;
    position: relative;
}

h1::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;

    color: #00e5ff;
    opacity: .15;

    transform: translateX(1px);
    animation: glitchSoft 3s infinite;
}

@keyframes glitchSoft {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

/* =========================
   子标题
========================= */
.subhead {
    text-align: center;
    font-size: 15px;
    color: #94a3b8;
    letter-spacing: .4px;
    margin-bottom: 32px;

    border-bottom: 1px dashed rgba(0, 229, 255, .25);
    padding-bottom: 18px;
}

/* =========================
   输入表单
========================= */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #cbd5e1;
    letter-spacing: .4px;
}

.form-group label .optional {
    color: #6b7280;
    font-size: 12px;
    margin-left: 4px;
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;

    background: rgba(15, 23, 42, .75);

    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;

    color: #fff;
    font-size: 14px;

    transition: .25s ease;

    box-shadow: inset 0 0 10px rgba(0, 0, 0, .45);
}

input[type="text"]:focus {
    outline: none;
    border-color: #00e5ff;
    box-shadow:
        0 0 0 2px rgba(0, 229, 255, .12),
        0 0 18px rgba(0, 229, 255, .25),
        0 0 30px rgba(168, 85, 247, .12);
}

/* =========================
   转换按钮
========================= */
#convertBtn {
    width: 100%;
    padding: 16px;

    border: none;
    border-radius: 14px;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
    color: white;

    background: linear-gradient(90deg, #00e5ff, #a855f7, #00ffcc);
    background-size: 200% 100%;

    transition: .3s ease;

    box-shadow: 0 0 18px rgba(0, 229, 255, .15);
}

#convertBtn:hover {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow:
        0 0 25px rgba(0, 229, 255, .25),
        0 0 40px rgba(168, 85, 247, .15);
}

#convertBtn:active {
    transform: translateY(1px);
}

/* =========================
   终端风输出区
========================= */
.conversion-block {
    background: #020617;
    border: 1px solid rgba(57, 255, 136, .18);
    border-radius: 14px;

    padding: 22px 26px;
    margin-bottom: 30px;

    font-family: Consolas, 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.9;

    color: #39ff88;

    box-shadow:
        inset 0 0 12px rgba(0, 0, 0, .7),
        0 0 18px rgba(57, 255, 136, .06);

    word-break: break-word;
}

/* 标题行独占一行 */
.conversion-block .label-line {
    display: block;
    color: #e5e7eb;
    font-weight: 500;
    margin-bottom: 4px;
}

/* 每条记录内联显示，块间用 <br> 换行 */
.conversion-block .row {
    display: inline;
}

.conversion-block .dim {
    color: #94a3b8;
    font-size: 13px;
}

.conversion-block .highlight {
    color: #00e5ff;
    font-weight: 600;
}

.conversion-block .key {
    color: #94a3b8;
}

.conversion-block .value {
    color: #39ff88;
    font-weight: 600;
}

.conversion-block .unit {
    color: #a855f7;
}

.conversion-block .placeholder {
    color: #4b5563;
    font-style: italic;
}

.conversion-block .error {
    color: #f87171;
    font-weight: 600;
}

/* =========================
   分隔线
========================= */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, .3), transparent);
    margin: 24px 0;
}

.divider-mid {
    margin: 14px 0;
}

/* =========================
   徽章
========================= */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;

    font-size: 12px;
    font-weight: 600;

    background: rgba(0, 229, 255, .15);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, .3);

    letter-spacing: .3px;
    margin-left: 8px;
}

/* =========================
   跳转区
========================= */
.link-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
}

.btn-converter {
    display: inline-block;

    padding: 16px 42px;
    border-radius: 14px;

    font-size: 17px;
    font-weight: 700;

    text-decoration: none;
    color: white;

    background: linear-gradient(90deg, #00e5ff, #a855f7, #00ffcc);
    background-size: 200% 100%;

    transition: .3s ease;

    box-shadow: 0 0 18px rgba(0, 229, 255, .15);

    border: none;
    cursor: pointer;

    letter-spacing: .8px;
    text-align: center;

    width: 100%;
    max-width: 380px;

    position: relative;
}

.btn-converter:hover {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow:
        0 0 25px rgba(0, 229, 255, .25),
        0 0 40px rgba(168, 85, 247, .15);
}

.btn-converter:active {
    transform: translateY(1px);
}

.btn-hint {
    font-size: 13px;
    color: #6b7280;
    letter-spacing: .3px;
}

/* =========================
   返回首页
========================= */
.back-link {
    text-align: center;
    margin-top: 24px;
    margin-bottom: 0;
}

.back-link a {
    color: #00e5ff;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: .3px;
    transition: .25s;
}

.back-link a:hover {
    color: #a855f7;
    text-shadow: 0 0 10px rgba(0, 229, 255, .4);
}

/* =========================
   响应式
========================= */
@media (max-width: 768px) {
    .card {
        padding: 24px 20px;
    }

    h1 {
        font-size: 26px;
    }

    .conversion-block {
        padding: 16px 18px;
        font-size: 13px;
        line-height: 1.8;
    }

    .btn-converter {
        padding: 14px 24px;
        font-size: 15px;
    }
}