/* ABC 乐谱渲染样式 */
.abc-rendered {
    display: block;
    max-width: 100%;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: white !important;
    /* 移除这里的margin，交给容器处理 */
}

.abc-container {
    text-align: center;
    margin: 1.5rem auto;
    max-width: 100%;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* 防止子元素溢出圆角 */
    background-color: white !important;
    /* 默认浅色模式背景 */
    padding: 10px;

    /* 添加Flexbox实现垂直和水平居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 水平居中 */
    justify-content: center;
    /* 垂直居中 */
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .abc-rendered {
        filter: invert(90%) hue-rotate(180deg);
        border-color: #f4f2f2;
        background-color: #111 !important;
    }

    .abc-container {
        background-color: #111 !important;
        border-color: #f4f2f2;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

/* 浅色模式适配 */
@media (prefers-color-scheme: light) {
    .abc-rendered {
        filter: invert(0%) hue-rotate(0deg);
        border-color: #eee;
        background-color: white !important;
    }

    .abc-container {
        background-color: white !important;
        border-color: #eee;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .abc-rendered {
        border: none;
        box-shadow: none;
    }

    .abc-container {
        margin: 0.5rem auto;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 5px;
    }
}