/* ========================================================================
   通用全局重置 & 基础配色
   - 兼容 PC 和 H5手机端
   - 字体选用“Helvetica Neue / Segoe UI / 系统默认”，配色以科技蓝为主
=========================================================================== */

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100%;
  font-family: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  background-color: #f0f2f5;
  color: #1f2c4d;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 链接默认状态 */
a {
  color: #1a73e8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* 输入框、按钮、卡片等统一圆角 */
input, button, .card, .form-card {
  border-radius: 6px;
}

/* ========================================================================
   登录/注册/弹窗等通用样式（.container + .form-card + .input-group + .btn）
=========================================================================== */

/* 容器：水平 & 垂直居中 */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 0 16px; /* 手机端左右留白 */
}

/* 卡片式表单 —— 用于登录、注册等页 */
.form-card {
  background: #ffffff;
  padding: 32px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 360px; /* PC上不超过360px，手机上铺满留16px留白 */
  animation: fadeIn 0.3s ease-in-out;
}

/* 卡片标题 */
.form-card h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 22px;
  color: #1f2c4d;
  letter-spacing: 1px;
}

/* 输入组 */
.input-group {
  margin-bottom: 18px;
}
.input-group label {
  display: block;
  font-size: 14px;
  color: #1f2c4d;
  margin-bottom: 6px;
}
.input-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: #fafafa;
}
.input-group input:focus {
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 6px rgba(26, 115, 232, 0.2);
}

/* 验证码行 */
.captcha-group {
  display: flex;
  align-items: flex-end;
}
.captcha-group .input-left {
  flex: 1;
}
.captcha-group img {
  margin-left: 10px;
  height: 42px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.captcha-group img:hover {
  opacity: 0.8;
}

/* 按钮 */
.btn {
  width: 100%;
  background-color: #1a73e8;
  color: #fff;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  letter-spacing: 0.5px;
}
.btn:hover {
  background-color: #1669c1;
}

/* 错误提示文字 */
.error {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: #f44336;
}

/* 底部链接提示（登录页⇄注册页互跳） */
.link-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}
.link-footer a {
  color: #1a73e8;
  text-decoration: none;
}
.link-footer a:hover {
  text-decoration: underline;
}

/* 登录/注册小屏适配 */
@media screen and (max-width: 360px) {
  .form-card {
    padding: 24px 16px;
  }
  .form-card h1 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  .input-group input {
    padding: 8px 10px;
    font-size: 14px;
  }
  .btn {
    padding: 10px;
    font-size: 14px;
  }
  .captcha-group img {
    height: 38px;
    margin-left: 8px;
  }
}

/* 弹窗淡入效果 */
@keyframes fadeIn {
  from { opacity: 0; } 
  to { opacity: 1; }
}

/* ========================================================================
   登录后整体布局 —— 侧边栏 + 主内容区
=========================================================================== */

/* 页面主体：flex 布局，侧边栏 + 内容区并排 */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: #2c3e50;
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding-top: 40px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  animation: fadeIn 0.3s ease-in-out;
}

/* 侧边栏标题 */
.sidebar h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 20px;
  letter-spacing: 1px;
}

/* 侧边栏导航链接 */
.sidebar a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  font-size: 15px;
  transition: background 0.2s;
}
.sidebar a:hover {
  background: #34495e;
}

/* 当前激活页面的高亮 */
.sidebar a.active {
  background: #1a73e8;
}

/* 主内容区 */
.main {
  flex-grow: 1;
  padding: 40px;
  background: #f4f6f8;
}

/* 主内容标题 */
.main h2 {
  font-size: 24px;
  color: #1f2c4d;
  margin-bottom: 25px;
}

/* 公告 & 卡片等 */
.card {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease-in-out;
}
.card h3 {
  margin-top: 0;
  font-size: 18px;
  color: #1f2c4d;
  margin-bottom: 12px;
}
.card p, .card ul, .card li {
  color: #444;
  font-size: 14px;
  line-height: 1.6;
}
.card ul {
  padding-left: 18px;
  margin: 8px 0 0 0;
}
.card li {
  margin-bottom: 8px;
}

/* 公告列表 */
.gonggao a {
  color: #1a73e8;
  font-weight: bold;
  font-size: 15px;
}
.gonggao a:hover {
  text-decoration: underline;
}

/* “无套餐”或“未激活”文字灰色 */
.text-muted {
  color: #888;
}

/* ========================================================================
   弹窗公告模块（覆盖登录后所有页面）
=========================================================================== */

/* 弹窗遮罩层（全屏，居中） */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none; /* 默认为隐藏 */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-in-out;
}

/* 弹窗内容盒子 */
.modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 25px 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease-out;
}
.modal-box h2 {
  margin-top: 0;
  font-size: 22px;
  color: #333;
}
.modal-content {
  margin: 15px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #444;
}
.modal-time {
  color: #888;
  font-size: 12px;
  text-align: right;
  margin-bottom: 10px;
}
.modal-close {
  background: #1a73e8;
  color: #fff;
  padding: 10px 20px;
  border: none;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}
.modal-close:hover {
  background: #155acb;
}

/* 弹窗下拉动画 */
@keyframes slideDown {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========================================================================
   登录后布局的响应式（当屏幕较窄时，侧边栏变为可折叠）
=========================================================================== */
@media screen and (max-width: 768px) {
  /* 整体布局变为纵向：先侧边栏，再内容 */
  .app-wrapper {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    padding: 20px 0;
  }
  .sidebar h3 {
    margin-bottom: 20px;
  }
  .sidebar a {
    padding: 10px 16px;
    font-size: 14px;
  }
  .main {
    padding: 20px;
  }
}
