/* ==========================================================
   ITI 社区 首页样式
   ========================================================== */

/* ---------- CSS 变量 ---------- */
:root {
    --iti-primary: #1AB5B5;          /* 主青色 - 按钮主色 */
    --iti-primary-dark: #02569B;     /* 按钮悬停 - 加深 */
    --iti-primary-light: #E5F8F8;    /* 浅青背景 */
    --iti-navy: #0F1F3D;             /* 深蓝 - 标题 */
    --iti-text: #2C3E50;             /* 正文 */
    --iti-text-light: #6B7A8A;       /* 浅色正文 */
    --iti-muted: #98A2B3;            /* 辅助文字 */
    --iti-border: #E5EAF0;           /* 描边 */
    --iti-bg: #FFFFFF;
    --iti-bg-soft: #EAF4F6;          /* 卡片区背景 */
    --iti-bg-soft-2: #D9EAEC;        /* 第二种浅背景 */
    --iti-yellow: #C5D93B;           /* 黄绿色 - 装饰/回顶 */
    --iti-red: #E53935;              /* 红色 - Member Only */
    --iti-orange: #F37021;           /* 橙色 - 截止提示 */
    --iti-radius: 6px;
    --iti-radius-lg: 10px;
    --iti-shadow: 0 2px 12px rgba(15, 31, 61, 0.06);
    --iti-shadow-md: 0 6px 24px rgba(15, 31, 61, 0.08);
    --iti-content-width: 1200px;
    --iti-transition: 0.25s ease;
}

/* ---------- Reset ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* ---------- 思源黑体：本地 woff2 优先 ---------- */
@font-face {
    font-family: "Noto Sans SC";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: local("Source Han Sans SC"),
         local("Noto Sans SC"),
         local("PingFang SC"),
         local("Microsoft YaHei"),
         url("../fonts/NotoSansSC-400.woff2") format("woff2");
}
@font-face {
    font-family: "Noto Sans SC";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: local("Source Han Sans SC Bold"),
         local("Noto Sans SC Bold"),
         local("PingFang SC"),
         local("Microsoft YaHei"),
         url("../fonts/NotoSansSC-700.woff2") format("woff2");
}

