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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    user-select: none;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 20px;
    }
}

#preview {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 20px;
}

#inputform {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.inputbox {
    margin-bottom: 25px;
    position: relative;
}

.inputbox input {
    width: 100%;
    height: 50px;
    font-size: 16px;
    color: #333;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.inputbox input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.inputbox input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.inputbox .spanleft,
.inputbox .spanright {
    display: none;
}

.card-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 285px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    transition: all 0.3s ease;
}

.card-preview:has(svg) {
    background: transparent;
    border: none;
}

.card-preview svg {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#inputform table {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
    display: block;
}

#inputform table tr {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    cursor: pointer;
    display: table;
    width: 100%;
    table-layout: fixed;
}

#inputform table tr:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

#inputform table tr[data-selected="true"] {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#inputform table td {
    padding: 12px 16px;
    vertical-align: middle;
    font-weight: 500;
}

#inputform table td:first-child {
    width: 100px;
    text-align: center;
}

#inputform table canvas {
    border-radius: 8px;
    transition: transform 0.2s ease;
}

#inputform table tr:hover canvas {
    transform: scale(1.05);
}

.generate {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.generate:hover::before {
    left: 100%;
}

.generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.generate:active {
    transform: translateY(0);
}

.generate_url {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 50px 15px 20px;
    font-size: 14px;
    color: #475569;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    position: relative;
    transition: all 0.3s ease;
}

.generate_url:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

#copy_url_btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#copy_url_btn:hover {
    background: #5a67d8;
    transform: translateY(-50%) scale(1.1);
}

#copy_url_btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 滚动条样式 */
#inputform table::-webkit-scrollbar {
    width: 8px;
}

#inputform table::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#inputform table::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#inputform table::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    #preview,
    #inputform {
        padding: 20px;
        border-radius: 16px;
    }
    
    .card-preview {
        min-height: 200px;
    }
    
    #inputform table td {
        padding: 8px 12px;
    }
    
    #inputform table td:first-child {
        width: 80px;
    }
    
    .generate_url {
        font-size: 12px;
        padding: 12px 40px 12px 15px;
    }
}
