/* README查看器和统计系统样式 */

/* README模态框 */
.readme-modal {
    z-index: 2500;
}

.readme-content {
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    border-radius: var(--radius-large);
    background: var(--system-background);
    box-shadow: var(--elevated-shadow);
}

.readme-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 0.5px solid var(--separator);
    background: var(--secondary-system-background);
}

.readme-title h2 {
    font-family: var(--sf-pro-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 8px;
}

.readme-meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.readme-meta span {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    background: var(--system-gray6);
    color: var(--label-secondary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 16px;
    background: var(--system-gray5);
    color: var(--label-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--system-gray4);
    transform: scale(1.1);
}

.readme-content-area {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0;
}

.readme-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--label-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--system-gray5);
    border-top: 3px solid var(--system-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.readme-body {
    padding: 24px;
    font-family: var(--sf-pro-text);
    line-height: 1.6;
    color: var(--label-primary);
}

.readme-section {
    margin-bottom: 32px;
}

.readme-section:last-child {
    margin-bottom: 0;
}

.readme-section h1 {
    font-family: var(--sf-pro-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--label-primary);
    margin-bottom: 12px;
}

.readme-section h2 {
    font-family: var(--sf-pro-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 16px;
    margin-top: 32px;
}

.readme-section h3 {
    font-family: var(--sf-pro-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 12px;
    margin-top: 24px;
}

.software-description {
    font-size: 19px;
    color: var(--label-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.software-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
}

.badge.version {
    background: var(--system-blue);
    color: white;
}

.badge.platform {
    background: var(--system-orange);
    color: white;
}

.badge.size {
    background: var(--system-gray);
    color: white;
}

.badge.rating {
    background: var(--system-green);
    color: white;
}

.feature-list, .instruction-list {
    padding-left: 0;
    list-style: none;
}

.feature-list li, .instruction-list li {
    padding: 8px 0;
    border-bottom: 0.5px solid var(--separator);
}

.feature-list li:last-child, .instruction-list li:last-child {
    border-bottom: none;
}

.instruction-list {
    counter-reset: step-counter;
}

.instruction-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 40px;
}

.instruction-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 8px;
    width: 24px;
    height: 24px;
    background: var(--system-blue);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.faq-item {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--tertiary-system-background);
    border-radius: var(--radius-medium);
    border: 0.5px solid var(--separator);
}

.faq-item h3 {
    color: var(--system-blue);
    margin-bottom: 8px;
    font-size: 17px;
}

.faq-item p {
    color: var(--label-secondary);
    margin: 0;
}

.changelog-item {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--tertiary-system-background);
    border-radius: var(--radius-medium);
    border-left: 4px solid var(--system-green);
}

.changelog-item h3 {
    color: var(--system-green);
    font-size: 18px;
    margin-bottom: 12px;
}

.changelog-item ul {
    margin: 0;
    padding-left: 20px;
}

.changelog-item li {
    margin-bottom: 4px;
    color: var(--label-secondary);
}

.code-highlight {
    background: var(--tertiary-system-background);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    color: var(--system-pink);
}

pre {
    background: var(--tertiary-system-background);
    padding: 16px;
    border-radius: var(--radius-medium);
    overflow-x: auto;
    margin: 16px 0;
    border: 0.5px solid var(--separator);
}

pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    color: var(--label-primary);
}

.readme-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--label-secondary);
}

.readme-error i {
    font-size: 48px;
    color: var(--system-orange);
    margin-bottom: 16px;
}

.readme-error h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--label-primary);
}

.retry-btn {
    margin-top: 16px;
    height: 36px;
    padding: 0 20px;
    background: var(--system-blue);
    color: white;
    border: none;
    border-radius: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #0056CC;
    transform: scale(1.05);
}

.readme-actions {
    padding: 20px 24px;
    border-top: 0.5px solid var(--separator);
    background: var(--secondary-system-background);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 下载通知 */
.download-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--system-background);
    border: 0.5px solid var(--separator);
    border-radius: var(--radius-medium);
    box-shadow: var(--elevated-shadow);
    z-index: 3000;
    animation: slideInRight 0.3s ease;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
    min-width: 280px;
}

.notification-content i {
    font-size: 20px;
    color: var(--system-green);
}

.notification-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-text strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--label-primary);
}

.notification-text span {
    font-size: 13px;
    color: var(--label-secondary);
}

.notification-close {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--label-tertiary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: var(--system-gray5);
    color: var(--label-primary);
}

/* 详细统计模态框 */
.detailed-stats-modal {
    z-index: 2600;
}

.detailed-stats-modal .modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 0.5px solid var(--separator);
    background: var(--secondary-system-background);
}

