.commenter-card {
    position: absolute;
    z-index: 999999;
    width: 300px;
    max-width: calc(100vw - 24px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #1a1a1a;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.commenter-card.cc-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.commenter-card.cc-hide {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    pointer-events: none;
}

/* 卡片主体 */
.commenter-card .cc-box {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 顶部渐变条 */
.commenter-card .cc-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0d6efd, #4dabf7);
    z-index: 2;
    pointer-events: none;
}

/* 趴在右上角的猫 */
.commenter-card .cc-cat {
    position: absolute;
    top: -35px;
    right: 5px;
    width: 100px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08));
}

/* ========== Header ========== */
.commenter-card .cc-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 0;
    position: relative;
    z-index: 1;
}

/* 头像 */
.commenter-card .cc-avatar-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.commenter-card .cc-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8f0fe;
    background: #f5f7fa;
    display: block;
}

.commenter-card .cc-header-info {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.commenter-card .cc-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    overflow: hidden;
}

/* 名字 */
.commenter-card .cc-name {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    letter-spacing: -0.2px;
}

.commenter-card .cc-name-author {
    color: #0d6efd;
}

/* 博主图标 —— mask 方式，颜色随名字 */
.cc-badge-forum {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    background-color: #0d6efd;
    -webkit-mask-image: url('/usr/plugins/CommenterCard/img/forum.svg');
    mask-image: url('/usr/plugins/CommenterCard/img/forum.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* 访客标签 */
.cc-badge-guest {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 20px;
    background: #f2f4f6;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 副标题（网站描述） */
.commenter-card .cc-subtitle {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
    margin-bottom: 2px;
    line-height: 1.4;
}
.commenter-card .cc-subtitle.cc-subtitle-ready {
    display: block;
}

/* 最近活跃时间 */
.commenter-card .cc-last-active {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* IP 标签 */
.commenter-card .cc-ip-tag {
    font-size: 11px;
    color: #e8851a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
}

.commenter-card .cc-ip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f5a623;
    display: inline-block;
}

/* 网址行 */
.commenter-card .cc-url-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.commenter-card .cc-url-link {
    color: #444;
    text-decoration: none;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}

.commenter-card .cc-url-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* 在线状态 */
.commenter-card .cc-status {
    font-size: 12px;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.cc-status-loading {
    background: #ccc;
    animation: cc-pulse 1.5s infinite;
}

.cc-status-on { background: #22c55e; }
.cc-status-off { background: #ccc; }

@keyframes cc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.cc-status-online { color: #22c55e; font-weight: 500; }
.cc-status-offline { color: #999; }

/* ========== Body ========== */
.commenter-card .cc-body {
    padding: 10px 16px 14px;
    position: relative;
    z-index: 1;
}

/* 列表区域 */
.commenter-card .cc-list,
.commenter-card .cc-article-list {
    display: none;
    margin-top: 0;
}
.commenter-card .cc-list.cc-list-ready,
.commenter-card .cc-article-list.cc-list-ready {
    display: block;
}

/* Section header */
.cc-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cc-section-title {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cc-visit-inline {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    padding: 3px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.cc-visit-inline:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* 列表项 */
.cc-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 7px 0;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid #f5f5f5;
    transition: color 0.2s;
    line-height: 1.5;
}
.cc-list-item:last-child {
    border-bottom: none;
}

.cc-list-item:hover {
    color: #0d6efd;
}

.cc-item-title {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
}

.cc-item-date {
    color: #bbb;
    font-size: 11px;
    margin-top: 1px;
}

/* 隐藏版权 */
.commenter-card .cc-credit {
    display: none !important;
}

/* ========== 暗色模式 ========== */
@media (prefers-color-scheme: dark) {
    .commenter-card .cc-box {
        background: #1e1e2e;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    .commenter-card .cc-box::before {
        background: linear-gradient(90deg, #3b82f6, #60a5fa);
    }
    .commenter-card .cc-name { color: #f0f0f0; }
    .commenter-card .cc-name-author { color: #60a5fa; }
    .cc-badge-forum { background-color: #60a5fa; }
    .commenter-card .cc-subtitle { color: #888; }
    .commenter-card .cc-avatar { border-color: #2a2a3a; background: #333; }
    .cc-badge-guest { background: #333; color: #999; }
    .commenter-card .cc-last-active { color: #666; }
    .commenter-card .cc-ip-tag { color: #f5a623; }
    .commenter-card .cc-ip-dot { background: #f5a623; }
    .commenter-card .cc-url-link { color: #aaa; }
    .commenter-card .cc-url-link:hover { color: #60a5fa; }
    .commenter-card .cc-status-online { color: #4ade80; }
    .commenter-card .cc-status-offline { color: #666; }
    .cc-status-loading { background: #555; }
    .cc-status-off { background: #555; }
    .cc-section-title { color: #666; }
    .cc-list-item { color: #ccc; border-bottom-color: #2a2a3a; }
    .cc-list-item:hover { color: #60a5fa; }
    .cc-item-date { color: #555; }
    .cc-visit-inline { color: #ccc; border-color: #333; background: #2a2a3a; }
    .cc-visit-inline:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
}

/* 主题手动切换暗色 */
.commenter-card .cc-box.cc-dark {
    background: #1e1e2e;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
}
.commenter-card .cc-box.cc-dark::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.commenter-card .cc-box.cc-dark .cc-name { color: #f0f0f0; }
.commenter-card .cc-box.cc-dark .cc-name-author { color: #60a5fa; }
.commenter-card .cc-box.cc-dark .cc-badge-forum { background-color: #60a5fa; }
.commenter-card .cc-box.cc-dark .cc-subtitle { color: #888; }
.commenter-card .cc-box.cc-dark .cc-avatar { border-color: #2a2a3a; background: #333; }
.commenter-card .cc-box.cc-dark .cc-badge-guest { background: #333; color: #999; }
.commenter-card .cc-box.cc-dark .cc-last-active { color: #666; }
.commenter-card .cc-box.cc-dark .cc-ip-tag { color: #f5a623; }
.commenter-card .cc-box.cc-dark .cc-ip-dot { background: #f5a623; }
.commenter-card .cc-box.cc-dark .cc-url-link { color: #aaa; }
.commenter-card .cc-box.cc-dark .cc-url-link:hover { color: #60a5fa; }
.commenter-card .cc-box.cc-dark .cc-status-online { color: #4ade80; }
.commenter-card .cc-box.cc-dark .cc-status-offline { color: #666; }
.commenter-card .cc-box.cc-dark .cc-status-loading { background: #555; }
.commenter-card .cc-box.cc-dark .cc-status-off { background: #555; }
.commenter-card .cc-box.cc-dark .cc-section-title { color: #666; }
.commenter-card .cc-box.cc-dark .cc-list-item { color: #ccc; border-bottom-color: #2a2a3a; }
.commenter-card .cc-box.cc-dark .cc-list-item:hover { color: #60a5fa; }
.commenter-card .cc-box.cc-dark .cc-item-date { color: #555; }
.commenter-card .cc-box.cc-dark .cc-visit-inline { color: #ccc; border-color: #333; background: #2a2a3a; }
.commenter-card .cc-box.cc-dark .cc-visit-inline:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* ========== 在线人数 ========== */
#cc-online-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    vertical-align: middle;
    margin: 0;
    font-family: inherit;
    user-select: none;
    transition: opacity 0.2s ease;
    line-height: inherit;
    box-sizing: border-box;
}

#cc-online-btn:hover {
    opacity: 0.75;
    background: transparent;
}

.cc-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    flex-shrink: 0;
    animation: cc-online-pulse 2.5s ease-in-out infinite;
}

@keyframes cc-online-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.3);
        box-shadow: 0 0 0 3px rgba(74, 222, 128, 0);
    }
}

.cc-online-text {
    font-weight: 400;
    font-size: inherit;
}

/* ========== 在线弹窗 ========== */
.cc-online-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cc-online-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
}

.cc-online-box {
    position: relative;
    width: 320px;
    max-width: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 1;
    animation: cc-online-in 0.25s ease;
}

@keyframes cc-online-in {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.cc-online-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.cc-online-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cc-online-header .cc-online-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    animation: none;
}

.cc-online-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.cc-online-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    line-height: 1;
}

.cc-online-close:hover {
    background: #f5f5f5;
    color: #333;
}

.cc-online-body {
    padding: 12px;
    max-height: 360px;
    overflow-y: auto;
}

.cc-online-empty {
    padding: 40px 12px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.cc-online-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-online-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
}

.cc-online-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: #fff;
}

.cc-online-card-info {
    flex: 1;
    min-width: 0;
}

.cc-online-card-loc {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 3px;
}

.cc-online-card-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cc-online-card-sep {
    color: #ccc;
}

/* ========== 主题夜间模式适配 ========== */
body.dark #cc-online-btn,
body.dark-mode #cc-online-btn,
html.dark #cc-online-btn,
html[data-theme="dark"] #cc-online-btn,
body[data-theme="dark"] #cc-online-btn {
    background: transparent;
    border-color: transparent;
    color: inherit;
}

body.dark #cc-online-btn:hover,
body.dark-mode #cc-online-btn:hover,
html.dark #cc-online-btn:hover,
html[data-theme="dark"] #cc-online-btn:hover,
body[data-theme="dark"] #cc-online-btn:hover {
    opacity: 0.75;
}

body.dark .cc-online-box,
body.dark-mode .cc-online-box,
html.dark .cc-online-box,
html[data-theme="dark"] .cc-online-box,
body[data-theme="dark"] .cc-online-box {
    background: #1e293b;
}

body.dark .cc-online-header,
body.dark-mode .cc-online-header,
html.dark .cc-online-header,
html[data-theme="dark"] .cc-online-header,
body[data-theme="dark"] .cc-online-header {
    border-bottom-color: #334155;
    background: #1e293b;
}

body.dark .cc-online-title,
body.dark-mode .cc-online-title,
html.dark .cc-online-title,
html[data-theme="dark"] .cc-online-title,
body[data-theme="dark"] .cc-online-title {
    color: #f1f5f9;
}

body.dark .cc-online-close,
body.dark-mode .cc-online-close,
html.dark .cc-online-close,
html[data-theme="dark"] .cc-online-close,
body[data-theme="dark"] .cc-online-close {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

body.dark .cc-online-close:hover,
body.dark-mode .cc-online-close:hover,
html.dark .cc-online-close:hover,
html[data-theme="dark"] .cc-online-close:hover,
body[data-theme="dark"] .cc-online-close:hover {
    background: #334155;
    color: #e2e8f0;
}

body.dark .cc-online-card,
body.dark-mode .cc-online-card,
html.dark .cc-online-card,
html[data-theme="dark"] .cc-online-card,
body[data-theme="dark"] .cc-online-card {
    background: #334155;
    border-color: #475569;
}

body.dark .cc-online-card-icon,
body.dark-mode .cc-online-card-icon,
html.dark .cc-online-card-icon,
html[data-theme="dark"] .cc-online-card-icon,
body[data-theme="dark"] .cc-online-card-icon {
    background: #1e293b;
    border-color: #475569;
}

body.dark .cc-online-card-loc,
body.dark-mode .cc-online-card-loc,
html.dark .cc-online-card-loc,
html[data-theme="dark"] .cc-online-card-loc,
body[data-theme="dark"] .cc-online-card-loc {
    color: #f1f5f9;
}

body.dark .cc-online-card-meta,
body.dark-mode .cc-online-card-meta,
html.dark .cc-online-card-meta,
html[data-theme="dark"] .cc-online-card-meta,
body[data-theme="dark"] .cc-online-card-meta {
    color: #94a3b8;
}

body.dark .cc-online-empty,
body.dark-mode .cc-online-empty,
html.dark .cc-online-empty,
html[data-theme="dark"] .cc-online-empty,
body[data-theme="dark"] .cc-online-empty {
    color: #64748b;
}

@media (prefers-color-scheme: dark) {
    body:not(.dark):not(.dark-mode) #cc-online-btn,
    html:not(.dark):not([data-theme="dark"]) #cc-online-btn {
        background: transparent;
        border-color: transparent;
        color: inherit;
    }
    body:not(.dark):not(.dark-mode) #cc-online-btn:hover,
    html:not(.dark):not([data-theme="dark"]) #cc-online-btn:hover {
        opacity: 0.75;
    }
    body:not(.dark):not(.dark-mode) .cc-online-box,
    html:not(.dark):not([data-theme="dark"]) .cc-online-box {
        background: #1e293b;
    }
    body:not(.dark):not(.dark-mode) .cc-online-header,
    html:not(.dark):not([data-theme="dark"]) .cc-online-header {
        border-bottom-color: #334155;
        background: #1e293b;
    }
    body:not(.dark):not(.dark-mode) .cc-online-title,
    html:not(.dark):not([data-theme="dark"]) .cc-online-title {
        color: #f1f5f9;
    }
    body:not(.dark):not(.dark-mode) .cc-online-close,
    html:not(.dark):not([data-theme="dark"]) .cc-online-close {
        background: #1e293b;
        border-color: #475569;
        color: #94a3b8;
    }
    body:not(.dark):not(.dark-mode) .cc-online-close:hover,
    html:not(.dark):not([data-theme="dark"]) .cc-online-close:hover {
        background: #334155;
        color: #e2e8f0;
    }
    body:not(.dark):not(.dark-mode) .cc-online-card,
    html:not(.dark):not([data-theme="dark"]) .cc-online-card {
        background: #334155;
        border-color: #475569;
    }
    body:not(.dark):not(.dark-mode) .cc-online-card-icon,
    html:not(.dark):not([data-theme="dark"]) .cc-online-card-icon {
        background: #1e293b;
        border-color: #475569;
    }
    body:not(.dark):not(.dark-mode) .cc-online-card-loc,
    html:not(.dark):not([data-theme="dark"]) .cc-online-card-loc {
        color: #f1f5f9;
    }
    body:not(.dark):not(.dark-mode) .cc-online-card-meta,
    html:not(.dark):not([data-theme="dark"]) .cc-online-card-meta {
        color: #94a3b8;
    }
    body:not(.dark):not(.dark-mode) .cc-online-empty,
    html:not(.dark):not([data-theme="dark"]) .cc-online-empty {
        color: #64748b;
    }
}
