/* static/style.css */

body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 800px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #333;
}

.card {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

#upload-area input[type="file"] {
    margin-bottom: 10px;
}

#uploadButton {
    display: inline-block;
    background: #007AFF;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#uploadButton:hover {
    background: #0056CC;
}

.test-button {
    display: inline-block;
    background: #f0ad4e;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-left: 10px;
}

.test-button:hover {
    background: #ec971f;
}

#fileName {
    margin-top: 10px;
    font-style: italic;
    color: #555;
}

.upload-tip {
    margin-top: 15px;
    padding: 12px;
    background: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    border-left: 3px solid #86868b;
}

.upload-tip p {
    margin: 0;
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.4;
}

.progress-container {
    width: 100%;
    margin: 15px 0;
}

.progress-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007AFF, #0056CC);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
    color: #666;
}

/* 处理状态样式 */
.processing-status {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    color: #495057;
    margin-bottom: 10px;
    text-align: center;
}

.processing-status.uploading {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.processing-status.processing {
    background-color: #fff3e0;
    border-color: #ff9800;
    color: #f57c00;
}

.processing-status.completed {
    background-color: #e8f5e8;
    border-color: #4caf50;
    color: #388e3c;
}

.processing-status.failed {
    background-color: #ffebee;
    border-color: #f44336;
    color: #d32f2f;
}

.analysis-result pre,
.raw-logs-area pre {
    background-color: #eee;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    white-space: pre-wrap; /* Wrap long lines */
    word-wrap: break-word; /* Break words if necessary */
}

.raw-logs-area details summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 10px;
}

.message-area {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
}

.alert-info {
    background-color: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

.alert-warning {
    background-color: #fcf8e3;
    color: #8a6d3b;
    border: 1px solid #faebcc;
}

.alert-danger {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.alert-success {
     background-color: #dff0d8;
     color: #3c763d;
     border: 1px solid #d6e9c6;
}


/* Basic Card Styles (can be extended) */
.card-header {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.card-body {
    /* Add styling for card body content */
}

/* Basic strong tag styling for emphasis */
strong {
    font-weight: bold;
}
.hidden {
    display: none;
}

/* Results area overlay styles */
.results-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
    z-index: 10;
    border-radius: 5px;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-content h2 {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.overlay-content .subtitle {
    font-size: 16px;
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.price-highlight {
    font-weight: bold;
    font-style: italic;
    color: #e74c3c;
    text-shadow: 0 1px 2px rgba(231, 76, 60, 0.2);
}

.payment-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-code-payment {
    display: flex;
    justify-content: center;
}

.payment-qr-code {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.payment-qr-placeholder {
    width: 120px;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #999;
    background: #f9f9f9;
}

.payment-qr-placeholder p {
    margin: 8px 0 4px 0;
    font-size: 14px;
    font-weight: 500;
}

.payment-qr-placeholder small {
    font-size: 12px;
    color: #bbb;
}

.payment-countdown {
    margin-top: 3px;
    text-align: center;
}

.countdown-time {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    font-family: 'Courier New', monospace;
}

.price-info {
    text-align: center;
    margin-top: 8px;
}

.price {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 3px;
}

.price-desc {
    font-size: 14px;
    color: #666;
}

.results-content {
    position: relative;
}

.results-content.blurred {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
    opacity: 0.7;
}

#results-area {
    position: relative;
    min-height: 200px;
}

/* Developer notice styles */
.developer-notice {
    background: #fbfbfd;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.developer-notice h3 {
    color: #1d1d1f;
    font-size: 19px;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.notice-content {
    color: #6e6e73;
    line-height: 1.47059;
    font-size: 17px;
    letter-spacing: -0.022em;
}

.notice-content p {
    margin-bottom: 16px;
}

.notice-content p:last-child {
    margin-bottom: 0;
}

.notice-content strong {
    color: #1d1d1f;
    font-weight: 600;
}

.supporters-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #d2d2d7;
}

.supporters-title {
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
    font-size: 17px;
    letter-spacing: -0.022em;
}

.supporters-list {
    font-size: 15px;
    color: #6e6e73;
    line-height: 1.47059;
    letter-spacing: -0.022em;
}

.supporter {
    background: #fdf2f8;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(255, 192, 203, 0.2);
}

/* Footer 样式 */
.footer {
    margin-top: 30px;
    padding: 20px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.footer-content a {
    color: #666;
    text-decoration: none;
}

.footer-content a:hover {
    color: #333;
    text-decoration: underline;
}

/* 公益说明常驻挂件样式 */
.charity-widget {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 220px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.25), 0 3px 15px rgba(255, 105, 180, 0.15);
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(15px);
    overflow: hidden;
}

.charity-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    50% { transform: translateX(0%) translateY(0%) rotate(180deg); }
}

.charity-widget.minimized {
    transform: translateY(calc(100% - 40px));
}

.charity-widget.minimized .charity-body {
    display: none;
}

.charity-content {
    background: rgba(255, 255, 255, 0.92);
    margin: 2px;
    border-radius: 14px;
    padding: 14px;
    position: relative;
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 192, 203, 0.3);
    z-index: 1;
}

.charity-minimize {
    position: absolute;
    top: 8px;
    right: 10px;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    border: none;
    font-size: 14px;
    color: white;
    cursor: pointer;
    padding: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 3px 12px rgba(255, 154, 158, 0.4);
    font-weight: bold;
}

.charity-minimize:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.6);
}

.charity-widget.minimized .minimize-icon {
    transform: rotate(180deg);
}

.charity-header {
    margin-bottom: 10px;
    text-align: center;
    padding-right: 25px;
}

.charity-header h4 {
    margin: 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.charity-body {
    color: #555;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.charity-body > p {
    margin: 0 0 10px 0;
    font-size: 12px;
    text-align: center;
    color: #666;
}

.charity-stats {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: rgba(255, 182, 193, 0.05);
    border-radius: 8px;
}

.stats-text {
    font-size: 10px;
    color: #888;
    line-height: 1;
}

.stats-number {
    font-size: 11px;
    font-weight: 600;
    color: #e91e63;
}



.charity-support {
    text-align: center;
}

.charity-support > p {
    margin: 8px 0 6px 0;
    font-size: 11px;
    font-weight: 500;
    color: #333;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    margin: 6px 0 0 0;
}

.qr-code-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 2px solid rgba(255, 182, 193, 0.5);
    object-fit: cover;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(255, 182, 193, 0.2);
}

.qr-code-image:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.4);
}

