/**
 * SOTMS - 站长工具箱 - 前端样式
 */

:root {
    --sotms-primary-blue: #2196f3;
    --sotms-primary-green: #4caf50;
    --sotms-primary-orange: #ff9800;
    --sotms-primary-purple: #9c27b0;
    --sotms-text-dark: #333;
    --sotms-text-muted: #666;
    --sotms-text-light: #999;
    --sotms-border-light: #eee;
    --sotms-bg-light: #f8f9fa;
    --sotms-radius-sm: 6px;
    --sotms-radius-md: 8px;
    --sotms-radius-lg: 12px;
    --sotms-transition: all 0.3s ease;
}

/* ==================== 站长信息小工具 ==================== */

.sotms-author-info {
    padding: 40px 20px;
    text-align: center;
    font-family: -apple-system, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.sotms-author-info .author-avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    margin-bottom: 18px;
    object-fit: cover;
    transition: var(--sotms-transition);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    filter: grayscale(15%);
}

.sotms-author-info .author-avatar:hover {
    transform: scale(1.05);
    filter: grayscale(0%) brightness(1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.sotms-author-info .author-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--sotms-text-dark);
    margin: 0 0 10px 0;
    letter-spacing: 1.5px;
}

.sotms-author-info .author-bio {
    font-size: 0.85rem;
    color: var(--sotms-text-light);
    margin-bottom: 30px;
    letter-spacing: 0.5px;
    font-weight: 300;
}

.sotms-author-info .author-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.sotms-author-info .author-social a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.03);
    color: var(--sotms-text-muted);
    text-decoration: none;
    transition: var(--sotms-transition);
}

.sotms-author-info .social-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sotms-author-info .author-social a:hover .social-icon {
    transform: scale(1.15);
}

.sotms-author-info .author-social a.btn-bilibili:hover {
    background: #00aeec;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 174, 236, 0.35);
}

.sotms-author-info .author-social a.btn-csdn:hover {
    background: #fc5531;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(252, 85, 49, 0.35);
}

.sotms-author-info .author-social a.btn-mail:hover {
    background: #5dc395;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(93, 195, 149, 0.35);
}

.sotms-author-info .author-social a.btn-wechat:hover {
    background: #07c160;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(7, 193, 96, 0.35);
}

.wechat-wrapper {
    position: relative;
    display: inline-block;
}

.wechat-qrcode-popup {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #fff;
    padding: 15px;
    border-radius: var(--sotms-radius-md);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: var(--sotms-transition);
    z-index: 100;
    min-width: 160px;
}

.wechat-qrcode-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

.wechat-wrapper:hover .wechat-qrcode-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.wechat-qrcode-popup img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.wechat-tip {
    display: block;
    color: var(--sotms-text-muted);
    font-size: 0.75rem;
    margin-top: 10px;
    text-align: center;
}

/* ==================== 友链Logo小工具 ==================== */

.sotms-logo-links,
.sotms-logo-links * {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    list-style: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: normal !important;
    text-decoration: none !important;
    color: inherit !important;
    background: none !important;
    border: none !important;
    outline: none !important;
}

.sotms-logo-links {
    display: flex !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
}

.sotms-logo-links ul {
    display: grid !important;
    grid-template-columns: repeat(2, 135px) !important;
    gap: 4px !important;
    width: fit-content !important;
}

.sotms-logo-links.sotms-links-single-row ul {
    grid-template-rows: 51px !important;
}

.sotms-logo-links.sotms-links-double-row ul {
    grid-template-rows: repeat(2, 51px) !important;
}

.sotms-logo-links li {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
    width: 135px !important;
    height: 51px !important;
    border: 1px solid #efefef !important;
    border-radius: var(--sotms-radius-sm) !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease, background-color 0.2s ease !important;
    overflow: hidden !important;
    background-color: #fff !important;
}

.sotms-logo-links li:hover {
    border-color: #07C160 !important;
    background-color: rgba(7, 193, 96, 0.02) !important;
}

.sotms-logo-links li img {
    max-height: 40px !important;
    max-width: 125px !important;
    object-fit: contain !important;
    vertical-align: middle !important;
}

/* ==================== 站点统计小工具 ==================== */

.sotms-site-stats {
    padding: 10px 0;
    font-family: -apple-system, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.sotms-site-stats .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--sotms-border-light);
}

