* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    position: relative;
}
/* 背景壁纸 */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    object-fit: cover;
    opacity: 0.85;
    pointer-events: none;
    user-select: none;
    animation: jumpIn 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards, float 35s ease-in-out infinite;
    opacity: 0;
    transform-origin: center;
}
.bg-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55px;
    height: 55px;
    border: 4px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
    z-index: 99;
}
@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes jumpIn {
    0% { opacity: 0; transform: translateY(120%) scale(1.6); }
    60% { opacity: 0.85; transform: translateY(-18%) scale(0.92); }
    100% { opacity: 0.85; transform: translateY(0) scale(1); }
}
@keyframes float {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    25% { transform: translate(3px,3px) rotate(0.6deg); }
    50% { transform: translate(-3px,-3px) rotate(-0.6deg); }
    75% { transform: translate(4px,-2px) rotate(0.4deg); }
}
/* 主容器 */
.container {
    width: 100%;
    max-width: 720px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 36px;
    box-shadow: 0 8px 32px rgba(20, 20, 40, 0.18);
}
.title {
    text-align: center;
    font-size: 2.6rem;
    background: linear-gradient(135deg, #2563eb, #06b6d4, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}
.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 32px;
}
/* 卡片模块 */
.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    border: 1px solid #f1f5f9;
}
.small-card {
    padding: 20px;
}
.card-title {
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before {
    content: "";
    width: 4px;
    height: 20px;
    background: linear-gradient(#2563eb, #06b6d4);
    border-radius: 2px;
}
/* 输入文本框 */
textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    transition: border 0.25s ease;
    outline: none;
}
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
/* 按钮行 */
.btn-row {
    display: flex;
    gap: 10px;
    margin: 14px 0;
    flex-wrap: wrap;
}
.btn {
    padding: 11px 18px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 110px;
}
.btn.primary {
    background: linear-gradient(135deg, #2563eb, #0684d4);
    color: white;
}
.btn.primary:hover {
    opacity: 0.92;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn.copy {
    background: #10b981;
    color: white;
}
.btn.copy:hover {
    background: #059669;
    transform: translateY(-2px);
}
.btn.clear {
    background: #ef4444;
    color: white;
}
.btn.clear:hover {
    background: #dc2626;
    transform: translateY(-2px);
}
/* 结果展示框 */
.result-box {
    min-height: 80px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
    font-size: 17px;
    white-space: pre-wrap;
    word-break: break-all;
    color: #0f172a;
}
/* 十六进制键盘区域 */
.display-area {
    margin-bottom: 16px;
}
.input-prefix {
    position: relative;
    margin-bottom: 10px;
}
.input-prefix span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #64748b;
    z-index: 1;
}
#hexInput {
    width: 100%;
    padding: 13px 14px 13px 42px;
    font-size: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
}
#hexOutput {
    height: 68px;
    font-size: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f1f5f9;
    border-radius: 8px;
    background: #f8fafc;
}
.keypad {
    display: grid;
    gap: 10px;
}
.hex-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.hex-keys button {
    padding: 14px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    cursor: pointer;
    transition: 0.2s;
}
.hex-keys button:hover {
    background: #e2e8f0;
}
.control-keys {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}
.control {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #475569;
    color: white;
    font-size: 15px;
    cursor: pointer;
}
.control:hover {
    background: #334155;
}
/* 底部提示 */
.tips {
    margin-top: 12px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}
/* 移动端适配 */
@media (max-width: 640px) {
    .container {
        padding: 22px 16px;
    }
    .title {
        font-size: 2rem;
    }
    .btn-row {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
}