body {
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
                 "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue",
                 Arial, sans-serif;
    color: var(--iti-text);
    background: var(--iti-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;       /* 防止 iOS 自动放大文字 */
    overflow-x: hidden;                   /* 防止水平滚动 */
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

ul {
    list-style: none;
}

/* ---------- 通用容器 ---------- */
.iti-container {
    max-width: var(--iti-content-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 瀑布流入场动画 ----------
   关键策略：JS 加载前元素**默认可见**（避免白条 BUG），
   JS 加载后立即给 .iti-fade 加 .iti-fade-init 类来隐藏并准备动画。
   元素进入视口后移除 .iti-fade-init + 添加 .is-visible。
   这样即使 JS 失败、IO 失效、快速滚动跳过，元素也始终可见。
   ------------------------------------------------ */
.iti-fade {
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* JS 加载完成后才添加这个类，才会真正"隐藏"待动画 */
.iti-fade.iti-fade-init {
    opacity: 0;
    will-change: opacity, transform;
}

/* 4 个方向：上/下/左/右 */
.iti-fade-init.iti-fade-up    { transform: translateY(40px); }
.iti-fade-init.iti-fade-down  { transform: translateY(-30px); }
.iti-fade-init.iti-fade-left  { transform: translateX(40px); }
.iti-fade-init.iti-fade-right { transform: translateX(-40px); }
.iti-fade-init.iti-fade-scale { transform: scale(0.94); }

/* 入场后 */
.iti-fade.is-visible {
    opacity: 1 !important;
    transform: translate(0, 0) scale(1) !important;
}

/* 错开延迟：瀑布流关键 */
.iti-delay-1 { transition-delay: 0.08s; }
.iti-delay-2 { transition-delay: 0.16s; }
.iti-delay-3 { transition-delay: 0.24s; }
.iti-delay-4 { transition-delay: 0.32s; }
.iti-delay-5 { transition-delay: 0.40s; }
.iti-delay-6 { transition-delay: 0.48s; }

/* 减少动画偏好：直接显示，不要 hide-init 状态 */
@media (prefers-reduced-motion: reduce) {
    .iti-fade,
    .iti-fade.iti-fade-init {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ---------- 按钮 ---------- */
.iti-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    transition: background-color var(--iti-transition),
                transform var(--iti-transition),
                box-shadow var(--iti-transition);
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
}

.iti-btn .arrow {
    font-size: 12px;
    transition: transform var(--iti-transition);
}

.iti-btn:hover .arrow {
    transform: translateX(3px);
}

/* 主按钮：参考图上下两按钮 = 默认 + 悬停 加深 */
.iti-btn-primary {
    background: var(--iti-primary);        /* #1AB5B5 默认 */
    color: #fff;
}

.iti-btn-primary:hover {
    background: var(--iti-primary-dark);   /* #0A8A8A 加深 */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 181, 181, 0.35);
}

.iti-btn-primary:active {
    background: #087474;                   /* 点击态进一步加深 */
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 181, 181, 0.3);
}

.iti-btn-outline {
    background: #fff;
    color: var(--iti-text);
    border-color: var(--iti-border);
}

.iti-btn-outline:hover {
    border-color: var(--iti-primary);
    color: var(--iti-primary);
}

/* ---------- 顶栏 ---------- */
.iti-topbar {
    background: #fff;
    border-bottom: 1px solid #F0F2F5;
    position: relative;
    z-index: 100;
}

.iti-topbar-inner {
    max-width: var(--iti-content-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.iti-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--iti-navy);
}

.iti-logo-img {
    width: 48px;
    height: 48px;
}

.iti-nav {
    display: flex;
    align-items: center;
    gap: 60px;
}

.iti-nav a {
    font-size: 15px;
    color: var(--iti-text);
    padding: 6px 0;
    position: relative;
    transition: color var(--iti-transition);
}

.iti-nav a:hover,
.iti-nav a.active {
    color: var(--iti-primary);
}

.iti-nav a.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -22px;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--iti-primary);
    border-radius: 2px;
}

.iti-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 登录按钮：与 .iti-btn-primary 同样的主青色 + 同样的 hover 加深 */
.iti-btn-login,
.iti-btn-primary-same {
    background: var(--iti-primary);
    color: #fff;
    border-radius: 4px;
    padding: 8px 24px;
    font-size: 14px;
    transition: background-color var(--iti-transition),
                transform var(--iti-transition),
                box-shadow var(--iti-transition);
}

.iti-btn-login:hover {
    background: var(--iti-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 181, 181, 0.35);
}

.iti-btn-login:active {
    background: #087474;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 181, 181, 0.3);
}

/* 注册按钮：白底青边，hover 时填充浅青 */
.iti-btn-register {
    background: #fff;
    color: #000;
    border: 1px solid var(--iti-primary);
    border-radius: 4px;
    padding: 7px 24px;
    font-size: 14px;
    transition: background-color var(--iti-transition),
                color var(--iti-transition),
                transform var(--iti-transition),
                box-shadow var(--iti-transition);
}

.iti-btn-register:hover {
    background: var(--iti-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 181, 181, 0.3);
}

.iti-btn-register:active {
    background: var(--iti-primary-dark);
    transform: translateY(0);
}

/* ---------- Hero ---------- */
.iti-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background:
        linear-gradient(120deg, #E6F4F5 0%, #DDEEF0 45%, #F4F9FA 75%, #FFFFFF 100%);
    min-height: 440px;
}

/* 装饰性弧形 - 左上青色 */
.iti-hero::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: var(--iti-primary);
    clip-path: polygon(0 0, 55% 0, 0 80%);
    opacity: 0.9;
}

/* 装饰性弧形 - 左下黄绿 */
.iti-hero::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 220px;
    height: 60%;
    background: var(--iti-yellow);
    clip-path: polygon(0 55%, 45% 0, 0 0);
    opacity: 0.95;
}

.iti-hero-inner {
    max-width: var(--iti-content-width);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    align-items: center;
    min-height: 420px;
    position: relative;
    z-index: 2;
    gap: 40px;
}

.iti-hero-text {
    padding: 60px 0;
}

.iti-hero-badge {
    display: inline-block;
    background: var(--iti-primary-light);
    color: var(--iti-primary);
    padding: 6px 18px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
    position: relative;
}

.iti-hero-badge::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -1px;
    height: 2px;
    background: var(--iti-primary);
    border-radius: 1px;
}

.iti-hero-title {
    font-size: 40px;
    font-weight: 700;
    color: var(--iti-navy);
    line-height: 1.3;
    margin-bottom: 16px;
}

