/* ================= Global CSS Variables ================= */
/* 在此处定义全局主题、按钮、分隔线等可调属性 */
:root {
  /* 主题色 */
  --title-color: #ffffff;        /* 页面标题文字颜色 */
  --link-color: #ffffff;         /* 链接文字颜色 */

  /* 隐藏按钮（hidden-button）尺寸与圆角配置 */
  --hidden-button-width: 80px;    /* 初始值：隐藏按钮宽度 */
  --hidden-button-height: 40px;   /* 初始值：隐藏按钮高度 */
  --hidden-button-radius: 10px;    /* 隐藏按钮圆角半径 */

  /* 强调按钮（emphasis-button）尺寸与圆角配置 */
  --emphasis-button-width: 160px; /* 初始值：强调按钮宽度 */
  --emphasis-button-height: 48px; /* 初始值：强调按钮高度 */
  --emphasis-button-radius: 10px;  /* 强调按钮圆角半径 */
}

/* 1. 最外层容器：设置视口宽度并水平居中，用于适配移动设备 */
.page-wrap {
  max-width: 375px;      /* 统一为手机宽度 */
  width: 100%;           /* 自适应宽度，防止横向滚动 */
  margin: 0 auto;        /* 居中 */
  box-sizing: border-box;
}

/* 2. （可选）将页面整体应用同样的限宽和居中设置 */
/* 2. 如果不想在每个页面都加 .page-wrap，也可以直接套用到 body */
/*
body {
  max-width: 375px;
  width: 100%;
  margin: 0 auto;
}
*/

/* 3. 顶部固定头栏：水平分布，居中对齐 */
header {
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em;
  border-bottom: 0px solid #dddddd27;
  font-size: 1em;
}
}

/* 4. 主内容区：设置上下边距和内边距，避免与头尾重叠 */
main {
  margin-top: 1em;
  margin-bottom: 4em;
  padding: 1em;
}

/* 5. 底部固定栏：水平居中，用于主要操作按钮 */
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center;
  gap: 1em;
  background: #ff00000f; border-top: 1px solid #919090;
  padding: 0.5em 0;
}

/* 6. 底部按钮样式：无外边距，由父容器 gap 控制 */
footer a {
  font-size: 1em;
  text-decoration: none;
  color: #ffffff;
  margin: 0;  /* 由 gap 控制 */
}
footer a.large-btn {
  font-size: 1.4em;
  margin: 0 0.3em;
  font-weight: bold;
  color: #ffffff;
}

/* 7. iPhone 风格 Dock：固定底部，居中显示，半透明毛玻璃效果 */
.dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 375px;

  border: 1px solid #79777740;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);

  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 1em;
  padding: 0.6em 0;
  font-size: 1em;

  backdrop-filter: blur(10px);
  background-color: rgba(190, 190, 190, 0.368);  /* 毛玻璃效果 */
}

/* 8. 全局背景和字体：设置背景图/颜色和无边距 */
body {
  font-family: sans-serif;
  background-color: var(--bg-color, #000000);
  background-image: var(--bg-img, url('/static/default.jpg'));
  background-repeat: no-repeat;
  background-position: var(--bg-position, center);
  background-size: cover;
  margin: 0;
  padding: 0 0 3.5em 0;

}

/* 9. 主题变量：定义标题和链接颜色变量 */


/* 10. 引导文本：大号居中文字，用于欢迎信息或 emoji */
.intro-text {
  margin-bottom: 1em;
  color: #444;
  text-align: center;
  font-size: 2em;         /* 控制 emoji 大小，可调整为 1.5em、3em 等 */
  line-height: 2em;       /* 设置行距，让 emoji 更独立 */
  text-align: center;     /* 居中显示 */
  margin-top: 1em;        /* 与上方项目列表拉开距离 */

}


/* 11. 搜索栏样式：固定顶部，毛玻璃背景，阴影分隔 */
.header-bar {
  position: sticky;
  top: 0.8em;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8em 1em;

  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.65); /* 毛玻璃效果 */

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #ddd;

  max-width: 340px;
  margin: 1em auto;
  border-radius: 10px;
}


/* 12. 内容容器：带毛玻璃或半透明背景，用于卡片之类的面板 */
.container {

  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-top: 20px;
}

/* 13. 提案卡片：响应式宽度，居中显示，阴影和边框效果 */

/* 14. 提案卡片悬停：放大阴影，突出显示 */
.post-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 15. 工具栏容器：按钮群布局，紧凑间距和阴影效果 */
/* 16. 工具栏按钮：等宽分布，无边距，圆角和交互反馈 */
.toolbar-btn {
  width: calc((100% - 4px)/3);
  margin: 0;
  padding: 0.6em;
  border: none;
  background: none;
  font-size: 0.95em;
  border-radius: 6px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}
