* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100%;
    padding: 15px;
    -webkit-overflow-scrolling: touch;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    gap: 12px;
    position: relative;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon::before {
    content: '';
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
}

h1 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    position: relative;
}

.tips {
    margin-bottom: 15px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.tips h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 13px;
}

.tips ol {
    padding-left: 18px;
}

.tips li {
    margin-bottom: 4px;
    line-height: 1.6;
}

.input-group {
    margin-bottom: 15px;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    transition: border-color 0.3s;
    background: #fafafa;
    -webkit-appearance: none;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

textarea::placeholder {
    color: #999;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-paste {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-paste:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.button-group .btn {
    flex: 1;
    margin-bottom: 0;
}

.btn-watermark {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    display: none;
}

.btn-watermark:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-download {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    display: none;
}

.btn-download:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-copy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: none;
}

.download-buttons {
    display: none;
    flex-wrap: nowrap;
    gap: 6px;
}

.download-buttons .btn {
    white-space: nowrap;
    padding: 10px 8px;
    font-size: 13px;
    flex: 1;
    min-width: 0;
}

.wechat-guide {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
}

.wechat-guide-content {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: #333;
}

.wechat-guide-arrow {
    font-size: 40px;
    color: white;
    position: absolute;
    top: -50px;
    right: 20px;
}

.wechat-guide-content p {
    margin-bottom: 8px;
    font-size: 14px;
}

.wechat-guide-close {
    margin-top: 15px;
    padding: 10px 30px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.result {
    margin-top: 20px;
    display: none;
}

.video-info {
    margin-bottom: 15px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.video-info strong {
    color: #333;
    font-size: 13px;
}

.video-preview {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 500px;
    border-radius: 12px;
    background: #000;
    margin-bottom: 15px;
    object-fit: contain;
}

.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.loading-text {
    color: #666;
    font-size: 14px;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: #fff2f0;
    color: #ff4d4f;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid #ffccc7;
    white-space: pre-line;
}

.error-wrapper {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-copy-error {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    background: white;
    color: #ff4d4f;
    cursor: pointer;
    align-self: flex-start;
}

.btn-copy-error:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    display: none;
}

@media (max-width: 375px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 18px;
    }
    textarea {
        height: 80px;
    }
    .button-group {
        flex-direction: column;
    }
}

.version-switcher {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.version-buttons {
    display: flex;
    gap: 2px;
}

.version-btn {
    padding: 1px 4px;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    background: white;
    color: #666;
    font-size: 9px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.version-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.version-btn.simulate-active {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.version-btn:hover {
    border-color: #667eea;
}

.debug-checkbox {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    background: white;
    font-size: 9px;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.debug-checkbox input {
    width: 9px;
    height: 9px;
    cursor: pointer;
}

.debug-checkboxes {
    display: flex;
    gap: 2px;
    align-items: center;
}

.url-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.url-box span {
    color: #666;
    font-size: 12px;
}

.url-display {
    word-break: break-all;
    font-size: 11px;
    color: #333;
    line-height: 1.5;
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}

.btn-copy:hover {
    background: #5a6fd6;
}