.iti-hero-desc {
    font-size: 15px;
    color: var(--iti-text-light);
    margin-bottom: 28px;
    line-height: 1.7;
}

.iti-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.iti-hero-image {
    position: relative;
    height: 360px;
    border-radius: 0;
    overflow: hidden;
    background:
        linear-gradient(135deg, #5A8AAD 0%, #3A6685 100%);
    background-size: cover;
    background-position: center;
}

/* 使用 CSS 渐变模拟图片 */
.iti-hero-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 220, 180, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(180, 220, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #4A7A9D 0%, #2C5878 50%, #1F4566 100%);
}

.iti-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 8%),
        radial-gradient(circle at 60% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 10%),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 6%),
        radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 12%);
}

.iti-hero-stats {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 60px;
    z-index: 3;
    color: #fff;
    text-align: left;
}

.iti-hero-stat-num {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.iti-hero-stat-label {
    font-size: 13px;
    opacity: 0.95;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ---------- 通用小节 ---------- */
.iti-section {
    padding: 60px 0;
}

.iti-section-tight {
    padding: 40px 0;
}

/* ---------- 标签 Badge ---------- */
.iti-tag {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--iti-border);
    color: var(--iti-text);
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 13px;
    position: relative;
    margin-bottom: 18px;
}

.iti-tag::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: -1px;
    height: 2px;
    background: var(--iti-primary);
    border-radius: 1px;
}

/* ---------- 卡片区 (三张卡) ---------- */
.iti-cards-section {
    background: var(--iti-bg-soft);
    position: relative;
}

.iti-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.iti-card {
    background: #fff;
    border-radius: var(--iti-radius-lg);
    overflow: hidden;
    box-shadow: var(--iti-shadow);
    transition: transform var(--iti-transition), box-shadow var(--iti-transition);
    display: flex;
    flex-direction: column;
}

.iti-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--iti-shadow-md);
}

.iti-card-image {
    height: 180px;
    background: linear-gradient(135deg, #B5C9D6 0%, #6A8A9F 100%);
    position: relative;
    overflow: hidden;
}

.iti-card:nth-child(1) .iti-card-image {
    background:
        linear-gradient(135deg, #5A7A8A 0%, #3D5A6A 100%);
}

.iti-card:nth-child(2) .iti-card-image {
    background:
        linear-gradient(135deg, #C8B89A 0%, #8A7556 100%);
}

.iti-card:nth-child(3) .iti-card-image {
    background:
        linear-gradient(135deg, #D4C0A8 0%, #9A8068 100%);
}

.iti-card-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.15) 0%, transparent 40%);
}

.iti-card-body {
    padding: 22px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.iti-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--iti-navy);
    margin-bottom: 10px;
}

.iti-card-desc {
    font-size: 13px;
    color: var(--iti-text-light);
    line-height: 1.7;
    margin-bottom: 18px;
    flex: 1;
}

.iti-card-action {
    display: flex;
    justify-content: flex-start;       /* 按钮从右改到左 */
}

.iti-card-action .iti-btn {
    padding: 7px 18px;
    font-size: 13px;
}

/* ---------- 右侧悬浮按钮 ---------- */
.iti-floating {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 56px;
}

.iti-floating-btn {
    width: 56px;
    height: 56px;
    background: var(--iti-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(26, 181, 181, 0.35);
    transition: all var(--iti-transition);
    text-align: center;
    line-height: 1.2;
}

.iti-floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 181, 181, 0.5);
}

.iti-floating-btn .icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.iti-floating-btn-back {
    background: var(--iti-yellow);
    color: var(--iti-navy);
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(197, 217, 59, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all var(--iti-transition);
}

.iti-floating-btn-back.visible {
    opacity: 1;
    pointer-events: auto;
}

.iti-floating-btn-back:hover {
    background: #B5C92B;
}

/* ---------- 推荐内容 ---------- */
.iti-featured {
    background: #fff;
    padding: 70px 0;
}

.iti-featured-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 60px;
    align-items: center;
}

.iti-featured-text .iti-featured-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--iti-navy);
    margin-bottom: 6px;
    line-height: 1.3;
}

.iti-featured-text .iti-featured-title .member-only {
    color: var(--iti-red);
    font-size: 14px;
    font-weight: 500;
    margin-left: 12px;
    vertical-align: middle;
}

