/* ============================================================
   Public Common Styles - 公共样式表
   游乐园大亨 (Theme Park Tycoon) 风格
   颜色参考:深蓝丝带(#1976D2)、草绿(#66BB6A)、米色卡片(#FFF3E0)、金色奖励(#FFB74D)
   ============================================================ */

/* ========== 游乐园品牌色变量(全局) ========== */
:root {
    /* 核心色:蓝色丝带 */
    --tp-blue: #1E88E5;
    --tp-blue-dark: #1565C0;
    --tp-blue-darker: #0D47A1;
    --tp-blue-light: #64B5F6;
    --tp-blue-sky: #81D4FA;

    /* 核心色:绿色(草地/建造按钮) */
    --tp-green: #4CAF50;
    --tp-green-dark: #2E7D32;
    --tp-green-darker: #1B5E20;
    --tp-green-light: #81C784;

    /* 核心色:金色/黄色(奖励/金币/升级) */
    --tp-gold: #FFB74D;
    --tp-gold-dark: #F57C00;
    --tp-gold-darker: #E65100;
    --tp-gold-light: #FFD54F;

    /* 核心色:米色(卡片/面板) */
    --tp-cream: #FFF8E1;
    --tp-cream-dark: #FFECB3;
    --tp-beige: #FFF3E0;
    --tp-beige-dark: #FFE0B2;

    /* 核心色:棕色(边框/地面) */
    --tp-brown: #8D6E63;
    --tp-brown-dark: #5D4037;
    --tp-brown-light: #BCAAA4;

    /* 核心色:草地/路径(游乐园地形) */
    --tp-grass: #7CB342;
    --tp-grass-light: #9CCC65;
    --tp-path: #D7CCB0;
    --tp-path-dark: #BDB59D;

    /* 辅助色 */
    --tp-red: #E53935;          /* 关闭按钮 X */
    --tp-purple: #7E57C2;       /* 特殊奖励 */
    --tp-white: #FFFFFF;
    --tp-shadow: rgba(13, 71, 161, 0.12);
    --tp-shadow-lg: rgba(13, 71, 161, 0.18);

    /* 圆角 */
    --tp-radius-sm: 8px;
    --tp-radius-md: 14px;
    --tp-radius-lg: 22px;
    --tp-radius-xl: 32px;

    /* 字体 */
    --font-display: 'Nunito', 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-body: 'Nunito', 'Segoe UI', 'Helvetica Neue', sans-serif;
}

/* ========== 字体定义 ========== */
@font-face {
    font-family: myFont;
    src: url('../fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Layui 图标(layer.msg 的对勾/加载/感叹图标等) — 放在最前面以高特异性覆盖全局 * 规则 */
i.layui-icon,
i.layui-icon::before,
i[class~="layui-icon"],
i[class~="layui-icon"]::before,
i[class*="layui-icon-"],
i[class*="layui-icon-"]::before,
.layui-layer .layui-layer-face,
.layui-layer .layui-layer-face::before,
.layui-layer i[class*="layui-icon-"],
.layui-layer i[class*="layui-icon-"]::before {
    font-family: "layui-icon" !important;
}

/* ========== 全局字体(全站强制 Montserrat,排除图标字体) ========== */
* { font-family: myFont !important; }

/* 图标字体元素 — 保留图标库自带字体,用 :not 排除所有图标类 */
i[class*="ri-"],
i[class*="ri-"]::before,
i[class*="uk-icon"],
i[class*="uk-icon"]::before,
i[class*="fa-"],
i[class*="fa-"]::before,
i[class*="icon-"],
i[class*="icon-"]::before,
i[class*="glyphicon"],
i[class*="glyphicon"]::before,
[class*="uk-icon"],
[class*="uk-icon"]::before,
[class*="ri-"],
[class*="ri-"]::before,
svg,
svg *,
canvas,
img {
    font-family: inherit !important;
    font-family: var(--icon-font, inherit) !important;
}

/* remixicon 单独声明字体 */
i[class*="ri-"],
i[class*="ri-"]::before {
    font-family: 'remixicon' !important;
}

/* uikit 图标 */
[class*="uk-icon"],
[class*="uk-icon"]::before {
    font-family: 'UIkit Icons' !important;
}

/* Font Awesome 图标 */
i[class*="fa-"],
i[class*="fa-"]::before {
    font-family: 'Font Awesome' !important;
}

/* ========== 基础布局 ========== */
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--tp-blue-sky);
    /* 允许响应式,不再硬锁 1200px 最小宽 */
    min-width: 320px;
    overflow-x: hidden;
}

