/* =========================================================
   DigiStreet Global Base Styles (v1)
   ========================================================= */

/* ===== Root Variables ===== */
:root {
  --primary: #009688;
  --secondary: #FF7043;
  --bg: #ffffff;
  --text: #ffffff;
  --gray: #bcbcbc;
  --radius: 12px;
}

/* ===== Reset & Global ===== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  /*background: url('../images/test1.png') center/cover no-repeat fixed;*/
  background: radial-gradient(circle at top, #656676 0, #26273d 55%, #2b2e49 100%);
  position: relative;
  overflow-x: hidden;
}

/* ===== Background Blur Layer ===== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  filter: blur(3px) brightness(0.9);
  transform: scale(1.05);
  z-index: -1;
}

/* ===== Links ===== */
a {
  text-decoration: none;
  color: inherit;
}

/* =========================================================
   Header / Navigation
   ========================================================= */
header.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 2rem;
  background-color: rgba(51, 55, 53, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: rgba(114, 227, 21, 0.807);
}

.navbar .logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar .nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  transition: color 0.2s ease;
}

.navbar .nav-links a:hover {
  color: var(--secondary);
}

/* 昵称在导航条里的基础样式 */
.navbar .nav-links #navUserName {
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}

/* 昵称 hover 时的高亮效果，与链接保持一致 */
.navbar .nav-links #navUserName:hover {
  color: var(--secondary); /* 和 .nav-links a:hover 用同一个变量 */
}

.navbar select {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
}

/* ===== Global notice bar (under navbar) ===== */
.notice-bar {
  display: none; /* 默认隐藏，通过 JS 切换为 flex 显示 */
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* 显示状态 */
.notice-bar.notice-visible {
  display: flex;
}

/* =========================================================
   Hero / Welcome Section
   ========================================================= */
main {
  max-width: 1200px;
  margin: 0rem auto;
  text-align: center;
}

.hero {
  text-align: center;
  color: var(--text);
  margin-top: 2rem;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.hero h1 span {
  color: rgba(114, 227, 21, 0.807);
}

.hero h2 {
  font-size: 1.8rem;
  color: #ff7043;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* 用于各模块标题中高亮城市名 */
.hero-city {
  color: #ff7043;      /* 与首页 .hero h2 相同的桔色 */
  font-weight: 700;
}

.hero p {
  color: var(--text);
  margin-bottom: 2rem;
}

/* =========================================================
   Module Cards
   ========================================================= */
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 0.8rem;
  justify-content: center;
  justify-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

.module-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(140%);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
  width: 90%;
  max-width: 260px;
  color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.module-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 255, 200, 0.4);
}

.module-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
}

.module-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
}


/* =========================================================
   Footer
   ========================================================= */
footer {
  text-align: center;
  margin-top: 3rem;
  padding: 1rem;
  background-color: rgba(51, 55, 53, 0.85);
  font-size: 0.9rem;
  color: #ccc;
}

footer a {
  color: #fff;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--secondary);
}

