/* 栖枝月工作室 · 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #e5e5e5;   /* 页面外浅灰背景 */
  color: #333;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

ul { list-style: none; }
button {
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input { font-family: inherit; }

#app {
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  background: #f7f7f7 url('assets/bg.jpg') center / cover no-repeat;   /* 睡猫底图 */
  position: relative;
  overflow: hidden;
}

/* ---------- 页面容器 ---------- */
.page {
  display: none;
  flex-direction: column;
  height: 100%;
  padding-bottom: 78px;   /* 给底部按钮栏留空间 */
}
.page.active { display: flex; }

/* ---------- 顶端状态栏 ---------- */
.topbar {
  flex-shrink: 0;
  background: transparent;   /* 顶端标题框背景全透明 */
  text-align: center;
  padding: 12px;
  box-shadow: none;
}
.topbar-home { padding: 14px 12px; }
.topbar-title {
  font-size: 20px;
  font-weight: 800;
  color: #000;           /* 首页顶端黑字 */
  letter-spacing: 3px;
}
/* 顶端标题：黑字白边 */
#page-home .topbar-title,
#page-fav .topbar-title,
#page-mine .topbar-title {
  color: #000;
  text-shadow:
    -4px 0 0 #fff, 4px 0 0 #fff,
    0 -4px 0 #fff, 0 4px 0 #fff,
    -4px -4px 0 #fff, 4px -4px 0 #fff,
    -4px 4px 0 #fff, 4px 4px 0 #fff;
}
.topbar-sub {
  font-size: 12px;
  color: #000;           /* 黑色小字 */
  margin-top: 4px;
  letter-spacing: 1px;
}

/* ---------- 首页搜索框 ---------- */
.search-bar {
  flex-shrink: 0;
  margin: 10px 12px;
  height: 38px;
  background: #fff;
  border-radius: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  cursor: pointer;
}
.search-icon { margin-right: 6px; }

/* ---------- 列表区 ---------- */
.list-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 16px;
}
.list-area::-webkit-scrollbar { display: none; }

.empty-tip {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 48px 0;
  display: none;
}

/* ---------- 文件行（首页 / 收藏 / 搜索共用） ---------- */
.file-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .8);   /* 80% 不透明，透出底图 */
  margin: 8px 12px;
  padding: 12px 10px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.file-cat {
  width: 52px;
  flex-shrink: 0;
  color: #666;           /* 分类用灰字 */
  font-size: 14px;
}
.file-title {
  flex: 1;
  text-align: center;
  color: #000;
  font-size: 15px;
  padding: 0 8px;
  word-break: break-all;
}

.btn-oval {
  border: none;
  border-radius: 16px;
  padding: 6px 18px;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  color: #777;           /* 按钮灰字 */
  box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}
.btn-oval:active { background: #f0f0f0; }

/* ---------- 收藏页筛选按钮 ---------- */
.filter-bar {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 16px;
  padding: 6px 18px;
  font-size: 14px;
  cursor: pointer;
  background: #333;      /* 深灰按钮 */
  color: #fff;
}
.filter-btn.active {
  background: #fff;      /* 选中时字体色与底色互换 */
  color: #333;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2);
}

/* ---------- 我的页 ---------- */
.mine-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 40px 0 24px;
}
.mine-content::-webkit-scrollbar { display: none; }
.mine-buttons {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.mine-btn {
  width: 112px;
  height: 112px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #777;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .10);
}
.mine-btn:active { background: #f0f0f0; }

/* 使用须知 */
.notice-block {
  width: calc(100% - 40px);
  margin: 36px auto 0;
  background: rgba(255, 255, 255, .7);   /* 70% 不透明，透出底图 */
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.notice-title {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  margin-bottom: 8px;
}
.notice-line {
  font-size: 13px;
  color: #000;
  line-height: 1.9;
  word-break: break-all;
}
.notice-link {
  color: #08e;           /* 链接蓝字（带下划线） */
  text-decoration: underline;
  cursor: pointer;
}
.notice-red { color: #ff0000; }   /* 使用须知警示句用红字 */

/* ---------- 底部按钮栏（窄条居中浮起） ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: auto;
  min-width: 300px;
  max-width: 92%;
  height: 54px;
  background: rgba(200, 200, 200, .92);   /* 半透明，透出底图墨色 */
  border-radius: 27px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  padding: 0 16px;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.nav-btn {
  border: none;
  border-radius: 18px;
  padding: 7px 16px 7px 10px;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  color: #777;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
}
.nav-icon {
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 5px;
}
.nav-btn.active { background: #333; color: #fff; }

/* ---------- 搜索页 ---------- */
.search-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.search-topbar .topbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 17px;
  letter-spacing: 1px;
}
.topbar-space { width: 52px; }

.back-btn {
  border: none;
  border-radius: 15px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #777;
}

.search-box {
  flex-shrink: 0;
  display: flex;
  margin: 10px 12px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid #d9d9d9;
  border-radius: 19px 0 0 19px;
  padding: 0 14px;
  font-size: 14px;
  color: #000;
  background: #fff;
  outline: none;
}
.search-box button {
  width: 46px;
  border: none;
  background: #333;
  color: #fff;
  font-size: 16px;
  border-radius: 0 19px 19px 0;
  cursor: pointer;
}

/* ---------- 查看页 ---------- */
.view-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.view-topbar .topbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  letter-spacing: 1px;
}
.top-btn {
  border: none;
  border-radius: 15px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #777;
}
.top-btn.fav-on { background: #333; color: #fff; }

.view-meta {
  flex-shrink: 0;
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  font-size: 13px;
  color: #000;
}
.meta-val { font-weight: 600; }

.view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  margin: 8px 12px;
  padding: 12px 10px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.view-item { color: #000; font-size: 15px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-mask.show { display: flex; }

.modal {
  width: 90%;
  max-width: 430px;
  max-height: 78%;
  background: #fff;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #e5e5e5;
}
.modal-top .modal-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #000;
}
.modal-btn {
  border: 1px solid #ddd;
  border-radius: 15px;
  padding: 5px 16px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #777;
}
.modal-btn:active { background: #f0f0f0; }

.modal-body {
  overflow-y: auto;
  padding: 12px 14px;
}
.modal-body::-webkit-scrollbar { display: none; }

/* ---------- 弹窗1：复制记录 ---------- */
.record-row {
  padding: 11px 2px;
  border-bottom: 1px dashed #e5e5e5;
  font-size: 13px;
  line-height: 1.7;
}
.rec-time { color: #666; }   /* 年月日时分秒用灰字 */
.rec-copy { color: #333; }
.rec-title { color: #000; font-weight: 600; }

/* ---------- 弹窗2：我的指令 ---------- */
.cmd-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.cmd-label {
  flex-shrink: 0;
  color: #000;
  font-size: 13px;
  white-space: nowrap;
}
.cmd-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #000;
  background: #f5f5f5;
  outline: none;
}
.cmd-row input.editable { background: #fff; border-color: #888; }

.modify-btn {
  flex-shrink: 0;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #777;
}
.cmd-buttons {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 6px;
  padding: 6px 0 2px;
}

/* ---------- Toast 提示 ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 0, 0, .8);
  color: #fff;
  padding: 8px 18px;
  border-radius: 18px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 99;
  max-width: 82%;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 移动端：输入框字号调大，避免 iOS 聚焦时页面缩放 ---------- */
@media (max-width: 640px) {
  .search-box input,
  .cmd-row input { font-size: 16px; }
}