/* 背景容器 - 游乐园天空渐变 + 草地装饰(全宽包裹) */
.gm-bg-body {
    background: linear-gradient(180deg, #81D4FA 0%, #B3E5FC 40%, #C5E1A5 100%);
    min-height: 100vh;
    position: relative;
    width: 100%;
}

/* 页头公共 padding(公共 header 默认顶部留白 — 由 .tp-navbar 控制具体间距) */
.header_padding {
    padding: 8px 24px;
    margin: 0;
}

/* 圆角通用类 */
.my-radius { border-radius: 15px; }
.my-radius2 { border-radius: 50px; }
.my-radius3 { border-radius: 30px; }

.uk-text-white { color: #FFF; }

/* ============================================================
   公共组件 - 游乐园风格(所有页面可用)
   ============================================================ */

/* ========== 蓝色丝带横幅(.tp-ribbon) ==========
   模仿 Upgrades / Quest / Rides / Collection 顶部蓝丝带
   结构:圆角矩形 + 深蓝边框 + 内阴影
   ========== */
.tp-ribbon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 40px;
    background: linear-gradient(180deg, var(--tp-blue-light) 0%, var(--tp-blue) 50%, var(--tp-blue-dark) 100%);
    border: 3px solid var(--tp-blue-darker);
    border-radius: var(--tp-radius-xl);
    color: var(--tp-white);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 1px 2px 0 rgba(0,0,0,0.3);
    box-shadow: 0 4px 0 rgba(0,0,0,0.2), inset 0 2px 0 rgba(255,255,255,0.3);
    margin: 0 auto 24px;
}

/* 红色关闭按钮(X) */
.tp-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tp-red);
    color: white;
    font-weight: 900;
    border: 3px solid #B71C1C;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0,0,0,0.25);
}

/* ========== 通用按钮(立体风格) ========== */
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: var(--tp-radius-xl);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 3px solid;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 5px 0 rgba(0,0,0,0.25);
    transition: transform 0.15s, box-shadow 0.15s;
    line-height: 1.2;
}
.tp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 rgba(0,0,0,0.25);
    text-decoration: none;
}
.tp-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

/* 绿色建造按钮 */
.tp-btn-build {
    background: linear-gradient(180deg, var(--tp-green-light) 0%, var(--tp-green) 50%, var(--tp-green-dark) 100%);
    color: var(--tp-white);
    border-color: var(--tp-green-darker);
    text-shadow: 1px 2px 0 rgba(0,0,0,0.3);
}
.tp-btn-build:hover { color: var(--tp-white); }

/* 金色奖励按钮 */
.tp-btn-gold {
    background: linear-gradient(180deg, var(--tp-gold-light) 0%, var(--tp-gold) 50%, var(--tp-gold-dark) 100%);
    color: var(--tp-brown-dark);
    border-color: var(--tp-gold-darker);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
}

/* 蓝色操作按钮 */
.tp-btn-blue {
    background: linear-gradient(180deg, var(--tp-blue-light) 0%, var(--tp-blue) 50%, var(--tp-blue-dark) 100%);
    color: var(--tp-white);
    border-color: var(--tp-blue-darker);
    text-shadow: 1px 2px 0 rgba(0,0,0,0.3);
}
.tp-btn-blue:hover { color: var(--tp-white); }

/* ========== 米色卡片(.tp-card) - 游戏弹窗风格 ==========
   顶部蓝丝带 + 米色圆角面板 + 棕色边框
   ========== */
.tp-card {
    position: relative;
    background: linear-gradient(180deg, var(--tp-beige) 0%, var(--tp-beige-dark) 100%);
    border: 4px solid var(--tp-brown);
    border-radius: var(--tp-radius-lg);
    padding: 24px;
    box-shadow: 0 8px 0 rgba(0,0,0,0.15), inset 0 2px 0 rgba(255,255,255,0.6);
}

/* ========== 米色小卡片(升级项/项目列表) ========== */
.tp-item {
    background: var(--tp-cream);
    border: 2px solid var(--tp-brown);
    border-radius: var(--tp-radius-md);
    padding: 14px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}

/* ========== 绿色进度条(.tp-progress) ========== */
.tp-progress {
    width: 100%;
    height: 14px;
    background: #E0E0E0;
    border: 2px solid var(--tp-brown);
    border-radius: var(--tp-radius-xl);
    overflow: hidden;
}
.tp-progress__fill {
    height: 100%;
    background: linear-gradient(180deg, var(--tp-green-light) 0%, var(--tp-green) 50%, var(--tp-green-dark) 100%);
    border-radius: inherit;
    transition: width 0.3s ease;
}

/* ========== 金币/资源徽章(顶栏) ========== */
.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 8px;
    background: linear-gradient(180deg, var(--tp-cream) 0%, var(--tp-beige-dark) 100%);
    border: 2px solid var(--tp-brown);
    border-radius: var(--tp-radius-xl);
    font-weight: 700;
    color: var(--tp-brown-dark);
    font-size: 0.9rem;
}
.tp-badge__icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--tp-gold-light) 0%, var(--tp-gold-dark) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tp-brown-dark);
    font-size: 0.85rem;
}

