/* 页面背景与字体 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Microsoft Yahei', sans-serif;
    background: #f7f8fb;
    color: #222;
}

.daily-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    z-index: 10;
}

.top-search {
  display: flex;
  gap: 8px;
}

/* 搜索输入容器：用于承载右侧动作按钮 */
.top-search .search-field {
  position: relative;
  flex: 1;
}

/* 顶部搜索：返回按钮样式 */
.top-search .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #ddd; /* 与搜索框边框一致 */
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); /* 与搜索框阴影一致 */
  -webkit-tap-highlight-color: transparent;
}
.top-search .back-btn:hover {
  filter: brightness(1.05);
}
.top-search .back-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.top-search input[type="text"] {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 12px; /* 为右侧按钮预留空间 */
    border: 1px solid #ddd;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.top-search input[type="date"] {
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.top-search button {
    height: 36px;
    width: 40px;
    border: none;
    background: #2f6df6;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* 右侧动作按钮（确认/清除） */
.top-search .search-action {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  /* border: 1px solid #ddd;  */
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);  */
  display: none; /* 默认隐藏，由 JS 控制显示 */
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* 安卓移除点击蓝色高亮 */
}
.top-search .search-action:focus { outline: none; }
.top-search .search-action:hover { filter: brightness(1.05); }
.top-search .search-action .action-icon { width: 14px; height: 14px; display: block; }

.daily-date {
    padding: 12px 20px;
    color: #333;
    background-image: linear-gradient(rgba(255,255,255,0.88), rgba(255,255,255,0.88)), url('../img/background.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* border-radius: 8px; */
    /* 外层左右分散对齐：左为标题，右为日期块 */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 日期区块标题与副标题（居中） */
.daily-title-box { text-align: left; margin-bottom: 8px; }
.daily-title { font-size: 18px; font-weight: 700; color: #111; }
.daily-subtitle { margin-top: 4px; font-size: 12px; color: #666; }

.date-box {
    /* 内部上下结构：上为日期卡片，下为星期文本 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.date-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 4px;
    background: #ffffff;
    border: 2px solid #000;
}

.day-num {
    font-size: 32px;
    font-weight: 700;
    margin-top: 6px;
    line-height: 1;
}

.ym {
    margin-top: 6px;
    font-size: 14px;
    margin: 6px 4px 0 4px;
    color: #666;
    border-top: 1px solid #d5d5d5;
}

.weekday {
    font-size: 16px;
    color: #666;
}

.timeline {
    padding: 0 0 0 10px;
}

.tl-item {
    display: block;
    padding: 12px;
    background: #fff;
    margin: 0 0 0 10px;
    border-left: 1px solid #e5e7eb;
}

.tl-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tl-left {
    display: flex;
    align-items: center;
    margin-left: -17px;
    gap: 8px;
}

.tl-circle {
    width: 9px;
    height: 9px;
    border: 2px solid #2f6df6;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.15);
}

.tl-time-top {
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

.tl-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: #8da2ff;
    text-decoration: none;
}

.tl-save:hover {
    background: rgba(47, 109, 246, 0.08);
}

/* 保存/分享图标图片样式 */
.tl-save-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.tl-bottom {
background: #f7f8fb;
    border-radius: 4px;
    padding: 12px;
}

.tl-body {}

.tl-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    color: #111;
}

.tl-content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.tl-source {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    text-align: right;
}

/* 关键词高亮样式 */
mark.hl {
  background-color: rgba(255, 208, 80, 0.45);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* 暗色主题下的高亮微调（若启用暗色主题） */
body.dark mark.hl,
[data-theme="dark"] mark.hl {
  background-color: rgba(255, 208, 80, 0.35);
}

.empty {
    text-align: center;
    color: #999;
    padding: 40px 0;
}

/* 右下角悬浮日期选择 */
.fab-date {
    position: fixed;
    right: 20px;
    bottom: 50px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #ffffff;
    border: 2px solid #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(47, 109, 246, 0.35);
    text-decoration: none;
    z-index: 20;
    /* 修复安卓点击出现蓝色高亮块 */
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
}
.fab-date:focus { outline: none; }
.fab-date:hover { filter: brightness(1.05); }
.date-floating-input {
    position: fixed;
    right: 16px;
    bottom: 16px;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* 导出图片的纵向海报样式（移动端友好） */
.poster-stage { position: fixed; left: -9999px; top: 0; z-index: -1; }
.poster-card {
    width: 375px; /* 适配手机宽度（iPhone 8/SE 等） */
    background: #fff;
    color: #222;
    border-radius: 8px;
    box-shadow: 0 0 0 1px #eee;
    overflow: hidden;
}
.poster-header { padding: 14px 16px 10px; border-bottom: 1px solid #eee; }
.poster-brand { font-size: 16px; font-weight: 600; }
.poster-date { margin-top: 6px; font-size: 12px; color: #666; }
.poster-title { padding: 16px; font-size: 18px; font-weight: 700; line-height: 1.4; }
.poster-content { padding: 0 16px 16px; font-size: 14px; color: #333; line-height: 1.7; }
.poster-content p { margin: 0 0 12px; }
.poster-source { padding: 0 16px 16px; font-size: 12px; color: #888; text-align: right; }
.poster-footer { padding: 12px 16px; border-top: 1px solid #f0f0f0; color: #999; font-size: 12px; }

/* 海报预览层（提示长按保存） */
.poster-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 100; }
.poster-overlay.show { display: flex; }
.poster-modal { position: relative; max-width: 420px; width: 92%; }
.poster-tip { color: #fff; text-align: center; margin-bottom: 12px; font-size: 14px; }
.poster-img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.35); background: #fff; }
.poster-actions { display: flex; justify-content: center; margin-top: 12px; }
.poster-close { position: static; width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; color: #333; box-shadow: 0 6px 16px rgba(0,0,0,0.25); cursor: pointer; }

/* 日期选择弹层样式（iOS 兼容） */
.date-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 100; }
.date-overlay.show { display: flex; }
.date-modal { background: #fff; border-radius: 12px; width: 92%; max-width: 420px; box-shadow: 0 12px 32px rgba(0,0,0,0.35); padding: 16px; }
.date-tip { text-align: center; color: #333; font-size: 14px; margin-bottom: 12px; }
.date-overlay-input { display: block; width: 100%; height: 40px; border: 1px solid #ddd; border-radius: 8px; padding: 0 12px; }
.date-actions { display: flex; justify-content: center; margin-top: 12px; }
.date-close { width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; color: #333; box-shadow: 0 6px 16px rgba(0,0,0,0.25); cursor: pointer; }