.iti-featured-text .iti-featured-sub {
    font-size: 16px;
    color: var(--iti-text);
    margin-bottom: 10px;
    font-style: italic;
}

.iti-featured-text .iti-featured-meta {
    font-size: 13px;
    color: var(--iti-muted);
    margin-bottom: 28px;
    letter-spacing: 0.3px;
}

.iti-featured-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.iti-featured-image {
    height: 320px;
    background:
        linear-gradient(135deg, #B5C9D6 0%, #6A8A9F 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.iti-featured-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 40% 50%, rgba(255, 240, 220, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(0, 0, 0, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #4A6A7A 0%, #2C4A5A 100%);
}

.iti-featured-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 6%),
        radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 8%);
}

/* ---------- 推荐活动 ---------- */
.iti-event {
    background: var(--iti-bg-soft);
    padding: 60px 0;
}

.iti-event-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 60px;
    align-items: center;
}

.iti-event-poster {
    height: 280px;
    background: #fff;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--iti-shadow);
}

.iti-event-poster::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    background: #fff;
    z-index: 1;
}

.iti-event-poster::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    background:
        linear-gradient(180deg, #87A8B8 0%, #5A7A8A 50%, #3D5A6A 100%);
}

.iti-poster-content {
    position: relative;
    z-index: 2;
    padding: 30px 40px;
    flex: 1;
}

.iti-poster-content h3 {
    font-size: 28px;
    font-weight: 600;
    color: var(--iti-navy);
    line-height: 1.2;
    margin-bottom: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
}

.iti-poster-content .iti-poster-date {
    font-size: 14px;
    color: var(--iti-text);
    margin-bottom: 18px;
    font-style: italic;
}

.iti-poster-content .iti-poster-tag {
    font-size: 10px;
    color: var(--iti-text-light);
    line-height: 1.5;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-top: 1px solid var(--iti-border);
    padding-top: 8px;
    display: inline-block;
    font-style: italic;
}

.iti-event-text .iti-event-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--iti-navy);
    line-height: 1.35;
    margin-bottom: 16px;
}

.iti-event-text .iti-event-time {
    font-size: 15px;
    color: var(--iti-text);
    margin-bottom: 18px;
}

.iti-event-text .iti-event-time .dot {
    margin: 0 8px;
    color: var(--iti-muted);
}

.iti-event-warning {
    font-size: 13px;
    color: var(--iti-orange);
    margin-bottom: 18px;
    font-weight: 500;
}

/* ---------- 页脚 ---------- */
.iti-footer {
    background: #fff;
    border-top: 1px solid #F0F2F5;
    padding: 22px 0;
}

.iti-footer-inner {
    max-width: var(--iti-content-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.iti-footer-text {
    font-size: 12px;
    color: var(--iti-muted);
    line-height: 1.7;
}

.iti-footer-text a {
    color: var(--iti-muted);
    transition: color var(--iti-transition);
}

.iti-footer-text a:hover {
    color: var(--iti-primary);
}

.iti-footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.iti-footer-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iti-social-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--iti-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    transition: all var(--iti-transition);
    cursor: pointer;
    border: none;
}

.iti-social-icon:hover {
    background: var(--iti-primary-dark);
    transform: translateY(-2px);
}

.iti-social-icon.drsa {
    background: var(--iti-primary);
}

.iti-social-icon.email {
    background: var(--iti-primary);
    font-size: 13px;
}

.iti-social-icon.wechat {
    background: var(--iti-primary);
    font-size: 13px;
}

.iti-footer-qr {
    width: 70px;
    height: 70px;
    background:
        linear-gradient(45deg, #333 25%, transparent 25%),
        linear-gradient(-45deg, #333 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #333 75%),
        linear-gradient(-45deg, transparent 75%, #333 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    border: 4px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
    position: relative;
}

.iti-footer-qr::before,
.iti-footer-qr::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 4px solid #333;
    box-sizing: border-box;
}

.iti-footer-qr::before {
    top: 4px;
    left: 4px;
}

.iti-footer-qr::after {
    top: 4px;
    right: 4px;
}

/* ---------- 响应式提示（保持 1200 安全宽度） ---------- */
/* 旧的固定宽度限制已移除，由下方 @media 查询处理响应式 */

/* ==========================================================
   响应式适配（移动端优先：base = 桌面端，max-width 向下兼容）
   断点：
     - 桌面端：≥ 1024px（默认）
     - 平板端：≤ 1023px
     - 手机端：≤ 767px
     - 小屏手机：≤ 480px
   ========================================================== */

/* logo 图片样式（用户已替换为 img） */
.iti-logo-img {
    height: 36px;
    width: auto;
    display: block;
}

/* 移动端专属菜单项（默认在桌面端隐藏） */
.iti-mobile-only { display: none; }

/* ---------- 汉堡按钮（默认隐藏，≤1023px 显示） ---------- */
.iti-menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.iti-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--iti-navy);
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}
.iti-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.iti-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}
.iti-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===========================================
   平板端（≤ 1023px）
   =========================================== */
