* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft Yahei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #606266;
    font-weight: 500;
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 5px;
}

button:hover {
    transform: translateY(-2px);
}

button:disabled {
    background: #c0c4cc;
    cursor: not-allowed;
    transform: none;
}

.result {
    margin-top: 25px;
    padding: 18px;
    border-radius: 8px;
    display: none;
    word-break: break-all;
}

.success {
    background: #f0f9eb;
    border: 1px solid #e1f3d8;
    color: #67c23a;
}

.error {
    background: #fef0f0;
    border: 1px solid #fde2e2;
    color: #f56c6c;
}

.serial {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 12px 0;
    letter-spacing: 1px;
    user-select: all;
}

.end-time {
    font-size: 14px;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

.warn-tip {
    font-size: 12px;
    text-align: center;
    color: #e6a23c;
    margin-top: 8px;
}

.tip {
    margin-top: 15px;
    font-size: 13px;
    color: #909399;
    text-align: center;
    line-height: 1.6;
}

.debug-log-wrap {
    margin-top: 20px;
    display: none;
}

.log-title {
    font-size: 14px;
    margin-bottom: 6px;
    color: #667eea;
}

#debugLog {
    width: 100%;
    height: 160px;
    border: 1px solid #eee;
    padding: 8px;
    font-size: 12px;
    overflow-y: auto;
    background: #f8f9fa;
    white-space: pre-wrap;
}

.slider-mask {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.slider-box {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
}

.slider-bg-box {
    position: relative;
    width: 300px;
    height: 150px;
    overflow: hidden;
}

#bgCanvas {
    width: 300px;
    height: 150px;
    display: block;
}

#blockCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    cursor: grab;
}

.slider-track {
    width: 300px;
    height: 36px;
    background: #eee;
    margin-top: 12px;
    position: relative;
    border-radius: 4px;
}

.slider-drag {
    width: 40px;
    height: 36px;
    background: #667eea;
    border-radius: 4px;
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.slider-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    pointer-events: none;
}

.slider-close {
    text-align: right;
    margin-bottom: 8px;
    cursor: pointer;
    color: #999;
}