/* ========== 星级评分(金色) ========== */
.tp-stars {
    display: inline-flex;
    gap: 2px;
    color: var(--tp-gold-light);
    font-size: 1.2rem;
}

/* ========== 区段标题 ========== */
.tp-section-title {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    text-align: center;
    margin: 0 auto 12px;
    color: var(--tp-white);
    font-weight: 800;
    text-shadow: 2px 3px 0 rgba(0,0,0,0.3);
}

.tp-section-subtitle {
    font-size: 1.1rem;
    text-align: center;
    color: #E3F2FD;
    max-width: 700px;
    margin: 0 auto 40px;
    text-shadow: 1px 2px 0 rgba(0,0,0,0.2);
    line-height: 1.6;
}

/* ============================================================
   公共页头 .tp-navbar(游乐园风)
   ============================================================ */
.tp-navbar {
    position: relative;
    background: linear-gradient(180deg, #1976D2 0%, #0D47A1 100%);
    border-bottom: 4px solid #062A67;
    padding: 14px 0;
    color: white;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.tp-navbar .header_padding {
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 覆盖原 uk-grid 堆叠行为(同 model1 逻辑) */
.tp-navbar .uk-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-items: center;
}
.tp-navbar .uk-grid > * {
    padding-left: 0 !important;
    flex: 0 0 auto !important;
    margin-left: 0 !important;
}
/* 中间导航区域允许收缩 */
.tp-navbar .uk-grid > *:nth-child(2) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
.tp-navbar .x-uk-navbar-nav {
    flex-wrap: nowrap !important;
    justify-content: center;
}
.tp-navbar .x-uk-navbar-nav li {
    flex-shrink: 0;
}

/* 导航文字链接 */
.tp-navbar .uk-navbar-nav > li > a {
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-radius: var(--tp-radius-md);
    transition: background 0.15s;
}
.tp-navbar .uk-navbar-nav > li:hover > a,
.tp-navbar .uk-navbar-nav > li.uk-active > a {
    background: rgba(255,255,255,0.18);
    color: #FFF9C4;
}

/* Login 按钮改为绿色立体风格 */
.tp-navbar .uk-button-secondary {
    background: linear-gradient(180deg, var(--tp-green-light) 0%, var(--tp-green) 50%, var(--tp-green-dark) 100%);
    border: 3px solid var(--tp-green-darker);
    color: var(--tp-white);
    padding: 8px 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.25);
}
.tp-navbar .uk-button-secondary:hover {
    background: linear-gradient(180deg, var(--tp-green-light) 0%, var(--tp-green) 50%, var(--tp-green-dark) 100%);
    color: var(--tp-white);
}

/* 用户图标按钮 */
.tp-navbar .uk-icon-button {
    background: var(--tp-blue-dark);
    border: 2px solid #062A67;
    color: white;
}

/* Logo 区域图片自适应 */
.tp-navbar .zt-hero-logo {
    max-height: 56px;
    width: auto !important;
    max-width: none !important;
}

/* ============================================================
   公共 Footer .tp-footer(游乐园风)
   ============================================================ */
.tp-footer {
    background: linear-gradient(180deg, #1976D2 0%, #0D47A1 100%);
    border-top: 4px solid #062A67;
    padding: 50px 0 20px;
    color: #E3F2FD;
}
.tp-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 36px;
    padding: 0 24px;
}
.tp-footer-brand img {
    max-height: 60px;
    margin-bottom: 16px;
    max-width: 100%;
}
.tp-footer-brand p {
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 320px;
    color: #BBDEFB;
    margin: 0;
}
.tp-footer-col h4 {
    color: #FFF9C4;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 16px;
}
.tp-footer-col ul { list-style: none; padding: 0; margin: 0; }
.tp-footer-col li { margin-bottom: 10px; }
.tp-footer-col a {
    color: #BBDEFB;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.15s;
}
.tp-footer-col a:hover {
    color: #FFF9C4;
    text-decoration: none;
}
.tp-footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: #90CAF9;
    font-size: 0.9rem;
}
.tp-footer-bottom a {
    color: #90CAF9;
    text-decoration: none;
}
.tp-footer-bottom a:hover { color: #FFF9C4; }

@media (max-width: 1024px) {
    .tp-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .tp-footer-grid { grid-template-columns: 1fr; }
}

/* ========== 自定义滚动条(游乐园配色) ========== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #E3F2FD; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--tp-blue) 0%, var(--tp-blue-dark) 100%);
    border-radius: 5px;
    border: 2px solid #E3F2FD;
}
::-webkit-scrollbar-thumb:hover { background: var(--tp-blue-darker); }