@media (max-width: 1023px) {
    .iti-container { padding: 0 24px; }

    /* Header */
    .iti-topbar-inner { padding: 0 24px; height: 60px; }
    .iti-menu-toggle { display: flex; }

    /* 移动端导航：默认隐藏，点击展开 */
    .iti-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 12px 0;
        box-shadow: 0 6px 24px rgba(15, 31, 61, 0.12);
        max-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* visibility 配合 max-height 动画：
           关闭时延迟 0.3s 才隐藏（等动画结束）
           打开时立即显示（让 max-height 动画可见） */
        visibility: hidden;
        transition: max-height 0.3s ease, visibility 0s linear 0.3s;
        z-index: 99;
    }
    .iti-nav.is-open {
        max-height: calc(100vh - 60px);   /* 撑满剩余视口 */
        visibility: visible;
        transition: max-height 0.3s ease, visibility 0s linear 0s;
    }
    .iti-nav a {
        padding: 14px 24px;
        font-size: 15px;
        width: 100%;
    }
    .iti-nav a.active::after { display: none; }
    .iti-nav a.active {
        background: var(--iti-primary-light);
        color: var(--iti-primary);
    }

    /* 顶栏登录/注册在小屏继续保留 */
    .iti-topbar-actions {
        gap: 8px;
    }
    .iti-btn-login,
    .iti-btn-register {
        padding: 6px 14px;
        font-size: 13px;
    }

    /* Hero */
    .iti-hero { min-height: auto; }
    .iti-hero::before { width: 160px; }
    .iti-hero::after { width: 140px; }
    .iti-hero-inner {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 24px;
    }
    .iti-hero-text { padding: 20px 0; }
    .iti-hero-title { font-size: 32px; }
    .iti-hero-image { height: 280px; }
    .iti-hero-stats {
        right: 24px;
        gap: 40px;
    }
    .iti-hero-stat-num { font-size: 32px; }
    .iti-hero-stat-label { font-size: 12px; }

    /* 三卡片 */
    .iti-cards { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .iti-card:nth-child(3) { grid-column: 1 / -1; }

    /* 推荐内容 */
    .iti-featured { padding: 50px 0; }
    .iti-featured-grid { gap: 40px; }
    .iti-featured-text .iti-featured-title { font-size: 26px; }
    .iti-featured-text .iti-featured-title .member-only {
        display: block;
        margin-left: 0;
        margin-top: 6px;
        font-size: 13px;
    }
    .iti-featured-image { height: 260px; }

    /* 推荐活动 */
    .iti-event { padding: 50px 0; }
    .iti-event-grid { gap: 40px; }
    .iti-event-poster { height: 240px; }
    .iti-poster-content h3 { font-size: 24px; }
    .iti-event-text .iti-event-title { font-size: 22px; }

    /* 悬浮按钮 */
    .iti-floating {
        right: 12px;
        bottom: 20px;
        gap: 4px;
        width: 50px;
    }
    .iti-floating-btn { width: 50px; height: 50px; font-size: 11px; }
    .iti-floating-btn .icon { font-size: 16px; }
}

/* ===========================================
   手机端（≤ 767px）
   =========================================== */
