/* ═══════════════════════════════════════════
   公共样式 - Modern Blog Theme
   ═══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --primary: #1e9fff;
    --primary-dark: #0c7cd5;
    --accent: #5fb878;
    --accent-dark: #4cae65;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #f5f7fa;
    --bg-white: #fff;
    --border: #e8ecf1;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 70px;
}

/* ── Reset ── */
html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    box-sizing: border-box !important;
    height: 100%;
    min-height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, *:before, *:after {
    box-sizing: inherit !important;
}

*:focus {
    outline: none;
}

* {
    margin: 0;
    padding: 0;
}

ul, li {
    list-style-type: none;
}

body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

body a {
    text-decoration: none;
    transition: var(--transition);
    color: var(--primary);
}

body a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

input[type=text]:focus, input[type=password]:focus, input[type=textarea]:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(30, 159, 255, 0.15) !important;
}

.clearfix:after {
    display: block;
    clear: both;
    content: "";
    visibility: hidden;
    height: 0;
}

.clearfix { zoom: 1; }

.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 600;
    line-height: 1.4;
}

/* ── Header ── */
header {
    position: fixed !important;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 999;
    transition: var(--transition);
}

header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.logo {
    float: left;
}

.logo img {
    margin: 18px 0 0 30px;
    max-height: 36px !important;
    z-index: 9999;
}

header > nav > ul {
    float: right;
    padding-right: 60px;
}

.logo, header nav, header nav > ul, header nav > ul > li {
    height: 100%;
}

header nav > ul > li {
    height: var(--header-height);
    line-height: var(--header-height);
    padding: 0 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    float: left;
    position: relative;
}

header nav > ul > li::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

header nav > ul > li:hover::after,
header nav > ul > li.nav-select-this::after {
    width: 24px;
}

header nav > ul > li:hover > a {
    color: var(--primary);
}

header nav > ul > li a {
    color: var(--text-light);
    font-size: 14px;
}

header nav > ul > li a:hover,
header nav > ul > li.nav-select-this a {
    color: var(--primary) !important;
}

.nav-a-click {
    color: var(--primary) !important;
}

.nav-select-this::after {
    width: 24px !important;
}

/* ── Hamburger Menu ── */
header nav input[type="checkbox"] {
    position: absolute;
    top: 20px;
    right: 25px;
    display: none;
}

.menu {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: none;
    cursor: pointer;
    background: transparent;
}

.menu i {
    position: relative;
    top: 4px;
    left: 10px;
    z-index: 999;
    font-size: 1.5rem;
    color: var(--text);
}

/* ── Container ── */
.container {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 100%;
    padding-top: var(--header-height);
    padding-bottom: 60px;
}

/* ── Footer ── */
footer {
    position: relative;
    top: -60px;
    background: #1a1a2e;
    color: rgba(255,255,255,0.6);
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 30px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand h3 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255,255,255,0.45);
}

.footer-links h4 {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    padding: 20px 30px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}

.footer-bottom a {
    color: rgba(255,255,255,0.45);
}

.footer-bottom a:hover {
    color: var(--primary);
}

/* ── Utility ── */
.target-fix {
    position: relative;
    top: calc(var(--header-height) * -1);
    display: block;
    height: 0;
    overflow: hidden;
}

.layui-box, .layui-box * {
    box-sizing: content-box !important;
}

.layui-layer-tab * {
    box-sizing: initial !important;
}

.layui-fixbar li {
    background-color: var(--primary) !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
    line-height: 40px !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 10px rgba(30,159,255,0.3) !important;
}

.layui-fixbar .layui-fixbar-top {
    font-size: 24px !important;
}

/* ── Page Hero ── */
.page-hero {
    position: relative;
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    text-align: center;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(30,159,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.page-hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.page-hero p {
    font-size: 15px;
    color: rgba(255,255,255,0.5);
}

/* ── Section Common ── */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.section-title p {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 16px;
}

/* ── Card Base ── */
.blog-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.blog-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

/* ── Badge ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    line-height: 1.6;
}

.badge-primary {
    background: rgba(30,159,255,0.1);
    color: var(--primary);
}

.badge-accent {
    background: rgba(95,184,120,0.1);
    color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 1367px) {
    header > nav > ul { padding-right: 30px; }
}

@media (max-width: 856px) {
    :root { --header-height: 60px; }

    .target-fix { top: -60px; }

    .logo { float: none; }
    .logo img { margin: 12px 0 8px 20px; }

    header nav > ul > li {
        height: 50px;
        line-height: 50px;
    }

    .logo, header > nav > ul {
        float: none;
        padding-right: 0;
    }

    .menu { display: block; }

    header > nav > ul { display: none; }

    header > nav > input[type="checkbox"]:checked ~ ul {
        display: block;
        background: var(--bg-white);
        border-top: 1px solid var(--border);
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    header > nav > input[type="checkbox"]:checked ~ ul > li {
        float: none;
        height: 50px;
        line-height: 50px;
        border-bottom: 1px solid var(--border);
    }

    .container { padding-top: var(--header-height); }

    .footer-main { flex-direction: column; gap: 30px; }
}

@media (max-width: 655px) {
    header nav > ul > li {
        float: none;
        height: 48px;
        line-height: 48px;
    }
}


/* ── Nav Search（站内搜索入口，2026-08-28） ── */
header nav > ul > li.nav-search { padding: 0 16px; }
.nav-search form { display: flex; align-items: center; }
.nav-search input { width: 150px; height: 32px; border: 1px solid var(--border); border-radius: 16px; padding: 0 14px; font-size: 13px; outline: none; background: #f7f8fa; color: var(--text); transition: border-color .2s, width .2s, background .2s; }
.nav-search input:focus { width: 190px; border-color: var(--primary); background: #fff; }
.nav-search button { margin-left: 8px; height: 32px; width: 32px; line-height: 32px; padding: 0; border: none; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer; font-size: 14px; transition: background .2s; }
.nav-search button:hover { background: #40a9ff; }

@media (max-width: 856px) {
    header nav > ul > li.nav-search { display: flex; justify-content: center; align-items: center; height: 50px; line-height: normal; }
    .nav-search input { width: 60vw; max-width: 260px; }
}

/* ── 顶栏分组下拉（2026-11-06：原顶栏 15 个入口被注释、全部挤在页脚，改为 4 组下拉） ── */
header nav > ul > li.nav-group > a { cursor: default; }
header nav > ul > li.nav-group > a .layui-icon-down { font-size: 12px; margin-left: 2px; }

.nav-group-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%);
    min-width: 148px;
    padding: 6px 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(31, 35, 41, .12);
    text-align: left;
    line-height: normal;
    z-index: 1000;
}

.nav-group-menu a {
    display: block;
    padding: 9px 18px;
    font-size: 13px;
    color: var(--text-light) !important;
    white-space: nowrap;
}

.nav-group-menu a:hover {
    color: var(--primary) !important;
    background: rgba(24, 144, 255, .06);
}

header nav > ul > li.nav-group:hover > .nav-group-menu,
header nav > ul > li.nav-group:focus-within > .nav-group-menu { display: block; }

/* 汉堡菜单展开时下拉改为静态铺开，触屏无需 hover */
@media (max-width: 856px) {
    header nav > ul > li.nav-group { height: auto; line-height: 50px; }
    .nav-group-menu {
        display: block;
        position: static;
        transform: none;
        min-width: 0;
        padding: 0 0 8px 16px;
        background: transparent;
        border: none;
        border-top: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
    }
    .nav-group-menu a { padding: 4px 12px; line-height: 34px; }
}
