//
//  AppMetrics.swift
//  suixinkan
//
//  Created by Codex on 2026/6/20.
//

import CoreGraphics

/// App 内通用尺寸定义。这里只放跨页面复用的字号和间距，具体业务页面的特殊尺寸仍留在页面本地。
final class AppMetrics {
    private init() {}

    /// 字体尺寸实体，统一维护 App 内常用字号。
    enum FontSize {
        static let caption: CGFloat = 12
        static let footnote: CGFloat = 13
        static let subheadline: CGFloat = 14
        static let body: CGFloat = 16
        static let callout: CGFloat = 17
        static let title3: CGFloat = 18
        static let title2: CGFloat = 20
        static let title: CGFloat = 24
        static let largeTitle: CGFloat = 30
    }

    /// 间距实体，统一维护页面边距和组件间距。
    enum Spacing {
        static let xxxSmall: CGFloat = 2
        static let xxSmall: CGFloat = 4
        static let xSmall: CGFloat = 8
        static let small: CGFloat = 12
        static let substantial: CGFloat = 14
        static let medium: CGFloat = 16
        static let mediumLarge: CGFloat = 18
        static let large: CGFloat = 20
        static let sheet: CGFloat = 22
        static let xLarge: CGFloat = 24
        static let xxLarge: CGFloat = 30
        static let pageHorizontal: CGFloat = 16
        static let pageVertical: CGFloat = 24
    }

    /// 控件尺寸实体，统一维护按钮、输入框和图标点击区尺寸。
    enum ControlSize {
        static let smallIcon: CGFloat = 16
        static let checkboxIcon: CGFloat = 20
        static let passwordIcon: CGFloat = 22
        static let progressWidth: CGFloat = 22
        static let checkboxTapArea: CGFloat = 28
        static let iconTapArea: CGFloat = 32
        static let sheetButtonHeight: CGFloat = 48
        static let primaryButtonHeight: CGFloat = 50
        static let inputHeight: CGFloat = 52
    }

    /// 行距实体，统一维护多行文本的常用行间距。
    enum LineSpacing {
        static let title: CGFloat = 3
    }

    /// 圆角尺寸实体，统一维护输入框、按钮和卡片圆角。
    enum CornerRadius {
        static let input: CGFloat = 12
        static let button: CGFloat = 12
        static let card: CGFloat = 16
    }
}
