/**
 * 六爻页：顶栏设置按钮与用户设置浮层
 */

.liuyao-header-settings-btn {
    position: absolute;
    top: 50%;
    right: max(10px, env(safe-area-inset-right, 0px));
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 11px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.12s ease;
}

.header.liuyao-header-bar .liuyao-header-settings-btn {
    color: #f4faf7;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.header.liuyao-header-bar .liuyao-header-settings-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.5);
    color: #f4faf7;
}

.liuyao-header-settings-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.liuyao-header-settings-btn:focus-visible {
    outline: 2px solid rgba(255, 248, 220, 0.95);
    outline-offset: 2px;
}

.liuyao-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.liuyao-settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.liuyao-settings-box {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    max-height: min(88vh, 520px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.06),
        0 20px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.liuyao-settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e8edf3;
}

.liuyao-settings-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.04em;
}

.liuyao-settings-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
}

.liuyao-settings-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.liuyao-settings-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 8px 16px 18px;
    -webkit-overflow-scrolling: touch;
}

.liuyao-settings-section + .liuyao-settings-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
}

.liuyao-settings-section-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.06em;
}

.liuyao-settings-row {
    margin-bottom: 10px;
}

.liuyao-settings-inline-label {
    font-size: 12px;
    color: #64748b;
    margin-right: 2px;
    white-space: nowrap;
}

.liuyao-settings-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #64748b;
}

@media (max-width: 480px) {
    .liuyao-header-settings-btn {
        padding: 5px 10px;
        font-size: 12px;
        right: max(8px, env(safe-area-inset-right, 0px));
    }

    .liuyao-settings-overlay {
        padding: 12px;
    }

    .liuyao-settings-box {
        border-radius: 14px;
    }
}
