/* ========= JISHU.CSS - 念佛计数器（优化版） ========= */
/* 兼容性：Android 9.0+ / iOS 12+ / Chrome 70+ / Safari 12+ / 微信浏览器 */
/* 已移除所有动画/过渡，点击即变色，无延迟感 */

:root {
    --counter-primary: #5a9c20;
    --counter-secondary: #4a7c1a;
    --counter-accent: #ff9900;
    --counter-danger: #e74c3c;
    --counter-bg: #f0f7e6;
    --counter-card: #ffffff;
    --counter-text: #333333;
    --counter-border: #c8e6a8;
}

/* 全局设置 - 禁止选中、禁止缩放 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;   /* 移除点击高亮 */
    -webkit-touch-callout: none;                /* 禁止长按菜单 */
    user-select: none;                           /* 禁止选中文本（标准） */
    -webkit-user-select: none;                   /* 兼容 WebKit */
    -moz-user-select: none;                      /* 兼容 Firefox */
    -ms-user-select: none;                        /* 兼容 IE/Edge */
    /* 强制禁用所有动画和过渡 */
    transition: none !important;
    animation: none !important;
}

html {
    font-size: 16px;
}

body {
    background-color: var(--counter-bg);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
    color: var(--counter-text);
    -webkit-text-size-adjust: 100%;              /* 禁止字体自动调整 */
    text-size-adjust: 100%;
    touch-action: pan-y;                          /* 仅允许垂直滚动，禁止缩放和水平滚动 */
}

.homepage-intro {
    max-width: 800px;
    margin: 0 auto 5px auto;
    padding: 8px 5px;
    background-color: #ffffff;
    border-left: 8px solid var(--counter-primary);
    border-radius: 16px;
    text-align: center;
}

.homepage-intro h1 {
    font-size: 1.8rem;
    color: var(--counter-secondary);
    font-weight: bold;
    line-height: 1.2;
}

.homepage-intro p {
    font-size: 1.2rem;
    color: #2c3e50;
    line-height: 1.3;
    margin: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .homepage-intro {
        padding: 8px 8px;
        margin-bottom: 9px;
        border-left-width: 6px;
    }
    .homepage-intro h1 {
        font-size: 1.5rem;
    }
    .homepage-intro p {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .homepage-intro {
        padding: 5px 5px;
        margin-bottom: 5px;
        border-left-width: 5px;
        border-radius: 12px;
    }
    .homepage-intro h1 {
        font-size: 1.3rem;
    }
    .homepage-intro p {
        font-size: 1.1rem;
    }
}

@media (max-width: 360px) {
    .homepage-intro {
        padding: 3px 3px;
    }
    .homepage-intro h1 {
        font-size: 1.2rem;
    }
    .homepage-intro p {
        font-size: 1rem;
    }
}

/* 离线提示样式 */
.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;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.offline-indicator.show {
    display: block;
}

.offline-indicator.online {
    background: #5a9c20;
}

/* 主容器 */
.counter-container {
    max-width: 800px;
    margin: 0 auto 10px auto;
    padding: 10px;
    background: var(--counter-card);
    border-radius: 25px;
    border: 6px solid var(--counter-border);
    position: relative;
    min-height: 95vh;
}

/* 紧凑状态栏 - 简化 */
.compact-status-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 10px 0 0 0;
    padding: 3px 3px;
    background: #5a9c20;
    border-radius: 15px;
}

.status-item {
    text-align: center;
    color: white;
    padding: 0px 5px;
}

.status-label {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 0px;
    opacity: 0.9;
    letter-spacing: 1px;
}

.status-value {
    display: block;
    font-size: 2.2rem;
    margin:0;
    padding:0;
    font-weight: bold;
    font-family: 'Arial Black', 'Microsoft YaHei', sans-serif;
    white-space: nowrap;
}

/* 主要计数区域 */
.counter-main-area {
    text-align: center;
    padding: 0 10px;
    line-height:1;
}

.number-label {
    font-size: 1.3rem;
    color: var(--counter-primary);
    font-weight: bold;
    margin:5px;
}

/* 大数字显示 - 简化 */
.big-number-display {
    font-size: 7rem;
    font-weight: bold;
    color: var(--counter-primary);
    margin: 0;
    font-family: 'Arial Black', 'Microsoft YaHei', sans-serif;
    min-height: 80px;
    line-height:80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom:150px;
}

/* 超大念佛按钮 - 简化，无动画 */
.huge-buddha-button {
    width: 100%;
    max-width: 700px;
    height: 300px;
    margin: 0 auto 180px;
    background: #5a9c20;
    border: none;
    border-radius: 140px;
    color: white;
    cursor: pointer;
    display: block;
    border: 8px solid rgba(255, 255, 255, 0.2);
    touch-action: manipulation;        /* 禁用双击缩放，避免触发文本选择 */
}

