/*
 * save-status.css — P1.3 ② 保存状态条:云图标 + 1 行文案 4 态。
 *
 * 老 .save-status 的 ::before 圆点点失效,因为 JS 现在直接 innerHTML 注入
 * <span class="save-status-icon"> + <span class="save-status-text">。
 * 这里通过 .save-status::before { display: none } 抵消老规则,然后给新结构
 * 单独上样式。
 */

.save-status {
    /* 不再用 padding 9px 那种圆胶囊,弱化到与文档标题平齐的细一行 */
    padding: 4px 8px;
    border-radius: 999px;
    gap: 6px;
    font-weight: 500;
    border: 1px solid transparent;
    box-shadow: none;
}

/* 老规则的小圆点不再需要 — 新结构有自己的图标 */
.save-status::before {
    display: none !important;
}

.save-status-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.save-status-cloud {
    width: 14px;
    height: 14px;
    color: currentColor;
    opacity: 0.92;
}

.save-status-mark {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 9px;
    height: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.save-status-mark.dot {
    /* 留 ! / × 字符 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.save-status-mark.spin {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    background: var(--bg-secondary);
    animation: save-spin 0.85s linear infinite;
}

@keyframes save-spin {
    to { transform: rotate(360deg); }
}

.save-status-text {
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

/* 状态切换 spring 200-400ms — 符合 §1.4 微动效约束 */
.save-status.saved {
    animation: save-status-spring var(--motion-spring);
}

@keyframes save-status-spring {
    0%   { transform: scale(0.95); opacity: 0.85; }
    60%  { transform: scale(1.04); }
    100% { transform: scale(1); opacity: 1; }
}
