@charset "utf-8";
/**
 * RyPHP论坛模块 - 通用样式（现代化升级版）
 * HTML5 + CSS3 + jQuery 4.0
 * @license https://lirongyaoper.com
 */

/* ===== CSS 变量定义 ===== */
:root {
    --primary: #009688;
    --primary-dark: #00796B;
    --primary-light: #4DB6AC;
    --primary-bg: #E0F2F1;
    --accent: #FF5722;
    --accent-essence: #FF5722;
    --accent-stick: #37474F;
    --accent-recomm: #66BB6A;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #2c3e50;
    --text-secondary: #78909c;
    --text-light: #b0bec5;
    --border: #e8ecef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --header-h: 60px;
    --header-children-h: 52px;
    --container-w: 1200px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
*:before, *:after { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td { margin: 0; padding: 0; }
table { border-collapse: collapse; }
a, img { border: 0; }
ol, ul { list-style: none; }
input, textarea, select { outline: none; font-family: inherit; }
a { color: var(--text); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; vertical-align: middle; }
.clearfix { clear: both; width: 0; height: 0; overflow: hidden; }

/* ===== 容器 ===== */
.container { margin: 0 auto; width: var(--container-w); max-width: 100%; }

/* ===== 顶部导航 ===== */
.lry_header {
    position: fixed; left: 0; top: 0; z-index: 1000;
    width: 100%; height: calc(var(--header-h) + var(--safe-top));
    padding-top: var(--safe-top);
    background: rgba(33, 37, 43, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.lry_header a { color: rgba(255,255,255,0.75); transition: color var(--transition); }
.lry_header a:hover { color: #fff; }
.lry_header .container { display: flex; align-items: center; height: 100%; }

.lry_logo {
    flex-shrink: 0;
    margin-right: 40px;
    line-height: var(--header-h);
    transition: opacity var(--transition);
}
.lry_logo:hover { opacity: 0.85; }
.lry_logo img { height: 36px; width: auto; vertical-align: middle; }

.lry_nav { display: flex; align-items: center; flex: 1; }
.lry_nav li { height: var(--header-h); line-height: var(--header-h); }
.lry_nav li a {
    display: block; padding: 0 18px;
    font-size: 15px; color: rgba(255,255,255,0.75);
    position: relative; transition: color var(--transition);
}
.lry_nav li a::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    width: 0; height: 2px; background: var(--primary-light);
    transition: width var(--transition), left var(--transition);
}
.lry_nav li a:hover { color: #fff; }
.lry_nav li a:hover::after { width: 60%; left: 20%; }
.lry_nav li a.current { color: #fff; }
.lry_nav li a.current::after { width: 60%; left: 20%; }

.lry_nav_right { display: flex; align-items: center; flex-shrink: 0; }
.lry_nav_right > span { height: var(--header-h); line-height: var(--header-h); margin-left: 4px; }
.lry_nav_right > span a { display: block; padding: 0 12px; color: rgba(255,255,255,0.75); font-size: 14px; }
.lry_nav_right > span a:hover { color: #fff; }
.lry_nav_right .lry_user_avatar { line-height: var(--header-h); }
.lry_nav_right .lry_user_avatar img { height: 36px; width: 36px; border-radius: 50%; vertical-align: middle; border: 2px solid rgba(255,255,255,0.15); }

/* 已登录用户状态 */
.lry_nav_right .lry_login_status { position: relative; height: var(--header-h); display: flex; align-items: center; }
.lry_login_status > a { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.lry_login_status > a span {
    display: block; max-width: 100px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px; color: rgba(255,255,255,0.85);
}
.lry_login_status img { height: 36px; width: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.15); }

.lry_user_menu {
    position: absolute; top: calc(var(--header-h) + var(--safe-top)); right: 0;
    min-width: 160px; padding: 6px 0;
    background: #fff; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 1001;
}
.lry_user_menu li a {
    display: block; padding: 0 18px;
    line-height: 40px; color: var(--text);
    font-size: 14px; transition: all var(--transition);
}
.lry_user_menu li a:hover { background: var(--primary-bg); color: var(--primary); padding-left: 22px; }
.lry_login_status:hover > .lry_user_menu { opacity: 1; visibility: visible; transform: translateY(0); }

/* 消息角标 */
.lry_msg_badge_wrap { display: flex; align-items: center; margin-left: 8px; }
.lry_msg_icon { position: relative; color: rgba(255,255,255,0.8); font-size: 20px; line-height: 1; }
.lry_msg_icon:hover { color: #fff; }
.lry_msg_badge {
    position: absolute; top: -6px; right: -8px;
    min-width: 16px; height: 16px; line-height: 16px;
    padding: 0 4px; font-size: 10px; font-style: normal;
    text-align: center; color: #fff; background: #f44336;
    border-radius: 8px; font-weight: 600;
}

/* ===== 二级导航 ===== */
.lry_header_children {
    position: fixed; top: calc(var(--header-h) + var(--safe-top)); left: 0; z-index: 999;
    width: 100%; height: var(--header-children-h);
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.lry_header_children .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }

.lry_nav_children { display: flex; align-items: center; height: 100%; }
.lry_nav_children li { height: 100%; }
.lry_nav_children li a {
    display: flex; align-items: center;
    padding: 0 20px; height: 100%;
    font-size: 15px; color: var(--text-secondary);
    position: relative; transition: color var(--transition);
}
.lry_nav_children li a:hover, .lry_nav_children .lry_nav_current { color: var(--primary); }
.lry_nav_children .lry_nav_current::after {
    content: ''; position: absolute; bottom: 0; left: 20px; right: 20px;
    height: 3px; background: var(--primary); border-radius: 3px 3px 0 0;
}

/* 搜索框 */
.lry_search { display: flex; align-items: center; }
.lry_search form { display: flex; align-items: center; gap: 8px; }
.lry_search input[type="text"], .lry_search input[type="search"] {
    width: 220px; height: 36px; padding: 0 14px;
    border: 1.5px solid var(--border); border-radius: 20px;
    background: var(--bg); font-size: 14px; color: var(--text);
    transition: all var(--transition);
}
.lry_search input[type="text"]:focus, .lry_search input[type="search"]:focus {
    border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 3px rgba(0,150,136,0.1); width: 260px;
}
.lry_search .lry_button {
    height: 36px; padding: 0 20px; line-height: 36px;
    border: none; border-radius: 20px;
    background: var(--primary); color: #fff;
    font-size: 14px; cursor: pointer; white-space: nowrap;
    transition: background var(--transition);
}
.lry_search .lry_button:hover { background: var(--primary-dark); }
.lry_font { font-family: inherit !important; }

/* ===== 分页 ===== */
.lry_page { margin: 24px 0 14px; text-align: center; }
.lry_page .pageinfo {
    display: inline-block; margin-right: 6px;
    padding: 6px 14px; font-size: 14px; color: var(--text-secondary);
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.lry_page .pageinfo strong { font-weight: 600; margin: 0 4px; color: var(--primary); }
.lry_page a {
    display: inline-block; padding: 6px 14px; margin-left: 5px;
    font-size: 14px; color: var(--text-secondary);
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.lry_page a:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }
.lry_page .curpage { background: var(--primary); color: #fff; border-color: var(--primary); }
.lry_page .nopage { cursor: not-allowed; }
.lry_page .nopage:hover { background: #fff; color: var(--text-secondary); border-color: var(--border); transform: none; }

/* ===== 底部 ===== */
.lry_footer {
    background: #1a1f2e; color: #8895a7;
    padding: 24px 0; margin-top: 30px;
}
.lry_footer a { color: #b0bccc; transition: color var(--transition); }
.lry_footer a:hover { color: #fff; }
.lry_footer p { text-align: center; font-size: 13px; line-height: 1.8; }

/* ===== 悬浮按钮 ===== */
.lry_scrolltop {
    position: fixed; bottom: 80px; left: 50%; margin-left: 620px;
    width: 48px; z-index: 100;
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow);
}
.lry_scrolltop a {
    display: block; width: 48px; height: 48px;
    line-height: 48px; text-align: center;
    font-size: 13px; color: #fff;
    background: var(--primary); transition: background var(--transition);
}
.lry_scrolltop a:hover { background: var(--primary-dark); }
.lry_scrolltop .lry_posts { border-bottom: 1px solid rgba(255,255,255,0.15); }

/* ===== 通用按钮 ===== */
.lry_button {
    display: inline-block; height: 38px; line-height: 38px;
    padding: 0 24px; border: none; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: all var(--transition);
}
.lry_button:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,150,136,0.3); }

/* ===== 响应式（超大屏） ===== */
@media screen and (min-width: 1921px) {
    :root { --container-w: 1400px; }
    .lry_scrolltop { margin-left: 720px; }
}

/* ===== 汉堡菜单按钮 ===== */
.lry_hamburger {
    display: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; cursor: pointer;
    border: none; background: transparent; border-radius: var(--radius-sm);
    transition: background var(--transition);
    position: relative; z-index: 1002;
}
.lry_hamburger:hover { background: rgba(255,255,255,0.1); }
.lry_hamburger span {
    display: block; width: 20px; height: 2px;
    background: rgba(255,255,255,0.85); border-radius: 2px;
    position: relative; transition: all var(--transition);
}
.lry_hamburger span::before, .lry_hamburger span::after {
    content: ''; position: absolute; left: 0;
    width: 100%; height: 2px; background: inherit;
    border-radius: 2px; transition: all var(--transition);
}
.lry_hamburger span::before { top: -6px; }
.lry_hamburger span::after { top: 6px; }
/* 汉堡按钮激活态 */
.nav-open .lry_hamburger span { background: transparent; }
.nav-open .lry_hamburger span::before { top: 0; transform: rotate(45deg); background: rgba(255,255,255,0.85); }
.nav-open .lry_hamburger span::after { top: 0; transform: rotate(-45deg); background: rgba(255,255,255,0.85); }

/* ===== 遮罩层 ===== */
.lry_overlay {
    position: fixed; inset: 0; z-index: 998;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--transition), visibility var(--transition);
}
.lry_overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

/* ===== 侧边栏切换按钮 ===== */
.lry_sidebar_toggle {
    display: none; position: fixed;
    bottom: 80px; right: 20px; z-index: 997;
    width: 48px; height: 48px;
    border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff; font-size: 18px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,150,136,0.35);
    transition: all var(--transition);
    align-items: center; justify-content: center;
}
.lry_sidebar_toggle:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,150,136,0.45); }
.lry_sidebar_toggle:active { transform: scale(0.92); }
.lry_sidebar_toggle .toggle_icon {
    display: block; width: 18px; height: 14px; position: relative;
}
.lry_sidebar_toggle .toggle_icon::before,
.lry_sidebar_toggle .toggle_icon::after {
    content: ''; position: absolute; left: 0;
    width: 100%; height: 2px; background: #fff; border-radius: 1px;
}
.lry_sidebar_toggle .toggle_icon::before { top: 0; width: 14px; }
.lry_sidebar_toggle .toggle_icon::after { bottom: 0; width: 10px; }
.lry_sidebar_toggle .toggle_icon span {
    display: block; position: absolute; top: 50%; transform: translateY(-50%);
    width: 18px; height: 2px; background: #fff; border-radius: 1px;
}

/* ===== 响应式（小屏） ===== */
@media screen and (max-width: 1200px) {
    :root { --container-w: 96%; }
    .lry_nav li a { padding: 0 12px; }
    .lry_search input[type="text"], .lry_search input[type="search"] { width: 180px; }
    .lry_search input[type="text"]:focus, .lry_search input[type="search"]:focus { width: 200px; }
}

/* ===== 响应式（≤1024px 平板） ===== */
@media screen and (max-width: 1024px) {
    :root { --container-w: 98%; }

    /* 显示汉堡菜单按钮 */
    .lry_hamburger { display: flex; }

    /* 隐藏主导航，改为下拉式 */
    .lry_nav {
        position: fixed; top: calc(var(--header-h) + var(--safe-top)); left: 0;
        width: 100%; max-height: 0; overflow: hidden;
        flex-direction: column; align-items: stretch;
        background: rgba(33, 37, 43, 0.98);
        backdrop-filter: blur(12px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
    }
    .nav-open .lry_nav {
        max-height: 400px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .lry_nav li { height: auto; line-height: normal; }
    .lry_nav li a {
        padding: 14px 24px; font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .lry_nav li a::after { display: none; }
    .lry_nav li:last-child a { border-bottom: none; }

    /* Logo 缩小间距 */
    .lry_logo { margin-right: 16px; }

    /* 二级板块导航横向滚动 */
    .lry_header_children .container { padding: 0; overflow: visible; }
    .lry_nav_children {
        flex: 1; min-width: 0;
        overflow-x: auto; overflow-y: hidden;
        scrollbar-width: none; -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        flex-wrap: nowrap;
        padding: 0 14px;
        gap: 4px;
    }
    .lry_nav_children::-webkit-scrollbar { display: none; }
    .lry_nav_children li { flex-shrink: 0; scroll-snap-align: start; height: auto; }
    .lry_nav_children li a {
        padding: 6px 16px; height: auto;
        white-space: nowrap; font-size: 14px;
        border-radius: 20px; background: var(--bg);
        color: var(--text-secondary);
    }
    .lry_nav_children li a:hover { background: var(--primary-bg); color: var(--primary); }
    .lry_nav_children .lry_nav_current {
        background: var(--primary); color: #fff;
        box-shadow: 0 2px 8px rgba(0,150,136,0.3);
    }
    .lry_nav_children .lry_nav_current::after { display: none; }

    /* 搜索框优化 */
    .lry_search { display: none; }

    /* 显示侧边栏切换按钮 */
    .lry_sidebar_toggle { display: flex; }

    /* 悬浮按钮位置调整 */
    .lry_scrolltop { position: fixed; bottom: 140px; right: 20px; left: auto; margin-left: 0; }
}

/* ===== 响应式（≤768px 手机） ===== */
@media screen and (max-width: 768px) {
    :root { --header-h: 52px; --header-children-h: 46px; --container-w: 100%; }

    .lry_header .container { padding: 0 12px; }
    .lry_logo img { height: 30px; }
    .lry_logo { margin-right: 12px; }

    .lry_nav_right > span a { padding: 0 8px; font-size: 13px; }
    .lry_login_status > a span { font-size: 13px; max-width: 70px; }
    .lry_login_status img { height: 30px; width: 30px; }

    /* 板块导航紧凑化 */
    .lry_nav_children { padding: 0 12px; gap: 3px; }
    .lry_nav_children li a { padding: 5px 12px; font-size: 13px; }
    .lry_nav_children .lry_nav_current::after { display: none; }

    /* 搜索框紧凑恢复（覆盖≤1024px的display:none） */
    .lry_search { display: flex; flex-shrink: 0; }
    .lry_search form { gap: 4px; }
    .lry_search input[type="text"], .lry_search input[type="search"] {
        width: 70px; height: 30px; padding: 0 8px;
        border-radius: 15px; font-size: 12px;
    }
    .lry_search input[type="text"]:focus, .lry_search input[type="search"]:focus {
        width: 70px;
        box-shadow: 0 0 0 2px rgba(0,150,136,0.1);
    }
    .lry_search .lry_button {
        height: 30px; line-height: 30px; padding: 0 10px;
        border-radius: 15px; font-size: 12px;
    }

    /* 侧边栏切换按钮调整 */
    .lry_sidebar_toggle { bottom: calc(70px + var(--safe-bottom)); right: 16px; width: 44px; height: 44px; }

    /* 悬浮按钮 */
    .lry_scrolltop { bottom: calc(126px + var(--safe-bottom)); right: 16px; }
    .lry_scrolltop a { width: 42px; height: 42px; line-height: 42px; font-size: 12px; }

    /* 底部 */
    .lry_footer { padding: 20px 12px; padding-bottom: calc(20px + var(--safe-bottom)); }
    .lry_footer p { font-size: 12px; }
}
