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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 600px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.main-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.input-section {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

#longUrl {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#longUrl:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-icon {
    font-size: 1.2rem;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: #666;
    font-size: 1rem;
}

.result-section {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    font-weight: bold;
}

.result-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.result-item {
    margin-bottom: 20px;
    text-align: left;
}

.result-item label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.copy-group {
    display: flex;
    gap: 10px;
}

.copy-group input,
#shortUrl {
    flex: 1;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    font-family: 'Courier New', monospace;
}

.btn-copy {
    padding: 14px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #5568d3;
}

.btn-copy.copied {
    background: #11998e;
}

.url-display {
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    word-break: break-all;
    color: #666;
    font-size: 0.9rem;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

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

.error-section {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.error-section p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.info-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.info-content h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.info-content p {
    font-size: 0.8rem;
    opacity: 0.9;
}

.hidden {
    display: none !important;
}

/* 腾讯广告联盟样式 */
.ad-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.ad-section .ad-title {
    font-size: 1em;
    margin-bottom: 15px;
    color: #999;
    font-weight: 600;
    padding-left: 10px;
    position: relative;
}

.ad-section .ad-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    border-radius: 2px;
}

#ad-container {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-ad-container {
    width: 100%;
    max-width: 800px;
}

.ad-content {
    padding: 15px;
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.ad-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.cta-button {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.ad-image {
    width: 100%;
    margin-bottom: 15px;
}

.ad-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.ad-video {
    width: 100%;
    margin-bottom: 15px;
}

.ad-video video {
    width: 100%;
    border-radius: 8px;
}

.advertiser {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.ad-loading {
    text-align: center;
    color: #999;
    padding: 40px;
}

.ad-error {
    text-align: center;
    color: #f44336;
    padding: 20px;
    display: none;
}

/* 底部页脚 */
.footer {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
}

.copyright {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.copyright a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
}

.copyright a:hover {
    color: white;
    border-bottom-color: white;
}

.separator {
    margin: 0 4px;
    opacity: 0.6;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .main-card {
        padding: 30px 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .copy-group {
        flex-direction: column;
    }

    .info-section {
        grid-template-columns: 1fr;
    }

    .copyright {
        flex-direction: column;
        gap: 5px;
    }

    .separator {
        display: none;
    }
}
