/* ========= INDEX.CSS - 首页样式（精简版） ========= */
/* 兼容性：Android 9.0+ / iOS 12+ / Chrome 70+ / Safari 12+ / 微信浏览器 */

/* 设置局部变量 */
:root {
  --main-max-width: 1200px;
}

/* 离线提示样式 */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #ff9900;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 18px;
    font-weight: bold;
    z-index: 9999;
    display: none;
}

.offline-indicator.show {
    display: block;
}

.offline-indicator.online {
    background: #5a9c20;
}

/* 主容器 */
.main-container {
  display: flex;
  max-width: var(--main-max-width);
  margin: 5px auto 3px auto;
  padding: 0 15px;
  gap: 10px;
}

/* 内容区域 */
.content-area {
  flex: 1;
  padding-left: 0;
  box-sizing: border-box;
  width: 100%;
}

/* ========= 全页面背景装饰样式 ========= */
.full-page-decoration {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* 右上角树叶 */
.full-page-decoration.leaf-top-right {
  top: 55px;
  right: 0;
  width: 199px;
  height: 77px;
  background-image: url('../images/main_top_right.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top right;
}

/* 底部中间树叶 */
.full-page-decoration.leaf-bottom-center {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 422px;
  height: 86px;
  background-image: url('../images/main_bottom_center.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
}

/* 右下角树叶 */
.full-page-decoration.leaf-bottom-right {
  bottom: 0;
  right: 0;
  width: 322px;
  height: 146px;
  background-image: url('../images/main_bottom_right.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom right;
}

/* ========= 首页导语区域 ========= */
.homepage-intro {
    max-width: 100%;
    margin: 0;
    padding: 0 5px;
}

.homepage-intro h1 {
    font-size: 28px;
    font-weight: bold;
    color: #2a4a0f;
    margin-bottom: 10px;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.homepage-intro p {
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.homepage-intro strong {
    color: #5a9c20;
    font-weight: 700;
}

/* ========= 修行工具区域新版样式 ========= */
.tools-section-new {
    margin-bottom: 10px;
    margin-top: 0px;
    border-radius: 6px;
    overflow: hidden;
    padding: 15px 10px 8px 10px;
    background: transparent;
}

/* 2列布局容器 */
.tools-container.two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    align-items: stretch;
    justify-content: center;
}

/* 工具项链接包装器 */
.tool-link-wrapper {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    height: 100%;
}

/* 工具项卡片 */
.tool-item-large {
    background: transparent;
    border-radius: 12px;
    padding: 5px 3px;
    text-align: center;
    border: 1px solid #5a9c20;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 所有卡片标题字体与 h1 同步（基础值 28px） */
.tool-title-large {
    display: block;
    color: #5a9c20;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    font-size: 28px;
}

/* 描述文字样式 */
.tool-description-small {
    color: #666;
    font-size: 26px !important;
    line-height: 1.4;
    max-width: 100%;
    display: block;
    padding: 0 10px;
}

/* ========= 工具卡片行交替背景色 ========= */
/* 第一、二卡片（第1行）：白色背景 */
.tools-container.two-column > a:nth-child(4n+1) .tool-item-large,
.tools-container.two-column > a:nth-child(4n+2) .tool-item-large {
    background-color: #ffffff;
}

/* 第三、四卡片（第2行）：很浅的浅黄色背景 */
.tools-container.two-column > a:nth-child(4n+3) .tool-item-large,
.tools-container.two-column > a:nth-child(4n+4) .tool-item-large {
    background-color: #fff9e6;
}

/* ========= 响应式设计 ========= */

@media (max-width: 1200px) {
    .full-page-decoration.leaf-top-right {
        width: 180px;
        height: 70px;
    }
    .full-page-decoration.leaf-bottom-center {
        width: 380px;
        height: 77px;
    }
    .full-page-decoration.leaf-bottom-right {
        width: 290px;
        height: 132px;
    }
    .tool-item-large {
        height: 60px;
        padding: 5px 3px;
    }
    .tool-title-large {
        font-size: 26px;  /* 与 h1 一致 */
    }
    .tool-description-small {
        font-size: 24px !important;
    }
    .homepage-intro h1 {
        font-size: 26px;
    }
    .homepage-intro p {
        font-size: 19px;
    }
}

/* 平板设备 (768px-991px) */
@media (max-width: 992px) and (min-width: 769px) {
    .full-page-decoration.leaf-top-right {
        width: 150px;
        height: 58px;
        top: 50px;
    }
    .full-page-decoration.leaf-bottom-center {
        width: 317px;
        height: 65px;
    }
    .full-page-decoration.leaf-bottom-right {
        width: 242px;
        height: 110px;
    }
    .tools-section-new {
        margin-bottom: 8px;
        margin-top: 3px;
        padding: 10px 8px 6px 8px;
    }
    .tools-container.two-column {
        gap: 14px;
    }
    .tool-item-large {
        height: 50px;
        padding: 3px 2px;
    }
    .tool-title-large {
        font-size: 24px;  /* 与 h1 一致 */
    }
    .tool-description-small {
        font-size: 22px !important;
        line-height: 1;
    }
    .homepage-intro {
        padding: 0 5px;
    }
    .homepage-intro h1 {
        font-size: 24px;
    }
    .homepage-intro p {
        font-size: 18px;
    }
}

/* 移动设备 (768px以下) */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        margin: 8px auto 4px auto;
    }
    .full-page-decoration.leaf-top-right {
        width: 120px;
        height: 46px;
        top: 50px;
    }
    .full-page-decoration.leaf-bottom-center {
        width: 253px;
        height: 52px;
    }
    .full-page-decoration.leaf-bottom-right {
        width: 193px;
        height: 88px;
    }
    .tools-section-new {
        margin-bottom: 6px;
        margin-top: 2px;
        padding: 10px 8px 4px 8px;
    }
    .tools-container.two-column {
        gap: 14px;
    }
    .tool-item-large {
        height: auto;            /* 关键：取消固定高度 */
        min-height: 60px;       /* 保证最小高度，避免太矮 */
        padding: 8px 4px;       /* 增加上下内边距 */
        border-radius: 12px;
    }
    .tool-title-large {
        font-size: 22px;        /* 与 h1 一致 */
        white-space: normal;    /* 允许换行 */
        word-break: break-word;
        line-height: 1.3;
        margin: 2px 0;
    }
    .tool-description-small {
        font-size: 16px !important;
        white-space: normal;
        line-height: 1.2;
        margin-top: 2px;
    }
    .homepage-intro {
        padding: 0 5px;
    }
    .homepage-intro h1 {
        font-size: 22px;
    }
    .homepage-intro p {
        font-size: 17px;
        line-height: 1.2;
    }
    /* 底部热门入口改为多列自适应布局 */
    .homepage-links ul {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, auto));
        gap: 10px;
        flex-direction: unset;
    }
    .homepage-links li {
        width: auto;
        min-width: unset;
        flex: unset;
    }
    .homepage-links a {
        text-align: center;
        white-space: nowrap;
    }
}

/* 小屏手机 (480px-747px) */
@media (max-width: 480px) {
    .main-container {
        padding: 0 10px;
    }
    .full-page-decoration.leaf-top-right {
        width: 100px;
        height: 38px;
        opacity: 0.5;
        top: 44px;
    }
    .full-page-decoration.leaf-bottom-center {
        width: 200px;
        height: 41px;
        opacity: 0.5;
    }
    .full-page-decoration.leaf-bottom-right {
        width: 160px;
        height: 73px;
        opacity: 0.5;
    }
    .tools-section-new {
        margin-bottom: 3px;
        margin-top: 0;
        padding: 8px 6px 3px 6px;
    }
    .tools-container.two-column {
        gap: 12px;
    }
    .tool-item-large {
        height: auto;            /* 取消固定高度 */
        min-height: 56px;
        padding: 6px 3px;
        border-radius: 10px;
    }
    .tool-title-large {
        font-size: 20px;        /* 与 h1 一致 */
        white-space: normal;
        word-break: break-word;
    }
    .tool-description-small {
        font-size: 15px !important;
        line-height: 1.2;
        padding: 0 5px;
    }
    .homepage-intro {
        padding: 0 5px;
    }
    .homepage-intro h1 {
        font-size: 20px;
        margin-bottom: 5px;
    }
    .homepage-intro p {
        font-size: 16px;
        line-height: 1.2;
    }
    /* 极窄屏时减小最小列宽，并允许文字换行 */
    .homepage-links ul {
        grid-template-columns: repeat(auto-fill, minmax(110px, auto));
        gap: 8px;
    }
    .homepage-links a {
        white-space: normal;
        font-size: 14px;
        padding: 6px 10px;
    }
}

/* 极小屏幕 (320px-479px) */
@media (max-width: 320px) {
    .main-container {
        padding: 0 5px;
        margin: 5px auto 2px auto;
    }
    .full-page-decoration.leaf-top-right {
        width: 80px;
        height: 30px;
        top: 42px;
    }
    .full-page-decoration.leaf-bottom-center {
        width: 160px;
        height: 33px;
    }
    .full-page-decoration.leaf-bottom-right {
        width: 130px;
        height: 58px;
    }
    .tools-container.two-column {
        gap: 10px;
    }
    .tool-item-large {
        height: auto;            /* 取消固定高度 */
        min-height: 52px;
        padding: 5px 2px;
        border-radius: 8px;
    }
    .tool-title-large {
        font-size: 18px;        /* 与 h1 一致 */
        white-space: normal;
        word-break: break-word;
    }
    .tool-description-small {
        font-size: 14px !important;
        line-height: 1.2;
        padding: 0 3px;
    }
    .homepage-intro {
        padding: 0 5px;
    }
    .homepage-intro h1 {
        font-size: 18px;
        margin-bottom: 5px;
    }
    .homepage-intro p {
        font-size: 15px;
    }
}

/* 移除所有动画和过渡 */
* {
    animation: none !important;
    transition: none !important;
}

/* ========= 醒目留言引导横幅 ========= */
.feedback-banner {
    background: linear-gradient(135deg, #fef9e6 0%, #fff4d6 100%);
    border-radius: 16px;
    padding: 0px;
    margin: 5px auto 2px auto;
    max-width: var(--main-max-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}
.feedback-banner-left {
    flex: 2;
    min-width: 200px;
}
.feedback-line {
    font-size: 18px;
    color: #2c3e50;
    line-height: 1.2;
    margin-bottom: 6px;
}
.feedback-line:last-child {
    margin-bottom: 0;
}
.feedback-line strong {
    color: #5a9c20;
    font-weight: bold;
}
.feedback-banner-right {
    flex-shrink: 0;
    text-align: right;
}
.feedback-link {
    display: inline-block;
    background: #5a9c20;
    color: white;
    font-size: 20px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 40px;
    text-decoration: none;
    white-space: nowrap;
}
.feedback-link:hover {
    background: #4a7c1a;
    transform: translateX(2px);
    color:#FFD700;
}
.feedback-link:active {
    transform: translateX(0);
}

/* 移动端适配：改为上下排列，右侧按钮居中 */
@media (max-width: 768px) {
    .feedback-banner {
        flex-direction: column;
        text-align: center;
    }
    .feedback-banner-left {
        text-align: left;
        width: 100%;
    }
    .feedback-line {
        font-size: 16px;
    }
    .feedback-banner-right {
        text-align: center;
    }
    .feedback-link {
        font-size: 18px;
        white-space: nowrap;
    }
}

/* 极小屏幕 */
@media (max-width: 480px) {
    .feedback-line {
        font-size: 15px;
    }
    .feedback-link {
        font-size: 16px;
        padding: 6px 14px;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .feedback-banner {
        border: 2px solid black;
        background: #ffffe0;
    }
    .feedback-link {
        background: black;
        color: white;
        border: 1px solid white;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .feedback-link {
        transition: none;
    }
}