/* ========== 全局基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}
html {
    -webkit-text-size-adjust: 100%; /* 禁止iOS自动调整字体大小 */
    text-size-adjust: 100%; /* 标准属性 */
    touch-action: manipulation; /* 优化触摸行为，避免误触缩放 */
}
body {
    background: #fff;
    padding: 20px;
}
/* ========== 每日一句 ========== */
.daily_sentence{ line-height:30px; color:#666; margin:0px 20px;}
.daily_sentence img{ width:23px; height:23px; cursor: pointer; margin-right:10px;}

.daily_sentence .hsk1-6 a{ float:right; color:#666}
.daily_sentence .hsk1-6 a:hover{  color:#4caf50}


/* ========== 顶部标题 ========== */
.dict-title {
    width: 100%;
    max-width: 800px;
    margin:25px auto 35px;
    font-size: 50px;
    font-weight:700;
    color: #000;
    text-align: center;
    letter-spacing: 0px; /* 缩小间距 */
}
.index-top{ margin-top:200px;}

/* ========== 搜索栏核心样式 ========== */
.search-bar {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* 防止移动端flex布局溢出 */
}

/* ========== 搜索输入框基础样式 ========== */
#search-input {
    flex: 1 1 auto;
    min-width: 0; /* 关键：防止移动端输入框溢出 */
    height: 50px;
    padding: 0 15px;
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.2s ease;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    line-height: 1;
}
#search-input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
    outline: none;
}

/* ========== 输入框警告样式（放到最前面，优先级最高） ========== */
#search-input.empty-tip::placeholder,
#search-input.empty-tip::-webkit-input-placeholder,
#search-input.empty-tip::-moz-placeholder,
#search-input.empty-tip:-ms-input-placeholder,
#search-input.empty-tip::-ms-input-placeholder {
    color: #ff0 !important;
    font-weight: bold !important;
    opacity: 1 !important;
    line-height: normal !important;
}
#search-input.empty-tip {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 1px rgba(255, 68, 68, 0.1) !important;
    border-right: none !important;
}

/* ========== 搜索按钮样式 ========== */
.search-btn {
    height: 50px;
    padding: 0 25px;
    background-color: #4CAF50;
    color: #fff;
    border: 1px solid #4CAF50;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.search-btn:hover {
    background-color: #45a049;
}

/* ========== 标签栏样式 ========== */
.tab-nav {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 0px;
    border-bottom: 0px solid #e5e7eb;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.tab-item {
    padding: 5px 10px;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    border: 1px solid #e5e7eb; /* 先给所有边设基础1px */
    border-bottom-width: 0px; /* 单独修改底边宽度 */
    border-radius: 4px 4px 0 0;
    font-size: 14px;
}
.tab-item.active {
    background: #fff;
    color: #45a049;
    font-weight: 500;
}
.tab-item:hover {
    color: #45a049;
}

/* ========== 词汇列表样式 ========== */
.words_list {
    width: 100%;
    max-width: 800px; /* 固定最大宽度，避免撑开 */
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin: 10px auto;
    padding: 0; /* 清除默认内边距 */
    list-style: none; /* 清除li圆点 */
}
.words_list li {
    width: 100%; /* 适配父容器，不溢出 */
    padding: 10px;
    margin: 0; /* 清除默认间距 */
    text-align: left;
    font-weight: bold;
    color: #4CAF50 !important;
    cursor: pointer;
    border-bottom: 1px solid #f7f7f7;
}
.words_list li:hover{ 
    background:#eee;
}
.words_list li span { 
    font-weight: normal; 
    color: #999;
}

/* ========== 内容容器样式 ========== */
.content-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-bottom-width: 1px; /* 单独修改底边宽度 */
    border-radius: 0px 4px 0px 0px;
}

/* ========== 折叠面板样式 ========== */
.collapse-panel {
    border-bottom: 1px solid #e5e7eb;
    display: block;
}
.vn_panel{
    border-bottom: 0px!important;
}
.collapse-panel.hidden {
    display: none;
}
.collapse-header {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
}
.collapse-icon {
    color: #45a049;
    font-size: 12px;
    font-weight: bold;
    /* 核心：用伪元素实现实心图标 */
    display: inline-block;
    transition: transform 0.2s; /* 折叠展开时的旋转动画 */
}
.collapse-title {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}
.collapse-content {
    padding: 15px 12px 10px 25px;  
}
.collapse-content p { 
    line-height: 1.9rem;
}

/* ========== 文本样式 ========== */
.pos {
    color: #6b7280;
    margin-right: 6px;
}
.abbr {
    font-weight: 500;
    margin-right: 6px;
}
a {
    color: #45a049;
    text-decoration: none;
}
.key{
    color: #45a049;
}
a:hover {
    text-decoration: none;
}

/* ========== 例句样式 ========== */
.example-item {
    margin:15px 0!important;
}
.example-vi {
    margin-bottom: 2px;
}
.example-vi span{
    cursor:pointer;
}
.example-vi span img {
    width: 20px;
    height: 20px;
    display: inline-block;
}
.example-cn {
    color:#a8a8a8;
    padding-left: 15px;
}

