/**
 * 美化通知提示框样式 - HackerMcp / GitHub / Mac 暗色调风格
 * 配色系统基于 HackerMcp
 * v3 - 修复布局和优先级问题
 */

/* ========================================
 * 配色变量
 * ======================================== */
:root {
    --hm-bg: #0d1117;
    --hm-card: #161b22;
    --hm-border: #21262d;
    --hm-border-hover: #30363d;
    --hm-text: #e6edf3;
    --hm-text-muted: #7d8590;
    --hm-text-dim: #8b949e;
    --hm-blue: #58a6ff;
    --hm-green: #3fb950;
    --hm-red: #f85149;
    --hm-orange: #d4a72c;
}

/* ========================================
 * Cookie 通知条 - 底部固定
 * ======================================== */
.notice.notice--cookie,
.notice.notice--primary.notice--cookie {
    background: var(--hm-card) !important;
    border-top: 1px solid var(--hm-border-hover) !important;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4) !important;
    animation: slideUpNotice 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpNotice {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Cookie 通知 - 内容布局 */
.notice--cookie .notice-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    flex-wrap: wrap;
}

/* 隐藏默认图标和emoji */
.notice--cookie .notice-icon,
.notice--cookie .notice-content::before {
    display: none !important;
}

/* Cookie 图标 - 使用 FontAwesome */
.notice--cookie .notice-content .u-alignCenter:first-child::before {
    content: "\f564";
    font-family: "Font Awesome 6 Pro", "Font Awesome 5 Pro", "FontAwesome";
    font-weight: 400;
    font-size: 16px;
    color: var(--hm-text-muted);
    margin-right: 10px;
}

/* Cookie 文字 */
.notice--cookie .u-alignCenter {
    color: var(--hm-text-dim) !important;
    font-size: 13px !important;
    line-height: 1.5;
    display: flex;
    align-items: center;
}

/* Cookie 按钮容器 */
.notice--cookie .u-inputSpacer {
    display: flex;
    gap: 8px;
    margin: 0;
}

/* Cookie 按钮通用 */
.notice--cookie .button--notice {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent !important;
}

/* 接受按钮 - 绿色 */
.notice--cookie .button--notice.button--icon--confirm,
.notice--cookie .js-noticeDismiss {
    background: rgba(63, 185, 80, 0.15) !important;
    color: var(--hm-green) !important;
    border-color: rgba(63, 185, 80, 0.3) !important;
}

.notice--cookie .button--notice.button--icon--confirm:hover,
.notice--cookie .js-noticeDismiss:hover {
    background: rgba(63, 185, 80, 0.25) !important;
    border-color: var(--hm-green) !important;
}

/* 了解更多按钮 - 灰色 */
.notice--cookie .button--notice:not(.button--icon--confirm):not(.js-noticeDismiss) {
    background: transparent !important;
    color: var(--hm-text-dim) !important;
    border-color: var(--hm-border-hover) !important;
}

.notice--cookie .button--notice:not(.button--icon--confirm):not(.js-noticeDismiss):hover {
    background: var(--hm-border) !important;
    color: var(--hm-text) !important;
    border-color: var(--hm-text-dim) !important;
}

/* ========================================
 * 块级消息提示框 (blockMessage) - 高优先级覆盖
 * ======================================== */

/* 重置原有样式 */
.blockMessage.blockMessage--iconic,
.blockMessage--iconic {
    position: relative !important;
    padding: 14px 16px 14px 56px !important;
    text-align: left !important;
    min-height: auto !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin: 16px 0 !important;
    border-width: 1px !important;
    border-style: solid !important;
}

/* 图标容器 - 使用绝对定位居中对齐 */
.blockMessage.blockMessage--iconic::before,
.blockMessage--iconic::before {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-family: "Font Awesome 6 Pro", "Font Awesome 5 Pro", "FontAwesome" !important;
    font-size: 14px !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    text-align: center !important;
}

