/* 基础重置和变量 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    cursor: default;
    display: block;
}

:root {
    --primary-color: #ff4757;
    --secondary-color: #2ed573;
    --accent-color: #5352ed;
    --light-blue: #70a1ff;
    --purple: #8e44ad;
    --yellow: #ffa502;
    --text-dark: #3D354F;
    --text-light: #785598;
    --white: #ffffff;
    --light-gray: #f1f2f6;
    --border-color: #ddd;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

.container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0;
}

/* 通用按钮样式 */
.btn-primary,
.btn-secondary {
    padding: .75rem 1.875rem;
    border: none;
    border-radius: 1.5625rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #ff3742);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 .5rem 1.5625rem rgba(255, 71, 87, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #27ae60);
    color: var(--white);
}

.btn-secondary:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 .5rem 1.5625rem rgba(46, 213, 115, 0.3);
}

/* 占位符样式 */
.character-placeholder,
.hero-img-placeholder,
.decoration-placeholder,
.center-product-placeholder,
.product-img-placeholder,
.icon-placeholder,
.algorithm-img-placeholder,
.avatar-placeholder,
.education-img-placeholder,
.family-photos-placeholder {
    background: var(--light-gray);
    border: .125rem dashed var(--border-color);
    border-radius: .625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    min-height: 9.375rem;
}

/* 主要内容样式 */
.main-content {
    margin-top: 5rem;
}

body {
    max-width: 120rem;
    margin: 0 auto;
}

@media (max-width: 48rem) {
    .main-content {
        max-width: 23.4375rem;
        margin-left: auto;
        margin-right: auto;
        margin-top: 3.75rem;
    }

    .container {
        max-width: 100%;
    }
}

/* ================= 回到頂部按鈕 ================= */
.back-to-top {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 3.5rem;
    height: 3.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: opacity .3s ease, transform .3s ease;
    z-index: 1000;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

@media (max-width: 48rem) {
    .back-to-top {
        bottom: 1.25rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}