.sotms-site-stats .stat-item:last-child {
    border-bottom: none;
}

.sotms-site-stats .stat-label {
    font-size: 14px;
    color: var(--sotms-text-muted);
}

.sotms-site-stats .stat-badge {
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.sotms-site-stats .stat-badge-purple { background: var(--sotms-primary-purple); }
.sotms-site-stats .stat-badge-violet { background: #7e57c2; }
.sotms-site-stats .stat-badge-blue { background: var(--sotms-primary-blue); }
.sotms-site-stats .stat-badge-red { background: #e53935; }

/* ==================== Umami统计小工具 ==================== */

.sotms-umami-style-list {
    padding: 10px 0;
    font-family: -apple-system, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.sotms-umami-style-list .stat-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--sotms-border-light);
}

.sotms-umami-style-list .stat-row:last-child {
    border-bottom: none;
}

.sotms-umami-style-list .stat-icon {
    margin-right: 8px;
    font-size: 16px;
}

.sotms-umami-style-list .stat-label {
    flex: 1;
    font-size: 14px;
    color: var(--sotms-text-muted);
}

.sotms-umami-style-list .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--sotms-text-dark);
}

.sotms-umami-style-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sotms-umami-style-card .stat-card {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 10px;
    color: #fff;
    text-align: center;
}

.sotms-umami-style-card .stat-icon {
    font-size: 22px;
    margin-bottom: 6px;
}

