/* 设置全局样式 */
/* 标签容器 */
.tab-container {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin: 1rem 0;
}

/* 标签导航 */
.tab-nav {
  padding: 1rem 1rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  gap: 1rem;
}

.tab-button {
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  color: #666;
  position: relative;
}

.tab-button.active {
  background: #42b983 !important;
  color: white !important;
  font-weight: 500;
  position: relative;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

/* 内容区域 */
.tab-content {
  padding: 1rem;
  transition: opacity 0.3s ease;
  /* min-height: 150px; */
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}
/* 防止过度下拉刷新 */
html {
  overscroll-behavior-y: none;
  height: 100%;
  /* overflow: hidden; */
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 主容器 */
#app {
  display: flex;
  flex-direction: column;
  min-height: calc(100% + 1px);
  /* 确保容器至少占满整个视口高度 */
}

/* 内容区域 */
.content {
  flex: 1;
  /* 内容区域占据剩余空间 */
}

.loginA {
  display: none;
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: white;
  border-radius: 8px;
  min-width: 400px;  /* 最小宽度保持统一 */
}

.loginB, .loginC ,.loginD{
  position: relative;
  transition: opacity 0.3s ease;
}

.loginB {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  min-height: 200px;
  margin: auto;
  text-align: center
}

.loginB input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size:16px
}


.loginC {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  min-height: 200px;
  margin: auto;
  text-align: center
}
.loginC input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size:16px
}


.loginD {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  min-height: 200px;
  margin: auto;
  text-align: center
}
.loginD input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size:16px
}

.aabutton{
  background:#42b983;
  color:white;
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size:16px
}
  /* Footer 样式 */
  .footer {
    text-align: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 14px;
    margin-top: auto;
    /* 让footer始终在底部 */
  }

  /* 确保所有fixed元素使用border-box模型 */
  * {
    box-sizing: border-box;
  }

  /* 修复移动端flex布局问题 */
  @media screen and (max-width: 768px) {
    #password-modal {
      align-items: flex-start;
      padding: 20px;
    }
  }

#confirm-password {
  margin-top: 8px;
}

#password-match {
  transition: all 0.3s ease;
  padding-left: 5px;
}

input:focus {
  border-color: #42b983 !important;
  box-shadow: 0 0 0 2px rgba(66, 185, 131, 0.2) !important;
}

input:valid + input:valid {
  /* border-color: #28a745 !important; */
}

input:invalid {
  /* border-color: #dc3545 !important; */
}

/* 确保子元素的显示控制 */
.loginD, .loginB, .loginC {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#article-price {
  font-weight: 500;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #ddd;
  margin: 0 2rem 1.5rem;
}

/* 退出按钮悬停效果 */
button[onclick="logout()"] {
  transition: background 0.3s ease;
}
button[onclick="logout()"]:hover {
  background: #c82333 !important;
}

/* 添加返回按钮样式 */
a[href="#/"]::before {
  content: "← ";
  font-size: 1.1em;
}

.copy-guard {
    display: inline-block;
    color: rgba(255,0,0,0.3) !important;
    font-size: 0.8em;
    position: relative;
    top: -0.1em;
    animation: blink 1.5s infinite;
    pointer-events: none;
    user-select: all;
}

@keyframes blink {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}



/* ==================== 移动端适配优化 ==================== */

/* 平板设备 (768px - 1024px) */
@media screen and (max-width: 1024px) {
  .loginA {
    min-width: 350px;
  }
  
  .tab-nav {
    padding: 0.8rem 0.8rem 0;
  }
}

/* 手机设备 (最大 768px) */
@media screen and (max-width: 768px) {
  /* 弹窗适配 */
  .loginA {
    min-width: 90%;
    max-width: 90%;
    top: 30%;
  }
  
  .loginB, .loginC, .loginD {
    padding: 1.5rem;
    width: 100%;
  }
  
  /* 标签导航适配 */
  .tab-nav {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .tab-button {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  /* 内容区域适配 */
  .tab-content {
    padding: 0.8rem;
  }
  
  /* 文章列表适配 */
  #app ul {
    padding-left: 1rem;
  }
  
  #app li {
    margin-bottom: 0.8rem;
  }
}

/* 小屏手机 (最大 480px) */
@media screen and (max-width: 480px) {
  /* 弹窗进一步优化 */
  .loginA {
    top: 25%;
    min-width: 95%;
  }
  
  .loginB, .loginC, .loginD {
    padding: 1rem;
  }
  
  .loginB h3, .loginC h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  /* 输入框优化 */
  .loginB input, .loginC input, .loginD input {
    padding: 0.6rem;
    margin-bottom: 1rem;
    font-size: 15px;
  }
  
  /* 按钮优化 */
  .aabutton {
    padding: 0.6rem;
    margin-bottom: 1rem;
    font-size: 15px;
  }
  
  /* 标签导航紧凑布局 */
  .tab-nav {
    padding: 0.5rem;
    gap: 0.3rem;
  }
  
  .tab-button {
    padding: 5px 10px;
    font-size: 13px;
  }
  
  /* 文章价格显示 */
  #article-price {
    font-size: 1rem;
    margin: 0 1rem 1rem;
  }
  
  /* 链接按钮优化 */
  a[href="#/"], a[href^="mailto:"] {
    font-size: 14px;
    padding: 0.3rem 0;
    display: inline-block;
  }
}

/* 横屏模式优化 */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .loginA {
    top: 10%;
    transform: translate(-50%, 0);
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .loginB, .loginC, .loginD {
    padding: 1rem;
  }
  
  .loginB input, .loginC input, .loginD input {
    margin-bottom: 0.8rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 增大可点击区域 */
  .tab-button {
    min-height: 44px;
    min-width: 44px;
  }
  
  button, a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* 移除悬停效果 */
  button:hover, a:hover {
    background: inherit !important;
  }
  
  /* 添加点击反馈 */
  button:active, a:active {
    opacity: 0.7;
    transform: scale(0.98);
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 确保文字清晰 */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