/* 17. 按钮悬停：背景高亮 */
.toolbar-btn:hover {
  background: #eeeeee76;
}
/* 18. 激活状态按钮：加粗和放大，突出当前页 */
.toolbar-btn.active {
  font-weight: bold;
  font-size: 1.1em;
  color: #2d2d2d;
}
/* 卡片统一毛玻璃效果，提升视觉一致性 */
.card,
.post-card,
.proposal-card,
.toolbar-card,
.profile-card,
.info-card {
  display: block;
  max-width: 375px;
  margin: 0.5em auto 1em auto;
  /* 移除 padding，交由 .card-content 控制 */
  border-radius: 10px;
  background-color: rgba(34, 34, 34, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid #2a2a2a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: box-shadow 0.2s ease;
}

/* === Horizontal card variants for home list === */
.card.card-horizontal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto 6px;
  /* restore dark translucent card style */
  background-color: rgba(34, 34, 34, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.card.card-horizontal .card-img {
  width: 88px;
  height: 88px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  flex: none;
  margin: 0;
  padding: 0;
  object-fit: cover;
  border: 1px solid #2a2a2a;
}

.card.card-horizontal .card-content {
  padding: 0;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card.card-horizontal h2 {
  font-size: 1.05em;
  margin: 0;
  line-height: 1.25;
  color: #ffffff;
}

.card.card-horizontal .card-desc {
  font-size: 0.9em;
  color: #dcdcdc;
  margin: 0;
}

.card.card-horizontal .card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card.card-horizontal .meta-line,
.card.card-horizontal .card-tag {
  font-size: 0.85em;
  color: #c9c9c9;
}

/* grid spacing for home horizontal list */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 12px 12px;
  max-width: 375px;
  margin: 0 auto;
}

/* 19. 标题与搜索框并排样式 */
.header-bar-title-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 0.5em 1em;
}

.header-bar-title-input h1 {
  font-size: 1.2em;
  margin: 0;
  color: var(--title-color);
  white-space: nowrap;
}

.header-bar-title-input input {
  flex-grow: 1;
  max-width: 240px;
  padding: 0.4em 0.8em;
  border: 2px solid #ccc;
  border-radius: 12px;
  font-size: 0.95em;
  font-weight: 500;
  outline: none;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.header-bar-title-input input::placeholder {
  color: #999;
}

/* 20. 按钮容器统一颜色控制 */
.action-buttons {
  display: flex;
  border-radius: 11px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  background-color: rgba(129, 129, 129, 0.092);
  border: 1px solid #ccc;
  margin-top: 1em;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.action-buttons button {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.2s ease;
}

.action-buttons button:hover {
  background-color: #e0e0e0;
}

/* ================ 分隔线 (divider) ================ */
.divider {
  height: 1px;
  background-color: var(--line-color, #ccc); /* 使用全局线条颜色变量 */
  margin: 1em 0;
  border: none;
}

/* ================ 上传图片槽 (image-picker slot) ================ */
.image-picker .slot {
  background-color: var(--upload-slot-bg, rgba(0, 171, 255, 0.1)); /* 圆角矩形背景色，可自定义变量 --upload-slot-bg */
  position: relative;
}
.image-picker .slot img,
.proof-gallery .slot img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  margin: 0 auto; /* 居中展示 */
}

.image-picker .remove-btn {
  z-index: 2;
  position: absolute;
  top: 1px;
  right: 6px;
  width: 24px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  margin: 0;
  padding: 0;
}

.card-content {
  padding: 1em;
  color: #ffffff;
}

.card-img-wrap {
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 1 / 1;      /* 变为正方形 */
  border-radius: 18px;
  overflow: hidden;         /* 重点！保证内部内容被圆角裁切 */
  margin-bottom: 16px;
  position: relative;
  background: #222;         /* 可选：避免图片间露底色 */
  display: block;
}

.card-img-wrap .carousel {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.card-img-wrap .slide {
  flex: none;

  scroll-snap-align: center;
  position: relative;
}

.card-img-wrap .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;        /* 确保图片本身无圆角，只由 .card-img-wrap 控制圆角 */
}
/* 统一控制项目页头部与搜索栏样式 */
.project-header {
  max-width: 375px;
  margin: 1.5em auto 1em auto;
}

.project-header header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-header a {
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  font-weight: bold;
}

.project-header .search {
  flex: 1;
}

.project-header .search input[type="search"] {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #ffffff77;
  border-radius: 12px;
  box-sizing: border-box;
}
/* 统一控制搜索栏样式，与 .project-header 保持一致 */
.search-bar {
  max-width: 375px;
  margin: 1.5em auto 1em auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-bar a {
  text-decoration: none;
  color: #ffffff;
  white-space: nowrap;
  font-weight: bold;
}

/* 统一控制搜索栏样式，与 .project-header 保持一致 */
.search-bar input[type="search"] {
  flex: 1;
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #cccccc78;
  border-radius: 12px;
  box-sizing: border-box;
}

/* ================ 隐藏按钮 (hidden-button) ================ */
.hidden-button {
  display: inline-block;        /* 宽度随内容自动 */
  padding: 4px 12px;            /* 水平／垂直内边距 */
  line-height: 1;               /* 文本垂直居中 */
  border-radius: var(--hidden-button-radius); /* 保留圆角 */
  /* 颜色和字体由全局变量或继承样式控制 */
}

/* ================ 强调按钮 (emphasis-button) ================ */
.emphasis-button {
  display: inline-block;
  padding: 8px 16px;           /* 根据需要调整 */
  line-height: 1;
  border-radius: var(--emphasis-button-radius);
  /* 背景与文字色由全局变量或继承样式控制 */
}

/* Added rule for .vote-bar.disabled */
.vote-bar.disabled {
  filter: grayscale(100%);
  pointer-events: none;
  height: 2px;
}