@media (max-width: 767px) {
    body { line-height: 1.65; }

    /* 通用 */
    .iti-container { padding: 0 16px; }
    .iti-section { padding: 40px 0; }

    /* Header */
    .iti-topbar-inner { padding: 0 16px; height: 56px; }
    .iti-logo { font-size: 16px; gap: 6px; }
    .iti-logo-img { height: 30px; }
    /* 移动端隐藏顶栏登录/注册按钮，进入菜单后再访问 */
    .iti-topbar-actions .iti-btn-login,
    .iti-topbar-actions .iti-btn-register { display: none; }
    .iti-menu-toggle { display: flex; width: 32px; height: 32px; }
    .iti-nav { top: 56px; }

    /* 移动端导航中加入登录/注册入口 */
    .iti-nav::before {
        content: "账户操作";
        display: block;
        padding: 8px 24px 6px;
        font-size: 12px;
        color: var(--iti-muted);
        border-bottom: 1px solid var(--iti-border);
        margin-bottom: 4px;
    }
    .iti-nav .iti-mobile-only { display: block; }
    .iti-nav .iti-mobile-only + .iti-mobile-only { border-top: 1px solid var(--iti-border); margin-top: 6px; padding-top: 14px; }

    /* Hero */
    .iti-hero { background: linear-gradient(120deg, #E6F4F5 0%, #FFFFFF 100%); }
    .iti-hero::before { width: 120px; }
    .iti-hero::after { width: 100px; }
    .iti-hero-inner { gap: 24px; padding: 32px 16px; }
    .iti-hero-text { padding: 16px 0; }
    .iti-hero-badge { font-size: 12px; padding: 4px 14px; margin-bottom: 14px; }
    .iti-hero-title { font-size: 26px; line-height: 1.35; margin-bottom: 12px; }
    .iti-hero-desc { font-size: 14px; margin-bottom: 20px; }
    .iti-hero-actions { gap: 10px; }
    .iti-hero-actions .iti-btn { padding: 10px 18px; font-size: 13px; }

    .iti-hero-image { height: 200px; }
    .iti-hero-stats {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        justify-content: center;
        padding: 16px;
        background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 100%);
        gap: 30px;
    }
    .iti-hero-stat { text-align: center; }
    .iti-hero-stat-num { font-size: 26px; }
    .iti-hero-stat-label { font-size: 12px; }

    /* 三卡片：单列 */
    .iti-cards { grid-template-columns: 1fr; gap: 16px; }
    .iti-card:nth-child(3) { grid-column: auto; }
    .iti-card-image { height: 160px; }
    .iti-card-body { padding: 18px 18px 20px; }
    .iti-card-title { font-size: 16px; }
    .iti-card-desc { font-size: 13px; }

    /* 通用按钮在小屏全宽 */
    .iti-card-action .iti-btn { width: 100%; justify-content: center; }

    /* 推荐内容 */
    .iti-featured { padding: 40px 0; }
    .iti-featured-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .iti-featured-text .iti-featured-title { font-size: 22px; }
    .iti-featured-text .iti-featured-sub { font-size: 14px; }
    .iti-featured-actions .iti-btn { width: 100%; justify-content: center; }
    .iti-featured-image { height: 200px; order: -1; }  /* 图片置顶 */

    /* 推荐活动 */
    .iti-event { padding: 40px 0; }
    .iti-event-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .iti-event-poster { height: 200px; }
    .iti-poster-content { padding: 24px; }
    .iti-poster-content h3 { font-size: 22px; }
    .iti-poster-content .iti-poster-date { font-size: 13px; }
    .iti-event-text .iti-event-title { font-size: 20px; }
    .iti-event-text .iti-event-time { font-size: 14px; }
    .iti-event-text .iti-btn { width: 100%; justify-content: center; }

    /* 悬浮按钮：缩小 */
    .iti-floating {
        right: 8px;
        bottom: 16px;
        width: 44px;
        gap: 4px;
    }
    .iti-floating-btn {
        width: 44px;
        height: 44px;
        font-size: 10px;
    }
    .iti-floating-btn .icon { font-size: 14px; }

    /* 页脚 */
    .iti-footer { padding: 20px 0; }
    .iti-footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 0 16px;
    }
    .iti-footer-text { font-size: 11px; }
    .iti-footer-right { flex-direction: column; gap: 12px; }
    .iti-social-icon { width: 32px; height: 32px; }
    .iti-footer-qr { width: 60px; height: 60px; }
}

/* ===========================================
   小屏手机（≤ 480px）
   =========================================== */
@media (max-width: 480px) {
    .iti-hero-title { font-size: 22px; }
    .iti-hero-stat-num { font-size: 22px; }
    .iti-hero-stat-label { font-size: 11px; }
    .iti-featured-text .iti-featured-title { font-size: 19px; }
    .iti-event-text .iti-event-title { font-size: 18px; }
}
