/* ==========================================================================
   base.css —— 设计变量、reset、全局通用组件
   （toast / loading / empty / back-top / spin 动画）
   业务相关样式见 app.css
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root {
    --primary: #ff5577;
    --primary-light: #fff0f3;
    --bg: #fafafa;
    --bg-card: #ffffff;
    --text: #222;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #eee;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; outline: none; }

/* 加载中 */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Toast */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.toast.show { opacity: 1; }

/* 返回顶部 */
.back-top {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
    box-shadow: var(--shadow);
    z-index: 50;
}

.back-top.show { display: flex; }

@media (max-width: 768px) {
    html, body { font-size: 13px; }

    .back-top {
        right: 14px;
        bottom: 14px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
