:root {
    --primary-color: #22c1c3;
    --secondary-color: #fdbb2d;
    --text-color: #333;
    --border-color: #ddd;
    --bg-light: #f0f0f0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --info-color: #2196f3;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: rgb(34, 193, 195);
    background: radial-gradient(circle, rgba(34, 193, 195, 1) 0%, rgba(253, 187, 45, 1) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 24px 20px;
    text-align: center;
}

header h1 {
    color: white;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

main {
    padding: 24px;
}

.key-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.required {
    color: var(--error-color);
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 193, 195, 0.1);
}

input[type="text"]::placeholder {
    color: #999;
}

.bundle-hint {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.bundle-hint.show {
    display: block;
}

.bundle-hint.single {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 3px solid var(--info-color);
}

.bundle-hint.multi {
    background: #f3e5f5;
    color: #6a1b9a;
    border-left: 3px solid #9c27b0;
}

.bundle-info {
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.bundle-info h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.bundle-apps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bundle-app-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bundle-app-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(34, 193, 195, 0.1);
}

.bundle-app-label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.bundle-device-input {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: all 0.3s ease;
}

.bundle-device-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 193, 195, 0.1);
}

.bundle-device-input::placeholder {
    color: #999;
    font-size: 13px;
}

.bundle-app-tag {
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(34, 193, 195, 0.05);
}

.radio-label input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--primary-color);
}

.submit-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.log-container {
    margin-top: 24px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.log-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.clear-btn {
    padding: 6px 12px;
    font-size: 14px;
    color: var(--text-color);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #e0e0e0;
}

.log-box {
    max-height: 300px;
    min-height: 100px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: #f9f9f9;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-box:empty::before {
    content: '暂无日志信息';
    color: #999;
    font-style: italic;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: white;
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    animation: slideIn 0.3s ease;
}

.log-entry.success {
    border-left-color: var(--success-color);
    background: #f1f8f4;
}

.log-entry.error {
    border-left-color: var(--error-color);
    background: #fef1f0;
}

.log-entry.info {
    border-left-color: var(--info-color);
    background: #e3f2fd;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    padding: 16px;
    text-align: center;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color);
}

/* 滚动条样式 */
.log-box::-webkit-scrollbar {
    width: 8px;
}

.log-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.log-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.log-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 20px;
    }

    main {
        padding: 16px;
    }

    .container {
        border-radius: 12px;
    }

    .radio-group {
        gap: 8px;
    }

    .radio-label {
        padding: 10px 12px;
    }

    .log-box {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 16px;
    }

    header h1 {
        font-size: 18px;
    }

    main {
        padding: 12px;
    }
}