/* ===== base.css - 全局基础样式 ===== */
/* 包含: @font-face、CSS 自定义属性、全局 reset、body 基础样式 */

/* ===== 奶块跟宠羁绊模拟器 样式 ===== */

/* ===== 源圆字体声明 ===== */
@font-face {
    font-family: 'ResourceHanRoundedCN';
    src: url('/%E6%BA%90%E5%9C%86%E5%AD%97%E4%BD%93/ResourceHanRoundedCN-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ResourceHanRoundedCN';
    src: url('/%E6%BA%90%E5%9C%86%E5%AD%97%E4%BD%93/ResourceHanRoundedCN-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ResourceHanRoundedCN';
    src: url('/%E6%BA%90%E5%9C%86%E5%AD%97%E4%BD%93/ResourceHanRoundedCN-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ResourceHanRoundedCN';
    src: url('/%E6%BA%90%E5%9C%86%E5%AD%97%E4%BD%93/ResourceHanRoundedCN-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ResourceHanRoundedCN';
    src: url('/%E6%BA%90%E5%9C%86%E5%AD%97%E4%BD%93/ResourceHanRoundedCN-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ResourceHanRoundedCN';
    src: url('/%E6%BA%90%E5%9C%86%E5%AD%97%E4%BD%93/ResourceHanRoundedCN-Heavy.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ===== 主题色系统 - 渐变色方案 =====
 * 颜色: #8ac4e2 (浅蓝) → #b5dbe5 (淡蓝绿) → #d3eed9 (薄荷绿)
 * 符合WCAG 2.1 AA级可访问性标准 (对比度 ≥ 4.5:1)
 */
:root {
    /* 主渐变色 */
    --gradient-primary: linear-gradient(135deg, #8ac4e2 0%, #b5dbe5 50%, #d3eed9 100%);
    --gradient-primary-hover: linear-gradient(135deg, #7bb5d6 0%, #a5d0de 50%, #c5e8cd 100%);
    --gradient-primary-active: linear-gradient(135deg, #6aa6ca 0%, #95c5d7 50%, #b7e2c1 100%);

    /* 主色系（用于文字、图标等需要纯色的场景） */
    --color-primary: #5a9ab8;
    --color-primary-light: #8ac4e2;
    --color-primary-lighter: #b5dbe5;
    --color-primary-lightest: #d3eed9;
    --color-primary-dark: #3d8aad;
    --color-primary-darker: #2a7a9f;

    /* 文字颜色 - 确保对比度符合WCAG 2.1 AA */
    --text-on-gradient: #1a4d5c;          /* 在渐变背景上的文字 (对比度 > 7:1) */
    --text-on-light-bg: #1e3a45;           /* 在浅色背景上的文字 (对比度 > 7:1) */
    --text-primary: #2c3e50;               /* 主要文字颜色 */
    --text-secondary: #546e7a;             /* 次要文字颜色 */

    /* 阴影颜色 */
    --shadow-primary: rgba(138, 196, 226, 0.35);
    --shadow-primary-light: rgba(138, 196, 226, 0.18);
    --shadow-primary-subtle: rgba(138, 196, 226, 0.10);

    /* 边框颜色 */
    --border-primary: rgba(138, 196, 226, 0.40);
    --border-primary-light: rgba(138, 196, 226, 0.25);

    /* 背景色 */
    --bg-gradient-subtle: linear-gradient(135deg, #f0f8fc 0%, #e8f4f8 30%, #f0faf4 60%, #eaf6f1 100%);
}

html {
    background: #f5f7fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
/* 全局阻止图片默认拖拽行为 - 已禁用
img {
    -webkit-user-drag: none;
}
*/

/* 全局禁用拖拽（除跟宠布局预览区域外） */
/* 注意：拖拽控制通过 JavaScript 的 draggable 属性和事件实现 */

/* 移除点击时的蓝色边框 */
*:focus {
    outline: none !important;
}
/* 按钮点击效果 */
button {
    transition: transform 0.15s ease, opacity 0.15s ease;
    /* 圆角边框完整性修复：防止内容溢出圆角区域 */
    overflow: hidden;
    /* 抗锯齿：确保圆角边缘平滑无锯齿 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* GPU 加速：优化 transform 动画期间的渲染质量 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 确保 border-box 计算精确 */
    box-sizing: border-box;
}

button:active {
    transform: scale(0.92) !important;
    opacity: 0.75 !important;
}

body {
    font-family: 'ResourceHanRoundedCN', 'Microsoft YaHei', sans-serif;
    background: var(--bg-gradient-subtle);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 解锁界面的输入框允许选择 */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

img {
    /* 防止图片被浏览器默认拖拽 */
    -webkit-user-drag: none;
    max-width: 100%;
}
@media print {
    body * {
        visibility: hidden;
    }
    body::after {
        content: "该内容禁止打印";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 24px;
        color: #666;
    }
}/* ===== components.css - 跨页面共享组件样式 ===== */
/* 包含: 模态框、配置面板、导航栏、首页、提示框等通用组件 */

/* --- 模态框基础样式 --- */
/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    border-radius: 18px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-30px) scale(0.97);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eef0f2;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1em;
    color: #1f2937;
    margin: 0;
    font-weight: 700;
}

.modal-close {
    width: 30px;
    height: 30px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    transform: rotate(90deg);
}

.modal-close svg {
    fill: #6b7280;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* --- 配置面板表单样式 --- */
.config-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.config-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.config-section h4 {
    font-size: 1em;
    color: #1f2937;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.setting-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    color: #1f2937;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
}

.setting-group input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--color-primary-light), 0 0 0 3px var(--shadow-primary-subtle);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9em;
    color: #4b5563;
    position: relative;
    padding-left: 32px;
}

.checkbox-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 2px #d1d5db;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.checkbox-item:hover .checkmark {
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.checkbox-item input:checked ~ .checkmark {
    background: var(--gradient-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.checkbox-item input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* select 下拉框样式 */
.setting-group select {
    width: 100%;
    padding: 10px 14px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.setting-group select:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--color-primary-light), 0 0 0 3px var(--shadow-primary-subtle);
}

/* --- 模态框底部按钮 --- */
.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-cancel {
    padding: 8px 20px;
    background: #f3f4f6;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #d1d5db;
    border-radius: 8px;
    color: #4b5563;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-confirm {
    padding: 8px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: var(--text-on-gradient);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 0 1px transparent;
    overflow: hidden;
}

.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--shadow-primary-light), 0 0 0 1px rgba(255,255,255,0.3);
}

.btn-confirm:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-primary);
}


/* --- 顶部导航栏 --- */
/* ===== 顶部导航栏 ===== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: var(--gradient-primary);
    color: var(--text-on-gradient);
    box-shadow: 0 2px 12px var(--shadow-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    color: white;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.25s ease;
    overflow: hidden;
}

.nav-home-btn:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-1px);
}

.nav-home-btn svg {
    fill: white;
}

.nav-title {
    font-size: 1em;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.85);
}

.nav-spacer {
    width: 100px;
}

@media (max-width: 600px) {
    .top-nav {
        padding: 6px 12px;
    }
    .nav-home-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    .nav-title {
        font-size: 0.85em;
    }
    .nav-spacer {
        width: 60px;
    }
}

/* --- 首页引导页 --- */
/* ===== 首页引导页 ===== */
.home-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-gradient-subtle);
    position: relative;
    overflow: hidden;
}

/* 装饰性背景圆 */
.home-bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.home-bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
}

.home-bg-circle-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(138,196,226,0.15) 0%, rgba(138,196,226,0) 70%);
    top: -150px;
    right: -100px;
    animation: homeCircleFloat 8s ease-in-out infinite;
}

.home-bg-circle-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(181,219,229,0.12) 0%, rgba(181,219,229,0) 70%);
    bottom: -100px;
    left: -80px;
    animation: homeCircleFloat 10s ease-in-out infinite reverse;
}

