* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body {
    /* background 已移除：底色由 html 提供，body 刷背景会盖住 body::before 的极光色雾层 */
    min-height: 100vh;
    padding: 56px 24px 40px;
    display: flex;
    justify-content: center;
}

.wrap {
    width: 800px;
    max-width: 100%;
}

/* ---- 头部 ---- */
.head { text-align: center; margin-bottom: 30px; }
.head h1 {
    font-size: 27px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: .5px;
}
.head p { font-size: 14px; color: #94a3b8; margin-top: 9px; }

/* ---- 步骤卡 ---- */
.card {
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 20px;
    padding: 16px 34px 16px;
    box-shadow: 0 10px 34px -14px rgba(23, 52, 99, .1);
}

/* ---- 转换方向分段选择 ---- */
.seg {
    display: flex;
    justify-content: center;
    gap: 4px;
    background: #f2f5f9;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
    margin: 0 auto 26px;
}
.seg input { display: none; }
.seg span {
    display: inline-block;
    font-size: 13.5px;
    color: #64748b;
    padding: 8px 20px;
    border-radius: 9px;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
    letter-spacing: .3px;
}
.seg span:hover { color: #2563eb; }
.seg input:checked + span {
    background: #fff;
    color: #2563eb;
    font-weight: 600;
    box-shadow: 0 2px 8px -2px rgba(23, 52, 99, .18);
}

/* ---- 步骤 ---- */
.step { display: flex; gap: 20px; }
.step + .step { margin-top: 10px; }

.rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.rail .num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rail .num svg { display: block; }
.rail .line { flex: 1; width: 0; border-left: 2px dashed #d8e0ea; margin-top: 6px; }

.step .body { flex: 1; min-width: 0; padding-bottom: 4px; }

.lab { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.lab b { font-size: 16px; color: #0f172a; font-weight: 600; }
.lab span { font-size: 12.5px; color: #94a3b8; }

.box {
    position: relative;
    border: 1.5px dashed #d8e0ea;
    border-radius: 14px;
    background: #fafcfe;
    transition: border-color .2s, box-shadow .2s;
}
.box.dragover { border-color: #3b82f6; background: #eff6ff; }
.box:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.box.out { border-style: solid; background: #fafcfe; }

.up {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    color: #3b82f6;
    background: #eef4ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 4px 11px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background .15s;
    z-index: 1;
}
.up:hover { background: #dbeafe; }

.text-input {
    display: block;
    width: 100%;
    height: 130px;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    padding: 16px 18px;
    font: 13px/1.75 Consolas, 'JetBrains Mono', monospace;
    color: #44546b;
    border-radius: 14px;
}
.text-input::placeholder { color: #9dabbd; }
.box.out .text-input { color: #35507a; }

.file-input { display: none; }

/* ---- 操作区 ---- */
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.btn {
    height: 42px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: box-shadow .2s, opacity .2s;
    letter-spacing: .3px;
}
.btn.primary {
    padding: 0 38px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 6px 16px -5px rgba(47, 111, 240, .5);
}
.btn.primary:hover { box-shadow: 0 10px 22px -5px rgba(47, 111, 240, .6); }
.btn.primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn.ghost {
    padding: 0 24px;
    background: #fff;
    border: 1.5px solid #d8e0ea;
    color: #64748b;
    font-size: 13.5px;
    font-weight: 500;
}
.btn.ghost:hover { border-color: #cbd5e1; color: #44546b; }

/* ---- 加载 ---- */
.loading { display: none; text-align: center; padding: 22px 0 6px; }
.loading p { color: #0f172a; font-weight: 450; font-size: 14px; }
.spinner {
    border: 3.5px solid rgba(37, 99, 235, .12);
    border-radius: 50%;
    border-top-color: #3b82f6;
    width: 34px;
    height: 34px;
    animation: spin .9s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 错误 ---- */
.error-message {
    color: #e54545;
    background: rgba(229, 69, 69, .04);
    padding: 12px 18px;
    border-radius: 10px;
    margin-top: 18px;
    display: none;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(229, 69, 69, .1);
    font-size: 14px;
}
.error-message svg { flex-shrink: 0; }

/* ---- 下载条 ---- */
.result-area { display: none; margin-top: 22px; }
.match-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 14px;
    cursor: pointer;
}
.match-result b { font-size: 14px; }
.match-result .ok {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.match-success { background: #f0faf4; border: 1px solid #d5f0e0; }
.match-success b { color: #16a34a; }
.match-success .ok { background: #16a34a; }
.match-result:hover { filter: brightness(.98); }

/* ---- 隐私说明 ---- */
.privacy-note {
    text-align: center;
    font-size: 12px;
    color: #a9b4c4;
    margin-top: 16px;
}

/* ---- 方向提示弹窗 ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 50, .35);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal {
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    padding: 22px 24px 20px;
    box-shadow: 0 24px 60px -16px rgba(12, 31, 62, .4);
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 12px;
}
.modal-body { font-size: 13.5px; color: #44546b; line-height: 1.7; }
.modal-body strong { color: #2563eb; }
.modal-footer { margin-top: 18px; text-align: center; }
.modal-btn {
    height: 38px;
    padding: 0 34px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 2px;
}

/* ---- 移动端 ---- */

@media (max-width: 640px) {
    body { padding: 72px 14px 40px; }
    /* 图标移到左上角，输入框占满整行 */
    .step { position: relative; }
    .rail { position: absolute; top: 2px; left: 0; }
    .rail .line { display: none; }
    .rail .num { width: 28px; height: 28px; }
    .rail .num svg { width: 14px; height: 14px; }
    .lab { padding-left: 40px; }
    .rail { top: -4px; }
    .text-input { padding-top: 44px; }
    .box.out .text-input { padding-top: 16px; }
    .card { padding: 20px 16px 18px; border-radius: 16px; }
    .head h1 { font-size: 19px; }
    .seg { width: fit-content; margin: 0 auto; }
    .seg span { padding: 8px 12px; font-size: 12.5px; }
    .text-input { height: 150px; font-size: 12px; }
    .actions { flex-direction: column; }
    .btn { width: 100%; }
}