/* =========================================================
   Responsive Design
   ========================================================= */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 0.8rem;
  }

  .module-grid {
    max-width: 95%;
    grid-template-columns: 1fr 1fr;
  }

  .module-card {
    width: 100%;
    max-width: none;
  }
}
/* ===== Global Button Style (通用按钮样式) ===== */
.btn-global {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 52px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-global:hover {
  background: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.btn-global:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* =========================================================
   Global Modal & Form Components (shared baseline)
   注：index.css / market.css 中的 .modal / .modal-content 会覆盖这里，
   因此现有弹窗视觉不会改变；新页面可直接复用本段样式。
   ========================================================= */

/* 通用弹窗遮罩布局（基础版） */
.modal {
  display: none;              /* 通过 JS 切换为 flex 显示 */
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  overflow-y: auto;           /* 当内容过高时允许在遮罩层中滚动 */
  padding: 1.5rem 0.5rem;     /* 给上下留一点空间，防止卡在屏幕边缘 */
}

/* 可选：通过添加 .is-visible 类控制显示 */
.modal.is-visible {
  display: flex;
}

/* 通用弹窗内容卡片（玻璃拟物基线） */
.modal-content {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(160%);
  border-radius: 16px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
  padding: 2rem;
  width: 90%;
  max-width: 480px;           /* 登录弹窗默认宽度，详情弹窗可在页面 CSS 中单独调大 */
  color: var(--text);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* 通用关闭按钮样式基线 */
.close-btn {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  background: transparent; /* 去掉按钮底色 */
  border: none;            /* 去掉按钮边框 */
  padding: 0;
  margin: 0;
}

.close-btn:hover {
  color: var(--secondary);
}

.close-btn:focus {
  outline: none;
}

/* Shared detail modal carousel alignment */
.detail-carousel {
  position: relative;
}

.detail-carousel .carousel {
  overflow: hidden;
}

.detail-carousel .carousel-btn.prev,
.detail-carousel .carousel-btn.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.detail-carousel .carousel-btn.prev {
  left: 0.75rem;
}

.detail-carousel .carousel-btn.next {
  right: 0.75rem;
}

/* 通用表单排版（可被各页面细化覆盖） */
.form-field,
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.form-label {
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(240, 240, 245, 0.8);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--secondary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* 表单操作按钮区（如提交 / 取消） */
.form-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .modal-content {
    padding: 1.6rem 1.2rem;
    max-width: 94%;
    max-height: 88vh;       /* 手机上弹窗高度最多占视口 88% */
    overflow-y: auto;       /* 内容超出时在弹窗内部滚动 */
  }
}

/* ==== Local page (local.html) ==== */

.page-local main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}
/* Market / Rent Room / Rent Scooter / Life Sharing
   让这些页面的主内容更靠近导航条（参考 local 页节奏） */
.page-market main,
.page-rent-room main,
.page-rent-scooter main,
.page-life-sharing main {
  margin-top: 0;      /* 覆盖 base.css 中 main 的 3rem 顶部外边距 */
  padding-top: 16px;  /* 与 .page-local main 顶部类似的 16px 内边距 */
}

.local-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}

.local-tab-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.local-tab-btn.active {
  background: var(--accent-main);
  color: #fff;
  border-color: var(--accent-main);
}

/* ==== Local tabs: use glassy button style (small btn-global) ==== */

.local-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
  justify-content: center;      /* 居中 tabs，更像 app 顶部切换 */
  flex-wrap: wrap;
}

.local-tab-btn {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 18px;
  min-width: 90px;
  height: 36px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
}

/* 悬停 + 选中：都使用和 btn-global 一致的高亮效果 */
.local-tab-btn:hover,
.local-tab-btn.active {
  background: var(--secondary);             /* 和 btn-global:hover 相同主题色 */
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35);
}

/* 按下时稍微回落一下 */
.local-tab-btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.local-section + .local-section {
  margin-top: 24px;
}

/* news list */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  text-align: left;
}

/* 每条信息前面的小圆点（标题式的点样式） */
.news-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary); /* 使用悬停的桔色 */
  margin-top: 8px;
  flex-shrink: 0;
}

/* 只显示主标题，文字用桔色 */
.news-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--secondary); /* 与按钮悬停相同的桔色 */
}

/* 悬停时稍微强调一下 */
.news-item:hover .news-title {
  text-decoration: underline;
}

/* meta 与摘要不用在列表里展示，交给弹窗 */
.news-meta {
  display: none;
}

.news-summary {
  display: none;
}

/* ==== Local News: glass panel like modal-content ==== */

.page-local #localNewsSection {
  background: rgba(255, 255, 255, 0.12);             /* 与 .modal-content 一致 */
  backdrop-filter: blur(14px) saturate(160%);        /* 一样的玻璃模糊效果 */
  border-radius: 16px;                               /* 同 modal-content 圆角 */
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);         /* 同级阴影 */
  padding: 1.2rem 1.4rem;
  margin-top: 1rem;
}

/* 让列表和标题在卡片内部更紧凑一点 */
.page-local #localNewsSection .section-title {
  text-align: left;
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.page-local #localNewsSection .news-list {
  margin: 0;
  padding: 0.25rem 0 0.1rem;
}

/* tools */
.tools-group {
  margin-bottom: 16px;
}

.tools-group-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center; /* 让每一行的 tool 卡片水平居中 */
}

.tool-card {
  font-size: 13px;
  text-align: center;
  min-width: 140px;
}

.beta-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffcc80;
}

/* Merchant application modal: constrain height and enable internal scroll */
#merchantModal .modal-content {
  max-height: 90vh;      /* 最高占视口高度的 90% */
  overflow-y: auto;      /* 内容太多时在弹窗内部滚动 */
  margin: 4vh auto;      /* 上下留一点空间，便于看到关闭按钮 */
}

@media (max-width: 600px) {
  #merchantModal .modal-content {
    max-height: 88vh;
    padding: 1.4rem 1.1rem; /* 手机上稍微收紧内边距，类似 post 弹窗 */
  }
}

#merchantForm {
  display: flex;
  flex-direction: column;
}
#merchantSubmitBtn {
  align-self: center;
}

.news-summary { white-space: pre-line; }
#infoModalBody p { white-space: pre-line; }