.home-bg-circle-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(211,238,217,0.10) 0%, rgba(211,238,217,0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: homePulse 6s ease-in-out infinite;
}

@keyframes homeCircleFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

@keyframes homePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.3; }
}

.home-container {
    width: 100%;
    max-width: 720px;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.home-hero {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 55px 44px 48px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    /* 圆角边框修复：确保边框完整闭合，内容不溢出 */
    overflow: hidden;
}

.home-logo {
    flex-shrink: 0;
    animation: homeFloat 3.5s ease-in-out infinite;
}

.home-logo img {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 8px 30px var(--shadow-primary-light);
}

@keyframes homeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.home-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.home-title-group {
    text-align: center;
}

.home-title {
    font-size: 2.4em;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    letter-spacing: 1px;
}

.home-subtitle {
    font-size: 1.05em;
    color: #8b74bd;
    font-weight: 600;
    letter-spacing: 2px;
}

.home-desc {
    color: #999;
    font-size: 0.95em;
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* 功能卡片 */
.home-features {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.home-feature-card {
    flex: 1;
    max-width: 240px;
    padding: 24px 18px 22px;
    background: linear-gradient(145deg, #f8f9fc, #f0f2f8);
    border-radius: 18px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px rgba(230,232,240,0.5);
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    overflow: hidden;
}

.home-feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px var(--shadow-primary-subtle), 0 0 0 1px var(--border-primary-light);
    background: linear-gradient(145deg, #fafffe, #f2faf8);
}

.home-feature-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px var(--shadow-primary-light);
}

.home-feature-icon svg {
    fill: white;
}

.home-feature-card h3 {
    font-size: 1.05em;
    color: #2d3748;
    margin-bottom: 6px;
    font-weight: 700;
}

.home-feature-card p {
    font-size: 0.82em;
    color: #999;
    line-height: 1.6;
}

.home-footer {
    margin-top: 28px;
    color: #bbb;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

/* 响应式 */
@media (max-width: 600px) {
    .home-hero {
        padding: 36px 20px 32px;
        border-radius: 22px;
    }

    .home-logo img {
        width: 70px;
        height: 70px;
    }

    .home-title {
        font-size: 1.7em;
    }

    .home-subtitle {
        font-size: 0.9em;
    }

    .home-title-row {
        gap: 16px;
        margin-bottom: 20px;
    }

    .home-desc {
        font-size: 0.85em;
        margin-bottom: 28px;
    }

    .home-features {
        flex-direction: row;
        gap: 14px;
        margin-bottom: 28px;
    }

    .home-feature-card {
        max-width: 100%;
        width: 100%;
    }

    .home-bg-circle-1 {
        width: 300px;
        height: 300px;
    }

    .home-bg-circle-2 {
        width: 250px;
        height: 250px;
    }
}

/* --- 分享成功提示框 --- */
/* ===== 分享成功提示框 ===== */
.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    pointer-events: none;
}

.toast-box {
    background: #fff;
    border-radius: 16px;
    padding: 36px 44px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    pointer-events: auto;
    animation: toastIn 0.35s ease;
    position: relative;
}

.toast-box .toast-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.toast-box .toast-icon svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.toast-box .toast-title {
    font-size: 1.25em;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.toast-box .toast-desc {
    font-size: 0.85em;
    color: #6b7280;
    line-height: 1.5;
}

.toast-box .toast-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.toast-box .toast-close:hover {
    background: #e5e7eb;
}

.toast-box .toast-close svg {
    width: 14px;
    height: 14px;
    fill: #6b7280;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.toast-box.toast-out {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.85) translateY(-20px);
    }
}

/* --- 页面标题头（handbook-header） --- */
/* 跨页面共享：handbook.html、lineup.html 均使用 */

.handbook-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 25px 30px;
    background: var(--gradient-primary);
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px var(--shadow-primary);
}

.page-icon-wrap {
    flex-shrink: 0;
    width: 78px;
    height: 78px;
    border-radius: 16px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    box-shadow: 0 0 0 1.5px rgba(255,255,255,0.35), 0 4px 16px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.page-icon {
    width: 78px;
    height: 78px;
    object-fit: cover;
    display: block;
}

.page-title-group {
    text-align: left;
}

.handbook-header h1 {
    font-weight: 800;
    font-size: 2.5em;
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.handbook-header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1em;
}

@media (max-width: 600px) {
    .handbook-header {
        padding: 18px 10px;
    }

    .handbook-header h1 {
        font-size: 1.8em;
    }
}