// 公共SCSS变量定义
$colors: (
    primary: #108cff,
    primary-light: rgba(16, 140, 255, 0.08),
    bg: #f9fafb,
    card: #ffffff,
    border: #f5f5f5,
    text-primary: #1f2937,
    text-secondary: #374151,
    shadow: rgba(0, 0, 0, 0.05)
);

$sizes: (
    radius: 16rpx,
    padding: 32rpx,
    padding-sm: 28rpx,
    margin-sm: 18rpx,
    margin-xs: 16rpx,
    icon-padding: 14rpx,
    font-title: 34rpx,
    font-content: 32rpx,
    line-height: 56rpx,
    checkbox-size: 32rpx
);

// 字体优化
$font: (
    family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',
    smoothing: antialiased
);

// 字体大小变量
$font-sizes: (
    title: 38rpx,
    content: 34rpx,
    sub-content: 30rpx,
    small: 26rpx,
    tiny: 24rpx
);

// 字体权重变量
$font-weights: (
    bold: 700,
    semi-bold: 600,
    medium: 500,
    regular: 450,
    light: 400
);

// 行高变量
$line-heights: (
    large: 56rpx,
    medium: 48rpx,
    small: 40rpx
);

// 字间距变量
$letter-spacings: (
    large: 1rpx,
    medium: 0.8rpx,
    small: 0.5rpx
);

// 文本颜色变量
$text-colors: (
    primary: map-get($colors, text-primary),
    secondary: map-get($colors, text-secondary),
    tertiary: #666666,
    placeholder: #999999
);

// 公共混合宏
@mixin flex-center {
    display: flex;
    align-items: center;
}

@mixin shadow($level: 1) {
    $shadow-levels: (
        1: 0 2rpx 12rpx map-get($colors, shadow),
        2: 0 4rpx 20rpx map-get($colors, shadow),
        3: 0 8rpx 30rpx map-get($colors, shadow)
    );
box-shadow: map-get($shadow-levels, $level);
transition: box-shadow 0.3s ease;
}

@mixin card {
    width: 100%;
    margin: 0;
    background-color: map-get($colors, card);
    border-radius: map-get($sizes, radius);
    @include shadow;
}

// 字体样式混合宏
@mixin font-styles(
    $size: content,
    $weight: regular,
    $color: primary,
    $line-height: medium,
    $letter-spacing: medium
) {
    font-size: map-get($font-sizes, $size);
    font-weight: map-get($font-weights, $weight);
    color: map-get($text-colors, $color);
    line-height: map-get($line-heights, $line-height);
    letter-spacing: map-get($letter-spacings, $letter-spacing);
    font-family: map-get($font, family);
}

// 公共页面容器样式
.page-container {
    box-sizing: border-box;
    padding: 0;
    background-color: map-get($colors, bg);
    font-family: map-get($font, family);
    -webkit-font-smoothing: map-get($font, smoothing);
    font-smoothing: map-get($font, smoothing);
}

// 公共字体样式
// 页面主标题
.page-title {
    @include font-styles($size: title, $weight: bold, $color: primary);
}

// 卡片标题
.card-title {
    @include font-styles($size: title, $weight: bold, $color: primary);
    border-bottom: 1rpx solid map-get($colors, border);
    padding: map-get($sizes, padding-sm) map-get($sizes, padding);
    margin: 0;
}

// 地址标题
.address-title {
    @include font-styles($size: title, $weight: bold, $color: primary);
    flex: 1;
}

// 主要内容文字
.content-text {
    @include font-styles;
}

// 辅助文字
.auxiliary-text {
    @include font-styles($size: small, $weight: regular, $color: tertiary, $line-height: small, $letter-spacing: small);
}

// 复选框/单选框文字
.form-item-text {
    @include font-styles;
    vertical-align: middle;
}

// 空状态文字
.empty-text {
    @include font-styles;
    text-align: center;
}

// 标签文字
.label-text {
    @include font-styles($size: tiny, $weight: regular, $color: tertiary);
}

// 值文字
.value-text {
    @include font-styles($size: small, $weight: regular, $color: secondary);
}

// 公共卡片样式
.card_wrap {
    @include card;
    margin-bottom: 20rpx;

    &:hover {
        @include shadow(2);
    }
}

// 公共地址标题样式
.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: map-get($sizes, margin-sm);
    padding-bottom: map-get($sizes, margin-sm);
    border-bottom: 1rpx solid map-get($colors, border);

    .location-icon {
        margin-right: map-get($sizes, margin-xs);
        background-color: map-get($colors, primary-light);
        padding: map-get($sizes, icon-padding);
        border-radius: 50%;
        flex-shrink: 0;
    }

    .address-title {
        margin-left: 16rpx;
    }

    .add-image-btn {
        margin-top: -10rpx;
    }
}