.qr-placeholder {
    width: 80px;
    height: 80px;
    border: 2px dashed rgba(255, 182, 193, 0.6);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ff69b4;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(255, 192, 203, 0.15));
    position: relative;
    overflow: hidden;
}

.qr-placeholder::after {
    content: '✨';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.qr-placeholder p {
    margin: 4px 0 2px 0;
    font-size: 11px;
    line-height: 1.2;
}

.qr-placeholder small {
    font-size: 10px;
    color: #bbb;
    line-height: 1;
}

/* 平板和桌面端适配 */
@media (min-width: 768px) {
    .charity-widget {
        width: 240px;
        bottom: 20px;
        right: 20px;
    }
    
    .charity-content {
        padding: 16px;
    }
    
    .qr-placeholder,
    .qr-code-image {
        width: 90px;
        height: 90px;
    }
    
    .charity-body > p {
        font-size: 13px;
    }
    
    .stats-text {
        font-size: 11px;
    }
    
    .stats-number {
        font-size: 12px;
    }
    
    .charity-header h4 {
        font-size: 15px;
    }
}

/* 大屏幕适配 */
@media (min-width: 1200px) {
    .charity-widget {
        width: 260px;
    }
    
    .qr-placeholder,
    .qr-code-image {
        width: 100px;
        height: 100px;
    }
}

/* 手机端适配 */
@media (max-width: 767px) {
    .charity-widget {
        bottom: 12px;
        right: 12px;
        width: 200px;
        max-width: calc(100vw - 24px);
    }
    
    .charity-content {
        padding: 12px;
    }
    
    .charity-header h4 {
        font-size: 13px;
    }
    
    .charity-body > p {
        font-size: 11px;
    }
    
    .stats-text {
        font-size: 9px;
    }
    
    .stats-number {
        font-size: 10px;
    }
    
    .qr-placeholder,
    .qr-code-image {
        width: 70px;
        height: 70px;
    }
    
    .qr-placeholder p {
        font-size: 9px;
    }
    
    .qr-placeholder small {
        font-size: 8px;
    }
}

/* 确保挂件不会阻挡主要内容 */
@media (max-width: 480px) {
    .charity-widget {
        bottom: 10px;
        right: 10px;
        width: 180px;
        max-width: calc(100vw - 20px);
    }
}

/* Results overlay responsive design */
@media (max-width: 767px) {
    .overlay-content {
        padding: 20px 15px;
        max-width: 300px;
    }
    
    .overlay-content h2 {
        font-size: 24px;
    }
    
    .overlay-content .subtitle {
        font-size: 14px;
    }
    
    .payment-qr-code,
    .payment-qr-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .price {
        font-size: 28px;
    }
    
    .payment-section {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .overlay-content {
        padding: 15px 10px;
        max-width: 280px;
    }
    
    .overlay-content h2 {
        font-size: 20px;
    }
    
    .overlay-content .subtitle {
        font-size: 13px;
    }
    
    .payment-qr-code,
    .payment-qr-placeholder {
        width: 90px;
        height: 90px;
    }
    
    .price {
        font-size: 24px;
    }
    
    .price-desc {
        font-size: 12px;
    }
}

/* Payment completion button styles */
.payment-buttons {
    margin-top: 20px;
    text-align: center;
}

.payment-check-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.payment-check-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.payment-check-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* FontAwesome icons fallback */
.fas {
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.fa-check::before {
    content: "✓";
}

.fa-spinner::before {
    content: "⟳";
}

.fa-spin {
    animation: fa-spin 1s infinite linear;
}

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