/* ============================================================
   全站主题 - 现代大气配色
   body 添加 .site-theme 生效，首页额外添加 .page-home
   ============================================================ */

.site-theme {
    --theme-primary: #4f46e5;
    --theme-primary-dark: #4338ca;
    --theme-primary-light: #818cf8;
    --theme-accent: #0ea5e9;
    --theme-bg: #f1f5f9;
    --theme-surface: #ffffff;
    --theme-text: #0f172a;
    --theme-text-secondary: #64748b;
    --theme-text-muted: #94a3b8;
    --theme-border: #e2e8f0;
    --theme-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --theme-shadow-hover: 0 4px 6px rgba(15, 23, 42, 0.04), 0 16px 40px rgba(79, 70, 229, 0.12);
    --theme-radius: 16px;
    --theme-radius-sm: 10px;
    --theme-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #0ea5e9 100%);
    background: var(--theme-bg) !important;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 70, 229, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(14, 165, 233, 0.06), transparent) !important;
    color: var(--theme-text);
}

/* ---------- 顶栏 & 导航 ---------- */
.site-theme .top {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    color: rgba(255, 255, 255, 0.75);
    border-bottom: none;
    font-size: 12px;
    padding: 6px 0;
}

.site-theme .top .layui-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-theme .top a {
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s;
}

.site-theme .top a:hover {
    color: #fff;
}

/* 主导航头部 */
.site-theme .site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--theme-border);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.site-theme .site-header::after {
    content: "";
    display: block;
    height: 3px;
    background: var(--theme-gradient);
    opacity: 0.9;
}

.site-theme .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 72px;
    padding: 10px 0;
}

/* 品牌区：图标 + 站名一体 */
.site-theme .site-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity 0.2s;
}

.site-theme .site-brand:hover {
    opacity: 0.92;
}

.site-theme .site-brand__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: transparent;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
}

.site-theme .site-brand__icon img {
    display: block;
    width: 46px;
    height: 46px;
    max-width: none;
    object-fit: cover;
    border-radius: 14px;
}

.site-theme .site-brand__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    line-height: 1.2;
}

.site-theme .site-brand__name {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-text);
    letter-spacing: 0.04em;
    font-style: normal;
}

.site-theme .site-brand__tag {
    font-size: 12px;
    font-weight: 400;
    color: var(--theme-text-muted);
    font-style: normal;
    letter-spacing: 0.02em;
}

.site-theme .site-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.site-theme .site-nav ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-theme .site-nav li {
    margin: 0;
}

.site-theme .site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.site-theme .site-nav a:hover {
    color: var(--theme-primary);
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.site-theme .site-nav a:active {
    transform: translateY(0);
}

/* 移动端导航 */
.site-theme .site-nav-mobile {
    padding: 12px 0 14px;
}

.site-theme .site-brand--mobile {
    margin-bottom: 12px;
}

.site-theme .site-brand--mobile .site-brand__icon {
    width: 40px;
    height: 40px;
}

.site-theme .site-brand--mobile .site-brand__icon img {
    width: 40px;
    height: 40px;
}

.site-theme .site-brand--mobile .site-brand__name {
    font-size: 17px;
}

.site-theme .site-nav-mobile__list {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 0 2px;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.site-theme .site-nav-mobile__list::-webkit-scrollbar {
    display: none;
}

.site-theme .site-nav-mobile__list li {
    flex: 0 0 auto;
    margin: 0;
}

.site-theme .site-nav-mobile__list a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--theme-text-secondary);
    font-size: 14px;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid var(--theme-border);
    transition: all 0.2s;
}

.site-theme .site-nav-mobile__list a.active,
.site-theme .site-nav-mobile__list a:hover {
    color: var(--theme-primary);
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.2);
}

/* 兼容旧类名 */
.site-theme nav.layui-bg-white {
    background: transparent !important;
}

.site-theme .top-head ul li a.active:after {
    display: none;
}

/* ---------- 全局文字色 ---------- */
.site-theme .text-darker { color: var(--theme-text) !important; }
.site-theme .text-light { color: var(--theme-text-secondary) !important; }
.site-theme .text-lighter { color: var(--theme-text-muted) !important; }
.site-theme .text-gray { color: var(--theme-text-secondary) !important; }
.site-theme .font-black { color: var(--theme-text) !important; }

.site-theme a.ah:hover {
    color: var(--theme-primary);
    text-decoration: none;
}

/* ---------- 卡片 ---------- */
.site-theme .layui-card {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    box-shadow: var(--theme-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.site-theme .layui-card-header {
    background: transparent;
    border-bottom: 1px solid var(--theme-border);
    padding: 16px 22px;
    color: var(--theme-text);
    font-weight: 600;
    position: relative;
}

.site-theme .layui-card-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--theme-text);
    margin: 0;
}

.site-theme .layui-card-body {
    padding: 18px 22px;
}

.site-theme .box__tit::before {
    background: var(--theme-gradient);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
    width: 4px;
    height: 18px;
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
    left: 12px;
}