.sotms-umami-style-card .stat-value {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.sotms-umami-style-card .stat-label {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 4px;
    color: #fff;
}

.sotms-umami-style-card .stat-card-blue { background: linear-gradient(135deg, #2196f3, #1976d2); }
.sotms-umami-style-card .stat-card-green { background: linear-gradient(135deg, #4caf50, #388e3c); }
.sotms-umami-style-card .stat-card-orange { background: linear-gradient(135deg, #ff9800, #f57c00); }
.sotms-umami-style-card .stat-card-purple { background: linear-gradient(135deg, #9c27b0, #7b1fa2); }

.sotms-umami-style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sotms-umami-style-grid .stat-grid-item {
    padding: 12px;
    border-radius: var(--sotms-radius-md);
    text-align: center;
    background: var(--sotms-bg-light);
    border-left: 3px solid;
}

.sotms-umami-style-grid .stat-grid-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.sotms-umami-style-grid .stat-grid-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--sotms-text-dark);
}

.sotms-umami-style-grid .stat-grid-label {
    font-size: 12px;
    color: var(--sotms-text-muted);
    margin-top: 4px;
}

.sotms-umami-style-grid .stat-grid-blue { border-color: var(--sotms-primary-blue); }
.sotms-umami-style-grid .stat-grid-green { border-color: var(--sotms-primary-green); }
.sotms-umami-style-grid .stat-grid-orange { border-color: var(--sotms-primary-orange); }
.sotms-umami-style-grid .stat-grid-purple { border-color: var(--sotms-primary-purple); }

.sotms-umami-style-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.sotms-umami-style-inline .stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
}

.sotms-umami-style-inline .stat-badge-blue { background: var(--sotms-primary-blue); }
.sotms-umami-style-inline .stat-badge-green { background: var(--sotms-primary-green); }
.sotms-umami-style-inline .stat-badge-orange { background: var(--sotms-primary-orange); }
.sotms-umami-style-inline .stat-badge-purple { background: var(--sotms-primary-purple); }

.sotms-umami-style-minimal {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
}

.sotms-umami-style-minimal .stat-minimal-item {
    text-align: center;
    flex: 1;
    min-width: 60px;
}

.sotms-umami-style-minimal .stat-minimal-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--sotms-text-dark);
    line-height: 1.2;
}

.sotms-umami-style-minimal .stat-minimal-label {
    display: block;
    font-size: 11px;
    color: var(--sotms-text-light);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sotms-umami-style-compact {
    padding: 5px 0;
}

.sotms-umami-style-compact .stat-compact-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.sotms-umami-style-compact .stat-compact-row:last-child {
    margin-bottom: 0;
}

.sotms-umami-style-compact .stat-compact-item {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--sotms-bg-light);
    border-radius: var(--sotms-radius-md);
    gap: 10px;
}

.sotms-umami-style-compact .stat-compact-icon {
    font-size: 18px;
}

.sotms-umami-style-compact .stat-compact-content {
    display: flex;
    flex-direction: column;
}

.sotms-umami-style-compact .stat-compact-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--sotms-text-dark);
    line-height: 1.2;
}

.sotms-umami-style-compact .stat-compact-label {
    font-size: 11px;
    color: #888;
}

.sotms-umami-style-gradient {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sotms-umami-style-gradient .stat-gradient-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 10px;
    color: #fff;
    gap: 12px;
}

.sotms-umami-style-gradient .stat-gradient-icon {
    font-size: 24px;
    opacity: 0.9;
}

.sotms-umami-style-gradient .stat-gradient-content {
    display: flex;
    flex-direction: column;
}

.sotms-umami-style-gradient .stat-gradient-value {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

.sotms-umami-style-gradient .stat-gradient-label {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.sotms-umami-style-gradient .stat-gradient-blue { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.sotms-umami-style-gradient .stat-gradient-green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.sotms-umami-style-gradient .stat-gradient-purple { background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); }
.sotms-umami-style-gradient .stat-gradient-orange { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

.sotms-umami-style-dark {
    background: #1a1a2e;
    border-radius: var(--sotms-radius-lg);
    padding: 15px;
}

.sotms-umami-style-dark .stat-dark-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.sotms-umami-style-dark .stat-dark-item:last-child {
    border-bottom: none;
}

.sotms-umami-style-dark .stat-dark-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--sotms-radius-md);
}

.sotms-umami-style-dark .stat-dark-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sotms-umami-style-dark .stat-dark-value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.sotms-umami-style-dark .stat-dark-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== 暗黑模式适配 ==================== */

@media (prefers-color-scheme: dark) {
    :root {
        --sotms-text-dark: #e0e0e0;
        --sotms-text-muted: #aaaaaa;
        --sotms-border-light: #3a3a3a;
        --sotms-bg-light: #2a2a2a;
    }
    
    .sotms-author-info .author-name {
        color: #e0e0e0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .sotms-author-info .author-bio {
        color: #aaaaaa;
    }
    
    .sotms-author-info .author-social a {
        background: rgba(255, 255, 255, 0.08);
        color: #bbbbbb;
    }
    
    .sotms-author-info .author-avatar {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
        filter: grayscale(10%) brightness(0.85);
    }
    
    .wechat-qrcode-popup {
        background: #2a2a2a;
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.4);
    }
    
    .wechat-qrcode-popup::after {
        border-top-color: #2a2a2a;
    }
    
    .wechat-tip {
        color: #e0e0e0 !important;
    }
    
    .sotms-logo-links li {
        border-color: #3a3a3a !important;
        background-color: #2a2a2a !important;
    }
    
    .sotms-logo-links li:hover {
        border-color: #07C160 !important;
        background-color: rgba(7, 193, 96, 0.08) !important;
    }
}

/* ==================== 响应式 ==================== */

@media (max-width: 480px) {
    .sotms-author-info {
        padding: 30px 15px;
    }
    
    .sotms-author-info .author-avatar {
        width: 70px;
        height: 70px;
    }
    
    .sotms-author-info .author-name {
        font-size: 1.2rem;
    }
    
    .sotms-author-info .author-bio {
        font-size: 0.8rem;
        margin-bottom: 25px;
    }
    
    .sotms-author-info .author-social {
        gap: 15px;
    }
    
    .sotms-author-info .author-social a {
        width: 36px;
        height: 36px;
    }
    
    .wechat-qrcode-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        bottom: auto;
    }
    
    .wechat-wrapper:hover .wechat-qrcode-popup {
        transform: translate(-50%, -50%);
    }
    
    .wechat-qrcode-popup::after {
        display: none;
    }
    
    .sotms-logo-links ul {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }
    
    .sotms-logo-links li {
        width: 100% !important;
        height: 51px !important;
    }
    
    .sotms-umami-style-card .stat-card {
        min-width: 70px;
        padding: 12px 8px;
    }
    
    .sotms-umami-style-grid {
        grid-template-columns: 1fr;
    }
    
    .sotms-umami-style-minimal .stat-minimal-value {
        font-size: 20px;
    }
    
    .sotms-umami-style-compact .stat-compact-row {
        flex-direction: column;
        gap: 8px;
    }
}
