/* ===== 重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, #f6f9fc 0%, #e6f0f5 100%);
    padding: 20px 24px;
}

.container {
    max-width: 960px;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 32px;
    padding: 28px 36px;
    box-shadow: 0 10px 40px -8px rgba(0, 20, 30, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: box-shadow 0.25s ease;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.container:hover {
    box-shadow: 0 18px 50px -10px rgba(0, 40, 60, 0.18), inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: #1a2e3b;
    margin-bottom: 26px;
    margin-top: 4px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}


.subtitle-wrapper {
    text-align: center;
    flex-shrink: 0;
}

.subtitle {
    text-align: center;
    font-size: 14px;
    color: #5a6f8c;
    background: rgba(43, 127, 158, 0.06);
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    margin: 0 auto 24px;
    border: 1px solid rgba(43, 127, 158, 0.08);
}

/* ===== 内容包装器 ===== */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== 输入区域 ===== */
.combined-input-area {
    border: 2px dashed rgba(180, 201, 214, 0.5);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.4);
    transition: border-color 0.25s, background 0.2s;
    height: 280px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.combined-input-area.dragover {
    border-color: #2b7f9e;
    background: rgba(43, 127, 158, 0.04);
}

.combined-input-area.dragover .upload-section {
    border-color: #2b7f9e;
}

.upload-section {
    padding: 12px 16px 8px;
    text-align: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    cursor: default;
}

.upload-icon {
    font-size: 2rem;
    color: #7a8fa8;
    opacity: 0.5;
    margin-bottom: 4px;
}

.upload-text {
    font-weight: 500;
    color: #1a2e3b;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.upload-hint {
    color: #6a7f9a;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.text-input-section {
    flex: 1;
    padding: 14px 18px 14px;
    display: flex;
}

.text-input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 13px;
    resize: none;
    outline: none;
    background: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    color: #1a2e3b;
    line-height: 1.6;
}

.text-input::placeholder {
    color: #a0b4cc;
    font-weight: 350;
    opacity: 0.7;
}

.file-input {
    display: none;
}

/* ===== 按钮组 ===== */
.btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    flex-shrink: 0;
}

.btn-group button {
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #1a2e3b;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.btn-group button i {
    font-size: 13px;
}

.btn-group button:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.btn-group button:active {
    transform: translateY(0px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #1a2e3b !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.btn-secondary:hover {
    background: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

/* ===== 错误信息 ===== */
.error-message {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.04);
    padding: 10px 18px;
    border-radius: 12px;
    margin-top: 14px;
    display: none;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(192, 57, 43, 0.08);
    font-size: 14px;
    flex-shrink: 0;
}

/* ===== 结果卡片 ===== */
.result-area {
    margin-top: 16px;
    display: none;
    flex: 0 0 auto;
    overflow-y: auto;
}

.result-area.has-result {
    display: block;
    flex: 1;
}

.result-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 18px 22px 22px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-top: 16px;
}

.result-card:first-child {
    margin-top: 0;
}

.result-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #1a2e3b;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.result-card h2 i {
    color: #2b7f9e;
    font-size: 18px;
}

.result-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.result-card td {
    padding: 10px 14px;
    vertical-align: top;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.result-card tr:last-child td {
    border-bottom: none;
}

.result-card td:first-child {
    font-weight: 500;
    color: #5a6f8c;
    white-space: nowrap;
    width: 130px;
}

.result-card td:last-child {
    color: #1a2e3b;
    word-break: break-all;
}

.result-card .raw {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    word-break: break-all;
}

.san-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.san-item {
    background: rgba(43, 127, 158, 0.06);
    color: #2b7f9e;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid rgba(43, 127, 158, 0.08);
}

/* ===== 使用说明 ===== */
.info-box {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 14px 20px;
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.info-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #1a2e3b;
    margin-bottom: 8px;
    font-weight: 600;
}


.info-box ul {
    padding-left: 20px;
    color: #2a3f5e;
    font-size: 13px;
    line-height: 1.8;
    list-style-type: none;
}

.info-box li::before {
    content: "·";
    font-weight: bold;
    display: inline-block;
    width: 18px;
    margin-left: -18px;
}

.info-box li {
    margin-bottom: 4px;
}

.info-box code {
    background: rgba(43, 127, 158, 0.06);
    padding: 0 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: Consolas, monospace;
    color: #1a2e3b;
}

/* ===== 底部 ===== */
footer {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 18px;
    margin-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    color: #5a6f8c;
    font-size: 13px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

footer a {
    color: #2e2f30;
    text-decoration: none;
    transition: 0.15s;
    font-weight: 450;
}

footer a:hover {
    color: #2b7f9e;
}

footer span {
    color: #c8d4e2;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
        border-radius: 24px;
        min-height: calc(100vh - 32px);
    }

    h1 {
        font-size: 20px;
        gap: 8px;
        margin-bottom: 18px;
    }

    .combined-input-area {
        height: auto;
        min-height: 200px;
    }

    .upload-text {
        display: none;
    }

    .upload-section {
        padding: 8px 10px 4px;
    }

    .upload-icon {
        font-size: 1.6rem;
    }

    .upload-hint {
        font-size: 0.7rem;
    }

    .text-input {
        font-size: 14px;
    }

    .btn-group {
        flex-direction: column;
        gap: 10px;
    }

    .btn-group button {
        width: 100% !important;
        justify-content: center;
        padding: 10px 16px;
    }

    .result-card {
        padding: 14px 14px 16px;
    }

    .result-card td:first-child {
        width: 90px;
        font-size: 13px;
    }

    .result-card td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .info-box {
        padding: 12px 14px;
        margin-top: 16px;
    }

    footer {
        gap: 12px;
        flex-direction: column;
        align-items: center;
        padding-top: 14px;
        margin-top: 16px;
    }

    footer span {
        display: none;
    }

    footer a {
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 6px;
    }

    .container {
        padding: 14px 10px;
        border-radius: 18px;
        min-height: calc(100vh - 20px);
    }

    .combined-input-area {
        min-height: 160px;
    }

    .result-card td:first-child {
        width: 70px;
        font-size: 12px;
    }

    .result-card td {
        font-size: 12px;
        padding: 6px 8px;
    }

    .result-card .raw {
        font-size: 11px;
    }

    .info-box ul {
        font-size: 12px;
        padding-left: 16px;
    }

    .info-box code {
        font-size: 11px;
    }

    footer {
        font-size: 12px;
        gap: 6px;
        padding-top: 12px;
        margin-top: 12px;
    }

    .san-item {
        font-size: 12px;
        padding: 2px 10px;
    }
}