/* ---------- 工具列表卡片 ---------- */
.site-theme .tools-list {
    background: #f8fafc;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-sm);
    padding: 14px;
    transition: all 0.25s ease;
    height: 100%;
}

.site-theme .tools-list:hover {
    background: var(--theme-surface);
    border-color: rgba(79, 70, 229, 0.25);
    box-shadow: var(--theme-shadow-hover);
    transform: translateY(-2px);
}

.site-theme .tools-list .text-darker {
    font-weight: 600;
    transition: color 0.2s;
}

.site-theme .tools-list:hover .text-darker {
    color: var(--theme-primary) !important;
}

.site-theme .img-index {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s;
}

.site-theme .tools-list:hover .img-index {
    transform: scale(1.05);
}

/* ---------- 表单 & 按钮 ---------- */
.site-theme .layui-input,
.site-theme .layui-textarea,
.site-theme .layui-select {
    border-radius: var(--theme-radius-sm);
    border-color: var(--theme-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.site-theme .layui-input:focus,
.site-theme .layui-textarea:focus {
    border-color: var(--theme-primary-light) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.site-theme .layui-btn {
    border-radius: var(--theme-radius-sm);
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.site-theme .layui-btn:not(.layui-btn-primary):not(.layui-btn-normal):not(.layui-btn-warm):not(.layui-btn-danger):not(.layui-btn-disabled):not(.home-donate__btn) {
    background: var(--theme-gradient);
    border: none;
    color: #fff;
}

.site-theme .layui-btn:not(.layui-btn-primary):not(.layui-btn-normal):not(.layui-btn-warm):not(.layui-btn-danger):not(.layui-btn-disabled):not(.home-donate__btn):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    opacity: 1;
}

.site-theme .layui-btn-primary {
    border-color: var(--theme-border);
    color: var(--theme-text-secondary);
    background: var(--theme-surface);
}

.site-theme .layui-btn-primary:hover {
    border-color: var(--theme-primary-light);
    color: var(--theme-primary);
}

/* ---------- 表格 ---------- */
.site-theme .layui-table {
    border-radius: var(--theme-radius-sm);
    overflow: hidden;
}

.site-theme .layui-table thead tr {
    background: #f8fafc;
}

.site-theme .layui-table th {
    color: var(--theme-text);
    font-weight: 600;
}

.site-theme .layui-table td,
.site-theme .layui-table th {
    border-color: var(--theme-border);
}

/* ---------- 信息块 & 标签 ---------- */
.site-theme .texts {
    background: #f8fafc;
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-sm);
    padding: 14px 16px;
    line-height: 1.7;
}

.site-theme .kuang {
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    padding: 4px 10px;
    background: #f8fafc;
    color: var(--theme-text-secondary);
    transition: all 0.2s;
}

.site-theme .kuang:hover,
.site-theme a:hover .kuang {
    border-color: rgba(79, 70, 229, 0.3);
    color: var(--theme-primary);
    background: rgba(79, 70, 229, 0.04);
}

.site-theme .bor-b {
    border-bottom-color: var(--theme-border);
}

/* ---------- 列表 & 分页 ---------- */
.site-theme .stext a {
    color: var(--theme-text-secondary);
    transition: color 0.2s;
}

.site-theme .stext a:hover {
    color: var(--theme-primary);
}

.site-theme .layui-laypage a,
.site-theme .layui-laypage span {
    border-radius: 8px;
}

.site-theme .layui-laypage .layui-laypage-curr .layui-laypage-em {
    background: var(--theme-gradient);
}

.site-theme .layui-laypage a:hover {
    color: var(--theme-primary);
}

/* ---------- 侧边栏排行榜 ---------- */
.site-theme .site-sidebar-card .layui-card-header {
    font-size: 15px;
}

.site-theme .site-sidebar-card .layui-card-header img {
    vertical-align: middle;
    margin-right: 4px;
}

.site-theme .site-sidebar-card .layui-card-body a {
    color: var(--theme-text-secondary);
    font-size: 13px;
    padding: 4px 0;
    display: block;
    transition: color 0.2s;
}

.site-theme .site-sidebar-card .layui-card-body a:hover {
    color: var(--theme-primary);
}

/* ---------- 友情链接列表页 ---------- */
.site-theme .layui-panel {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    box-shadow: var(--theme-shadow);
    padding: 20px;
}

.site-theme .layui-panel li {
    padding: 12px;
    border-radius: var(--theme-radius-sm);
    transition: background 0.2s;
}

.site-theme .layui-panel li:hover {
    background: #f8fafc;
}

.site-theme .layui-panel a.bold {
    color: var(--theme-text);
    font-weight: 600;
}

.site-theme .layui-panel a.bold:hover {
    color: var(--theme-primary);
}

/* ---------- 页脚 & 回到顶部 ---------- */
.site-theme footer.layui-bg-white {
    background: #0f172a !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-top: 32px;
}

.site-theme footer .text-light,
.site-theme footer a {
    color: rgba(255, 255, 255, 0.55) !important;
}

.site-theme footer a:hover {
    color: #fff !important;
}

.site-theme .layui-fixbar li {
    background: var(--theme-gradient) !important;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.site-theme .m-tb-sm {
    margin: 24px 0 32px;
}

/* ---------- 用户中心 Bootstrap 布局 ---------- */
.site-theme .navbar-white {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--theme-border);
    box-shadow: 0 1px 0 var(--theme-border);
}

.site-theme .navbar-brand {
    color: var(--theme-text) !important;
    font-weight: 700;
}

.site-theme .navbar-nav > li > a {
    color: var(--theme-text-secondary) !important;
}

.site-theme .navbar-nav > li > a:hover {
    color: var(--theme-primary) !important;
}

.site-theme main.content {
    padding-top: 70px;
    min-height: calc(100vh - 120px);
}

.site-theme .footer.copyright,
.site-theme footer.footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.55);
    padding: 20px 0;
    border: none;
}