/* ========== 近义词/解析样式 ========== */
.syn-title {
    margin: 6px 0;
    color: #6b7280;
}
.analyze-text {
    margin: 6px 0;
    line-height: 1.8;
}
.assoc-word {
    margin-right: 6px;
}
.phrase-item {
    margin: 4px 0;
}

/* ========== 其他样式 ========== */
.word-count { 
    font-weight: bold; 
    color: #13a300; 
}
.footer { 
    margin-top: 50px; 
    font-size: 1rem; 
    color: #999; 
    text-align: center;
}
.index-foot{ margin-top:50vh;}
.words_title{ 
    margin: 40px auto;
    line-height: 35px;
    max-width: 800px; /* 固定最大宽度，避免撑开 */
}
.words_title img{ 
    width: 23px; 
    height: 23px;
}
.words_title b{ 
    font-size: 34px; 
    font-weight: 600; 
    width: 100%; 
}
.words_title span{
    display:inline-block;
    cursor:pointer;
    margin: 0px 0px 0px 10px;
}
.words_title .vncn{
    font-size: 14px; 
    color: #999!important;
    font-weight: normal;
    font-style: normal;
}

/* ========== 关键词高亮样式 ========== */
.highlight-word {
    background-color: #d5f0d1; /* 浅黄色背景（醒目不刺眼） */
    color: #333; /* 玫红色字体 */
    padding: 0px 2px; /* 左右内边距，避免文字贴边 */
    border-radius: 2px; /* 圆角，更美观 */
    font-weight: 500; /* 字体稍粗，突出显示 */
}

/* ========== 移动端适配（768px以下） ========== */
@media screen and (max-width: 768px) {
    /* 全局内边距缩小 */
    body {
        padding: 20px;
    }

    /* 顶部标题适配：字号随屏幕缩小 */
    .dict-title {
        font-size: 30px; /* PC是50px，移动端缩小 */
        margin: 15px auto 20px; /* 上下间距减小 */
    }

    /* 搜索栏适配：高度降低+间距调整 */
    .search-bar {
        margin: 0 auto 10px;
    }
    #search-input {
        height: 44px; /* PC是50px，移动端更贴合手指操作 */
        font-size: 16px; /* 输入文字放大，方便查看 */
    }
    #search-input.empty-tip {
        height: 44px !important;
    }
    .search-btn {
        height: 44px;
        padding: 0 15px; /* 按钮内边距缩小，适配窄屏 */
        font-size: 15px;
    }
	.daily_sentence{ display: none !important; /* !important 确保覆盖原有样式 */}

    /* 标签栏适配：换行时更紧凑，字号调整 */
    .tab-nav {
        gap: 2px;
        margin: 0 auto 0;
		display: none !important; /* !important 确保覆盖原有样式 */
    }
    .tab-item {
        padding: 4px 8px;
        font-size: 13px;
    }

    /* 词汇列表适配：移动端点击更友好 */
    .words_list {
        max-width: 100%; /* 移动端占满屏幕宽度 */
        margin: 5px auto;
    }
    .words_list li {
        padding: 12px 10px; /* 增大点击区域 */
        font-size: 15px;
    }

    /* 内容容器适配：占满屏幕宽度，边框优化 */
    .content-container {
        max-width: 100%;
        border-radius: 4px; /* 移动端圆角更柔和 */
    }

    /* 折叠面板适配：缩进减小，方便阅读 */
    .collapse-content {
        padding: 12px 8px 8px 15px; /* PC是15px 12px 10px 25px，移动端缩进减小 */
    }
    .collapse-content p {
        line-height: 1.8rem; /* 行高稍调，适配小屏 */
        font-size: 15px; /* 正文放大，提升可读性 */
    }

    /* 例句适配：移动端更紧凑 */
    .example-item {
        margin: 10px 0 !important;
    }
    .example-cn {
        padding-left: 10px; /* 缩进减小 */
        font-size: 14px;
    }
    .example-vi span img {
        width: 18px;
        height: 18px; /* 发音图标缩小 */
    }

    /* 页脚适配：字号减小，间距调整 */
    .footer {
        margin-top: 30px;
        font-size: 1rem;
        padding: 0 10px;
    }

    /* 词汇标题适配 */
    .words_title {
        margin: 20px auto;
        line-height: 30px;
    }
    .words_title b {
        font-size: 24px; /* PC是34px，移动端缩小 */
    }

    /* ========== 移动端点击反馈（优化体验） ========== */
    .search-btn:active,
    .tab-item:active,
    .words_list li:active,
    .collapse-header:active {
        background-color: #f0f0f0; /* 点击时的灰色反馈 */
        opacity: 0.9;
    }
    /* 绿色按钮点击反馈 */
    .search-btn:active {
        background-color: #3d8b40;
    }
}