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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

header {
    background: linear-gradient(135deg, #ff4747, #ff7a7a);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.image-container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.image-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: 133%; /* 3:4 图片比例 */
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f8f8f8;
}

#buyerShowImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease-in-out;
}

.status-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem 2rem;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.status-indicator.visible {
    opacity: 1;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff4747;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 100px;
}

#refreshButton {
    background-color: #ff4747;
    color: white;
}

#refreshButton:hover {
    background-color: #e03e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 71, 0.3);
}

#saveButton {
    background-color: #4CAF50;
    color: white;
}

#saveButton:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

#copyButton {
    background-color: #2196F3;
    color: white;
}

#copyButton:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

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

/* 广告位样式 */
.ad-space {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 1rem auto;
    max-width: 1200px;
    width: 100%;
    overflow: hidden;
}

.top-ad {
    margin-top: 1rem;
    height: 100px;
}

.sidebar-ad-left,
.sidebar-ad-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 400px;
    display: none;
}

.sidebar-ad-left {
    left: 2rem;
}

.sidebar-ad-right {
    right: 2rem;
}

.bottom-ad {
    height: 100px;
    margin-bottom: 1rem;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

footer p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (min-width: 1024px) {
    .sidebar-ad-left,
    .sidebar-ad-right {
        display: block;
    }
    
    main {
        padding-left: 240px;
        padding-right: 240px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
    }
    
    .btn {
        width: 100%;
    }
    
    .top-ad, .bottom-ad {
        height: 80px;
    }
}

/* 消息提示样式 */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}