.site-theme .footer.copyright a,
.site-theme footer.footer a {
    color: rgba(255, 255, 255, 0.55);
}

.site-theme .footer.copyright a:hover,
.site-theme footer.footer a:hover {
    color: #fff;
}

.site-theme .panel {
    border-radius: var(--theme-radius);
    border-color: var(--theme-border);
    box-shadow: var(--theme-shadow);
}

.site-theme .panel-heading {
    background: #f8fafc;
    border-color: var(--theme-border);
    color: var(--theme-text);
    font-weight: 600;
}

.site-theme .btn-primary {
    background: var(--theme-gradient);
    border: none;
}

/* ============================================================
   首页专属
   ============================================================ */

.site-theme.page-home .home-hero {
    background: var(--theme-surface);
    border-radius: var(--theme-radius);
    box-shadow: var(--theme-shadow);
    border: 1px solid var(--theme-border);
    padding: 28px 24px 24px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.site-theme.page-home .home-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--theme-gradient);
}

.site-theme.page-home .home-hero__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--theme-text);
    letter-spacing: 0.02em;
    margin-bottom: 18px;
}

.site-theme.page-home .home-hero__title span {
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-theme.page-home .ai-platforms {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.site-theme.page-home .ai-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--theme-border);
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
    text-decoration: none;
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.site-theme.page-home .ai-platform:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
    color: var(--theme-primary);
}

.site-theme.page-home .ai-platform__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.site-theme.page-home .ai-platform__name {
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.site-theme.page-home .home-section {
    margin-bottom: 24px;
}

.site-theme.page-home .home-donate {
    background: linear-gradient(135deg, #fffbeb 0%, #fff 50%, #fef3c7 100%);
    border-color: #fde68a;
}

.site-theme.page-home .home-donate__header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.site-theme.page-home .home-donate__title {
    font-size: 20px;
    font-weight: 700;
}

.site-theme.page-home .home-donate__desc {
    color: var(--theme-text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.site-theme.page-home .home-donate__btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0 24px;
    height: 40px;
    line-height: 40px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.site-theme.page-home .reward {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-sm);
    padding: 8px;
    background: var(--theme-surface);
    transition: all 0.2s;
    text-align: center;
    cursor: pointer;
}

.site-theme.page-home .reward:hover {
    border-color: #fbbf24;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
    transform: translateY(-2px);
}

.site-theme.page-home .reward img {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.site-theme.page-home .reward span {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    padding: 3px 8px;
    margin-top: 6px;
    display: inline-block;
}

.site-theme.page-home .home-links .layui-card-header i {
    color: var(--theme-primary);
}

.site-theme.page-home .home-links .layui-inline {
    margin: 4px 8px 4px 0;
}

.site-theme.page-home .home-links a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid var(--theme-border);
    color: var(--theme-text-secondary) !important;
    font-size: 13px;
    transition: all 0.2s;
}

.site-theme.page-home .home-links a:hover {
    color: var(--theme-primary) !important;
    border-color: rgba(79, 70, 229, 0.3);
    background: rgba(79, 70, 229, 0.06);
}

@media screen and (max-width: 1200px) {
    .site-theme .site-nav a {
        padding: 0 14px;
        font-size: 14px;
    }

    .site-theme .site-header__inner {
        gap: 20px;
    }
}

/* ---------- 移动端 ---------- */
@media screen and (max-width: 768px) {
    .site-theme.page-home .home-hero {
        padding: 22px 14px 16px;
        border-radius: 12px;
    }

    .site-theme.page-home .home-hero__title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .site-theme.page-home .ai-platforms {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .site-theme.page-home .ai-platform {
        padding: 12px 6px 10px;
        gap: 6px;
        border-radius: 12px;
        font-size: 11px;
    }

    .site-theme.page-home .ai-platform__icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .site-theme .layui-card-header {
        padding: 14px 16px;
    }

    .site-theme .layui-card-header h1 {
        font-size: 18px;
    }

    .site-theme.page-home .home-donate__header {
        padding: 16px;
    }
}