.modal-header h2 {
    font-family: var(--sf-pro-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--label-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header i {
    color: var(--system-blue);
}

.stats-details {
    padding: 24px;
}

.stats-section {
    margin-bottom: 32px;
}

.stats-section h3 {
    font-family: var(--sf-pro-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: var(--tertiary-system-background);
    border-radius: var(--radius-medium);
    border: 0.5px solid var(--separator);
}

.stat-value {
    font-family: var(--sf-pro-display);
    font-size: 32px;
    font-weight: 600;
    color: var(--system-blue);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--label-secondary);
    font-weight: 500;
}

.top-software {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.software-rank {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--tertiary-system-background);
    border-radius: var(--radius-medium);
    border: 0.5px solid var(--separator);
}

.rank {
    width: 32px;
    height: 32px;
    background: var(--system-blue);
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
}

.software-rank .name {
    flex: 1;
    font-weight: 500;
    color: var(--label-primary);
}

.software-rank .downloads {
    font-size: 13px;
    color: var(--label-secondary);
}

.site-info {
    background: var(--tertiary-system-background);
    padding: 16px;
    border-radius: var(--radius-medium);
    border: 0.5px solid var(--separator);
}

.site-info p {
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--label-secondary);
}

.site-info p:last-child {
    margin-bottom: 0;
}

.site-info strong {
    color: var(--label-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .readme-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .readme-header {
        padding: 16px;
    }
    
    .readme-title h2 {
        font-size: 24px;
    }
    
    .readme-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .readme-body {
        padding: 16px;
    }
    
    .readme-section h1 {
        font-size: 28px;
    }
    
    .readme-section h2 {
        font-size: 20px;
    }
    
    .readme-actions {
        padding: 16px;
        flex-wrap: wrap;
    }
    
    .download-notification {
        left: 10px;
        right: 10px;
        width: auto;
    }
    
    .notification-content {
        min-width: auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .readme-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .readme-header {
        padding: 12px;
    }
    
    .readme-body {
        padding: 12px;
    }
    
    .readme-actions {
        padding: 12px;
        gap: 8px;
    }
    
    .action-btn {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        padding: 0 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 收款码模态框样式 */
.donation-modal {
    display: none;
    position: fixed;
    z-index: 3500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.donation-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--system-background);
    border-radius: var(--radius-xl);
    box-shadow: var(--elevated-shadow);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 0.5px solid var(--separator);
    animation: slideInUp 0.4s ease;
}

.donation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 0.5px solid var(--separator);
    background: var(--secondary-system-background);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.donation-header h2 {
    font-family: var(--sf-pro-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--label-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.donation-header i {
    color: var(--system-pink);
    font-size: 20px;
}

.donation-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 16px;
    background: var(--system-gray5);
    color: var(--label-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.donation-close:hover {
    background: var(--system-gray4);
    transform: scale(1.1);
}

.donation-body {
    padding: 32px 24px;
}

.donation-message {
    text-align: center;
    margin-bottom: 32px;
}

.donation-message p {
    font-size: 17px;
    line-height: 1.5;
    color: var(--label-primary);
    margin-bottom: 12px;
}

.donation-message p:first-child {
    font-size: 20px;
    font-weight: 600;
    color: var(--system-blue);
}

.donation-qrcodes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.qrcode-item {
    text-align: center;
    background: var(--tertiary-system-background);
    border-radius: var(--radius-large);
    padding: 24px 16px;
    border: 0.5px solid var(--separator);
    transition: all 0.3s ease;
}

.qrcode-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.qrcode-item h3 {
    font-family: var(--sf-pro-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qrcode-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed var(--separator);
    border-radius: var(--radius-medium);
    background: var(--system-background);
    transition: all 0.3s ease;
}

.qrcode-placeholder:hover {
    border-color: var(--system-blue);
    background: rgba(0, 122, 255, 0.03);
}

.qrcode-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.qrcode-placeholder i.fa-weixin {
    color: #07C160;
}

.qrcode-placeholder i.fa-alipay {
    color: #1677FF;
}

.qrcode-placeholder p {
    font-size: 16px;
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 8px;
}

.qrcode-placeholder small {
    font-size: 13px;
    color: var(--label-secondary);
    opacity: 0.8;
}

.qrcode-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: var(--radius-medium);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.donation-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.donation-btn {
    height: 48px;
    padding: 0 32px;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

.donation-btn.primary {
    background: linear-gradient(135deg, var(--system-pink), #D1006F);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 45, 85, 0.3);
}

.donation-btn.primary:hover {
    background: linear-gradient(135deg, #D1006F, var(--system-pink));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 45, 85, 0.4);
}

.donation-btn.secondary {
    background: var(--system-gray5);
    color: var(--label-primary);
    border: 1px solid var(--separator);
}

.donation-btn.secondary:hover {
    background: var(--system-gray4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .donation-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .donation-header {
        padding: 20px;
    }
    
    .donation-header h2 {
        font-size: 20px;
    }
    
    .donation-body {
        padding: 24px 20px;
    }
    
    .donation-qrcodes {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .qrcode-item {
        padding: 20px;
    }
    
    .qrcode-placeholder {
        min-height: 180px;
    }
    
    .donation-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .donation-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .donation-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .donation-header {
        padding: 16px;
    }
    
    .donation-body {
        padding: 20px 16px;
    }
    
    .qrcode-placeholder {
        min-height: 160px;
    }
    
    .qrcode-placeholder i {
        font-size: 36px;
    }
}