.huge-buddha-button:active {
    background: #4a7c1a; /* 按下立即变色，无过渡 */
}

.huge-buddha-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.buddha-icon {
    font-size: 5.5rem;
    margin-bottom: 20px;
}

.buddha-text {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.buddha-hint {
    font-size: 1.6rem;
    opacity: 0.9;
    font-weight: normal;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    margin-top: 0px;
}

/* 进度条区域 - 简化 */
.progress-area {
    background: var(--counter-bg);
    border-radius: 20px;
    padding: 15px 30px 10px 30px;
    margin: 20px 0 30px 0;
    border: 4px solid var(--counter-border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-title {
    font-size: 1.8rem;
    color: var(--counter-text);
    font-weight: bold;
}

.progress-goal {
    font-size: 1.6rem;
    color: var(--counter-primary);
    font-weight: bold;
    background: rgba(90, 156, 32, 0.1);
    padding: 8px 15px;
    border-radius: 12px;
}

.progress-container {
    height: 35px;
    background: #e0e0e0;
    border-radius: 17px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 3px solid var(--counter-border);
}

/* 移除进度条动画 */
.progress-bar {
    height: 100%;
    background: #5a9c20;
    border-radius: 15px;
    width: 0%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 1.8rem;
    font-weight: bold;
}

.progress-text {
    color: var(--counter-primary);
}

.progress-percent {
    color: var(--counter-accent);
}

/* 目标设置区域 */
.goal-setting-area {
    background: var(--counter-bg);
    border-radius: 20px;
    padding: 15px;
    margin: 15px 0;
    border: 4px solid var(--counter-border);
}

.goal-title {
    font-size: 1.8rem;
    color: var(--counter-primary);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.goal-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 10px 0;
}

.goal-adjust {
    width: 70px;
    height: 70px;
    background: var(--counter-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2.6rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goal-adjust.minus {
    background: var(--counter-accent);
}

.goal-adjust:active {
    filter: brightness(0.9); /* 按下时微暗，立即变化 */
}

.goal-value {
    font-size: 4rem;
    font-weight: bold;
    color: var(--counter-text);
    min-width: 160px;
    text-align: center;
    font-family: 'Arial Black', 'Microsoft YaHei', sans-serif;
}

/* 快捷目标选择 */
.goal-quick-select {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
}

.quick-goal {
    padding: 15px 20px;
    background: white;
    border: 3px solid var(--counter-border);
    border-radius: 15px;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--counter-text);
    cursor: pointer;
    min-width: 90px;
    text-align: center;
    flex: 1 0 auto;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-goal:active {
    background: #e0e0e0; /* 按下立即变色 */
}

.quick-goal.active {
    background: var(--counter-primary);
    color: white;
    border-color: var(--counter-primary);
}

/* 折叠设置面板 - 简化，无动画 */
.settings-panel {
    position: fixed;
    top: 0;
    left: -400px;
    width: 350px;
    height: 100%;
    background: var(--counter-card);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-right: 6px solid var(--counter-border);
    overflow-y: auto;
}

.settings-panel.open {
    left: 0;
}

.settings-content {
    padding: 30px 25px;
}

.panel-title {
    font-size: 1.8rem;
    color: var(--counter-primary);
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--counter-border);
}

.panel-settings {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.panel-item {
    background: var(--counter-bg);
    border-radius: 15px;
    padding: 20px;
    border: 3px solid var(--counter-border);
}

.panel-checkbox {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.5rem;
    color: var(--counter-text);
    cursor: pointer;
}

.panel-checkbox input[type="checkbox"] {
    width: 32px;
    height: 32px;
    cursor: pointer;
    appearance: none;
    border: 2px solid #ccc;
    border-radius: 4px;
    outline: none;
    position: relative;
}

.panel-checkbox input[type="checkbox"]:checked {
    background-color: #5a9c20;
    border-color: #5a9c20;
}

.panel-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.checkbox-icon {
    font-size: 1.8rem;
    width: 40px;
    text-align: center;
}

.checkbox-text {
    font-weight: bold;
    flex: 1;
}

.panel-footer {
    text-align: center;
    padding-top: 30px;
    border-top: 3px solid var(--counter-border);
}

.panel-tip {
    font-size: 1.3rem;
    color: var(--counter-primary);
    font-weight: bold;
    line-height: 1.6;
}

/* 遮罩层 */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.show {
    display: block;
}

/* 成功提示 - 简化 */
.toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--counter-accent);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    opacity: 0;
    z-index: 1000;
    text-align: center;
    max-width: 90%;
    white-space: nowrap;
    line-height: 1.5;
}

.toast.show {
    opacity: 1;
}

.toast.error {
    background: var(--counter-danger);
}

/* 本地存储提醒样式 */
.counter-storage-notice {
    background: #fff9e6;
    border: 2px dashed #ff9900;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0 20px 0;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #856404;
    text-align: left;
}

.counter-storage-notice strong {
    color: #d35400;
    font-size: 1.5rem;
    display: block;
    margin-bottom: 8px;
}

.counter-storage-notice ul {
    margin: 10px 0 5px 0;
    padding-left: 20px;
}

.counter-storage-notice li {
    margin-bottom: 6px;
    position: relative;
    padding-left: 5px;
}

/* ========= FAQ 模块样式 ========= */
.faq-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.faq-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

.faq-item {
    margin-bottom: 18px;
}

.faq-item h3 {
    font-size: 18px;
    margin-bottom: 6px;
    color: #333;
}

.faq-item p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* FAQ 响应式优化 */
@media (max-width: 768px) {
    .faq-section {
        margin: 30px 15px;
        padding: 18px;
    }
    .faq-section h2 {
        font-size: 20px;
    }
    .faq-item h3 {
        font-size: 17px;
    }
    .faq-item p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .faq-section {
        margin: 25px 10px;
        padding: 15px;
    }
    .faq-section h2 {
        font-size: 19px;
    }
    .faq-item h3 {
        font-size: 16px;
    }
    .faq-item p {
        font-size: 14px;
    }
}

/* ========= 响应式设计 ========= */

/* 平板设备 */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .counter-container {
        margin: 0 auto 5px auto;
        padding: 5px;
        border-radius: 20px;
        min-height: 90vh;
    }

    .compact-status-bar {
        margin-top: 5px;
        gap: 8px;
        padding: 5px 3px;
    }

    .status-label {
        font-size: 1.5rem;
        margin-bottom: 0;
    }

    .status-value {
        font-size: 1.8rem;
    }

    .big-number-display {
        font-size: 5.5rem;
        min-height: 60px;
        line-height:80px;
        margin: 0;
        margin-bottom:150px;
    }

    .huge-buddha-button {
        height: 250px;
        border-radius: 110px;
        max-width: 95%;
        margin-bottom:180px;
    }

    .buddha-icon {
        font-size: 4.5rem;
    }

    .buddha-text {
        font-size: 2.5rem;
    }

    .buddha-hint {
        font-size: 1.5rem;
    }

    .goal-value {
        font-size: 3rem;
    }

    .goal-adjust {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .quick-goal {
        padding: 12px 15px;
        font-size: 1.4rem;
        max-width: 100px;
        min-width: 80px;
    }

    .settings-panel {
        width: 300px;
        left: -300px;
    }

    .progress-area {
        padding: 10px 25px 10px 25px;
    }

    .counter-storage-notice {
        font-size: 1.3rem;
        padding: 12px;
        margin: 12px 0 15px 0;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .counter-container {
        margin: 0 auto 5px auto;
        padding: 3px;
    }

    .compact-status-bar {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 2px;
        padding: 0px 3px;
        gap: 6px;
    }

    .status-item {
        padding: 3px 1px;
    }

    .status-label {
        font-size: 1.5rem;
        margin-bottom: 2px;
    }

    .status-value {
        font-size: 1.6rem;
    }

    .big-number-display {
        font-size: 4.5rem;
        min-height: 50px;
        line-height:50px;
        margin-bottom:150px;
    }

    .huge-buddha-button {
        height: 220px;
        border-radius: 90px;
        margin-bottom: 180px;
    }

    .buddha-icon {
        font-size: 3.5rem;
        margin-bottom: 10px;
    }

    .buddha-text {
        font-size: 2rem;
    }

    .buddha-hint {
        font-size: 1rem;
        padding: 6px 15px;
    }

    .goal-display {
        flex-direction: column;
        gap: 15px;
        margin: 20px 0;
    }

    .goal-quick-select {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .quick-goal {
        max-width: 90px;
        min-width: 75px;
        padding: 10px 12px;
        font-size: 1.3rem;
        flex: 0 1 calc(33.333% - 10px);
        max-width: calc(33.333% - 10px);
        min-width: auto;
        box-sizing: border-box;
    }

    .settings-panel {
        width: 280px;
        left: -280px;
    }

    .progress-info {
        font-size: 1.5rem;
    }

    .progress-area {
        padding: 15px 20px 10px 20px;
        margin: 10px 0 20px 0;
    }

    .toast {
        padding: 10px 20px;
        font-size: 1.4rem;
        max-width: 95%;
        white-space: nowrap;
        line-height: 1.2;
    }

    .counter-storage-notice {
        font-size: 1.2rem;
        padding: 10px;
        margin: 10px 0 12px 0;
    }
}

/* 小屏手机 */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    .compact-status-bar {
        margin-top: 2px;
        padding: 0;
        gap: 4px;
    }

    .status-item {
        padding: 0;
    }

    .status-label {
        font-size: 1.3rem;
        margin-bottom: 1px;
    }

    .status-value {
        font-size: 1.4rem;
    }

    .big-number-display {
        font-size: 3.5rem;
        min-height: 30px;
        line-height:30px;
        margin-bottom:150px;
    }

    .huge-buddha-button {
        height: 180px;
        margin-bottom:180px;
    }

    .buddha-icon {
        font-size: 3rem;
    }

    .buddha-text {
        font-size: 1.8rem;
    }

    .quick-goal {
        max-width: 80px;
        min-width: 70px;
        padding: 8px 10px;
        font-size: 1.2rem;
        flex: 0 1 calc(33.333% - 8px);
        max-width: calc(33.333% - 8px);
    }

    .counter-storage-notice {
        font-size: 1.1rem;
        padding: 8px;
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .counter-container {
        min-height: auto;
        padding: 5px;
    }

    .compact-status-bar {
        margin-top: 3px;
        grid-template-columns: repeat(4, 1fr);
        padding: 3px 3px;
    }

    .status-label {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }

    .status-value {
        font-size: 1.4rem;
    }

    .big-number-display {
        font-size: 4rem;
        min-height: 70px;
        line-height:70px;
        margin-bottom:150px;
    }

    .huge-buddha-button {
        height: 180px;
        margin-bottom: 180px;
    }

    .buddha-icon {
        font-size: 3rem;
    }

    .buddha-text {
        font-size: 1.8rem;
    }

    .progress-area {
        padding: 10px 15px 5px 15px;
        margin: 10px 0 15px 0;
    }

    .goal-setting-area {
        padding: 15px;
        margin: 15px 0;
    }

    .goal-quick-select {
        gap: 6px;
        margin: 15px 0;
    }

    .quick-goal {
        padding: 8px 10px;
        font-size: 1.1rem;
        max-width: 80px;
        min-width: 70px;
        flex: 0 1 calc(33.333% - 6px);
        max-width: calc(33.333% - 6px);
    }

    .counter-storage-notice {
        padding: 10px;
        margin: 10px 0;
    }
}

/* 通道选择浮层 (ActionSheet) - 无动画 */
.channel-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    transform: translateY(100%);
    z-index: 10000;
    padding: 20px 0 10px;
}
.channel-sheet.show {
    transform: translateY(0);
}
.channel-sheet-header {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    padding: 10px 0 20px;
    border-bottom: 1px solid #eee;
}
.channel-sheet-options {
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
}
.channel-option {
    background: none;
    border: none;
    padding: 15px 20px;
    font-size: 1.8rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    color: #333;
}
.channel-option:active {
    background: #f5f5f5; /* 按下立即变色 */
}
.channel-option.active {
    color: #4a6fa5;
    font-weight: bold;
    background: #eef4ff;
}
.channel-sheet-cancel {
    margin-top: 10px;
    padding: 15px 20px;
    font-size: 1.8rem;
    text-align: center;
    color: #ff5555;
    border-top: 1px solid #eee;
    cursor: pointer;
    font-weight: bold;
}
.channel-sheet-cancel:active {
    background: #ffe5e5; /* 按下立即变色 */
}

/* 设置面板中的清零按钮区域 */
.panel-clear-buttons {
    display: flex;
    justify-content: space-around;
    padding: 15px 10px 20px 10px;
    border-top: 1px solid #eee;
    margin-top: 5px;
}
.clear-btn {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 1.6rem;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    flex: 0 1 auto;
    min-width: 120px;
}
.clear-btn:active {
    background: #e9ecef; /* 按下立即变色 */
}
.clear-btn#resetAllBtn {
    border-color: #ffaa66;
    color: #ff8c00;
}
.clear-btn#resetAllBtn:active {
    background: #fff2e6; /* 按下立即变色 */
}

/* 清零按钮上方提示文字 */
.clear-hint {
    text-align: center;
    font-size: 1.4rem;
    color: #888;
    padding: 8px 0 5px 0;
    border-bottom: 1px dashed #ddd;
    margin-bottom: 5px;
    letter-spacing: 1px;
}