/* 错误提示框 */
.blockMessage.blockMessage--error,
.blockMessage--error {
    background: rgba(248, 81, 73, 0.08) !important;
    border-color: rgba(248, 81, 73, 0.25) !important;
    color: var(--hm-text) !important;
}

.blockMessage.blockMessage--error.blockMessage--iconic::before,
.blockMessage--error.blockMessage--iconic::before {
    content: "\f071" !important;
    font-weight: 900 !important;
    color: var(--hm-red) !important;
    background: rgba(248, 81, 73, 0.15) !important;
}

/* 成功提示框 */
.blockMessage.blockMessage--success,
.blockMessage--success {
    background: rgba(63, 185, 80, 0.08) !important;
    border-color: rgba(63, 185, 80, 0.25) !important;
    color: var(--hm-text) !important;
}

.blockMessage.blockMessage--success.blockMessage--iconic::before,
.blockMessage--success.blockMessage--iconic::before {
    content: "\f00c" !important;
    font-weight: 900 !important;
    color: var(--hm-green) !important;
    background: rgba(63, 185, 80, 0.15) !important;
}

/* 警告提示框 */
.blockMessage.blockMessage--warning,
.blockMessage--warning {
    background: rgba(212, 167, 44, 0.08) !important;
    border-color: rgba(212, 167, 44, 0.25) !important;
    color: var(--hm-text) !important;
}

.blockMessage.blockMessage--warning.blockMessage--iconic::before,
.blockMessage--warning.blockMessage--iconic::before {
    content: "\f06a" !important;
    font-weight: 900 !important;
    color: var(--hm-orange) !important;
    background: rgba(212, 167, 44, 0.15) !important;
}

/* 信息提示框 */
.blockMessage.blockMessage--info,
.blockMessage.blockMessage--important,
.blockMessage--info,
.blockMessage--important {
    background: rgba(88, 166, 255, 0.08) !important;
    border-color: rgba(88, 166, 255, 0.25) !important;
    color: var(--hm-text) !important;
}

.blockMessage.blockMessage--info.blockMessage--iconic::before,
.blockMessage.blockMessage--important.blockMessage--iconic::before,
.blockMessage--info.blockMessage--iconic::before,
.blockMessage--important.blockMessage--iconic::before {
    content: "\f05a" !important;
    font-weight: 900 !important;
    color: var(--hm-blue) !important;
    background: rgba(88, 166, 255, 0.15) !important;
}

/* 提示框内链接 */
.blockMessage a {
    color: var(--hm-blue) !important;
    text-decoration: none !important;
}

.blockMessage a:hover {
    text-decoration: underline !important;
}

/* ========================================
 * 通用通知样式
 * ======================================== */
.notice.notice--primary {
    background: var(--hm-card) !important;
    border-color: var(--hm-border-hover) !important;
}

/* 浮动通知 */
.notices--floating .notice {
    background: var(--hm-card) !important;
    border: 1px solid var(--hm-border-hover) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    margin: 16px;
    max-width: 380px;
}

.notices--floating .notice-content {
    padding: 14px 18px;
    color: var(--hm-text);
    font-size: 13px;
}

/* 通知隐藏动画 */
.notice.is-hiding {
    animation: slideDownNotice 0.25s ease forwards;
}

@keyframes slideDownNotice {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

/* ========================================
 * 响应式
 * ======================================== */
@media (max-width: 640px) {
    .notice--cookie .notice-content {
        padding: 12px 16px 20px !important;
        flex-direction: column !important;
        text-align: center;
    }
    
    .notice--cookie .u-alignCenter:first-child::before {
        display: block;
        margin: 0 0 6px 0;
    }
    
    .notice--cookie .u-inputSpacer {
        width: 100%;
        justify-content: center;
    }
    
    .blockMessage.blockMessage--iconic,
    .blockMessage--iconic {
        padding: 12px 14px 12px 50px !important;
        font-size: 12px !important;
    }
    
    .blockMessage.blockMessage--iconic::before,
    .blockMessage--iconic::before {
        left: 12px !important;
        width: 26px !important;
        height: 26px !important;
        font-size: 12px !important;
    }
}
