/* halcyon-home · 骨架层
   只管布局和定位，不管好不好看。
   换皮肤不需要碰这个文件。 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

/* ---- App shell ---- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 600px;
  margin: 0 auto;
}

/* ---- Top bar ---- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  height: calc(48px + env(safe-area-inset-top));
  flex-shrink: 0;
}

.back-btn {
  width: 32px;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.top-bar-title {
  font-size: 17px;
  font-weight: 500;
}

/* ---- Hamburger ---- */
.hamburger-wrap {
  position: relative;
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.hamburger-btn:active { opacity: 1; }

.hamburger-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 130px;
  border-radius: 14px;
  overflow: hidden;
  z-index: 100;
  opacity: 0;
  transform: scale(0.92) translateY(-8px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.hamburger-menu.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.hamburger-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 13px 16px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

/* ---- Switch button (换窗) ---- */
.switch-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 换窗弹窗内部 ---- */
.modal-subtitle {
  font-size: 12px;
  margin-top: 2px;
  font-family: monospace;
}

.switch-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.switch-stat-card {
  flex: 1;
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}

.switch-stat-num {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.switch-stat-label {
  font-size: 11px;
}

.inject-count-input {
  width: 48px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  border: none;
  border-bottom: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
  outline: none;
  padding: 0 2px 2px;
  -moz-appearance: textfield;
}
.inject-count-input::-webkit-inner-spin-button,
.inject-count-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.switch-section-label {
  font-size: 12px;
  margin: 14px 0 8px;
  letter-spacing: 0.3px;
}

.switch-preview {
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.switch-preview-msg {
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 10px;
}

.switch-preview-sender {
  font-weight: 600;
  margin-right: 4px;
}

.switch-preview-time {
  opacity: 0.5;
  margin-right: 4px;
  font-size: 11px;
}

.switch-preview-loading,
.switch-preview-empty {
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

.switch-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.switch-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}

.switch-paste-toggle {
  cursor: pointer;
  user-select: none;
}
.switch-paste-area {
  margin-bottom: 4px;
}
.paste-context-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid rgba(128,128,128,0.3);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}
.paste-context-input:focus {
  border-color: rgba(128,128,128,0.6);
}

.switch-note {
  font-size: 11px;
  margin: 14px 0 4px;
  line-height: 1.6;
}

/* ---- 跨窗接续面板（全屏抽屉） ---- */
.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.panel-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.panel-card {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 40px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 92vh;
  overflow-y: auto;
}

.panel-overlay.open .panel-card {
  transform: translateY(0);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 19px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-title-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.panel-subtitle {
  font-size: 13px;
  margin-top: 4px;
}

.panel-toggles {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
}

.panel-toggle-name {
  font-size: 15px;
  font-weight: 500;
}

.panel-toggle-hint {
  font-size: 12px;
  margin-top: 2px;
}

.panel-section { }

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-section-label {
  font-size: 12px;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.panel-section-hint {
  font-size: 11px;
  font-weight: 400;
  margin-left: 6px;
}

.panel-tabs {
  display: flex;
  gap: 4px;
}

.panel-tab {
  padding: 5px 12px;
  border-radius: 20px;
  border: none;
  font-size: 13px;
  cursor: pointer;
}

.panel-lifeline-card {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.panel-lifeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.panel-lifeline-title {
  font-size: 13px;
  font-weight: 600;
}

.panel-lifeline-date {
  font-size: 11px;
}

.panel-lifeline-content {
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.panel-lifeline-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.panel-action-btn {
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.panel-pinned {
  margin-bottom: 16px;
}

.panel-pinned .panel-section-label {
  display: block;
  margin-bottom: 10px;
}

.panel-pinned-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-pinned-input {
  flex: 1;
}

.panel-pin-btn {
  flex-shrink: 0;
  padding: 10px 14px;
}

.pinned-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-top: 0.5px solid var(--input-border);
}

.pinned-del {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.4;
  padding: 0 4px;
}

.panel-seeds {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 0.5px solid var(--input-border);
}

.panel-seeds-count {
  font-size: 18px;
  font-weight: 600;
}

/* ---- Chat area ---- */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}

/* ---- Message row ---- */
.msg-row {
  display: flex;
  margin-bottom: 8px;
  align-items: flex-start;
  gap: 8px;
}

.msg-row.user {
  flex-direction: row-reverse;
}

/* ---- Avatar ---- */
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
}

/* ---- Message body (bubble + timestamp wrapper) ---- */
.msg-body {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

/* ---- Timestamp ---- */
.msg-time {
  font-size: 11px;
  opacity: 0.45;
  margin-top: 2px;
}
.usage-icon {
  vertical-align: -1px;
  opacity: 0.7;
  margin-right: 1px;
}

.msg-row.user .msg-time {
  text-align: right;
}

/* ---- Markdown in AI bubbles ---- */
.msg-row.ai .bubble strong { font-weight: 600; }
.msg-row.ai .bubble em { font-style: italic; opacity: 0.9; }
.msg-row.ai .bubble code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(0,0,0,0.07);
  border-radius: 3px;
  padding: 1px 4px;
}
@media (prefers-color-scheme: dark) {
  .msg-row.ai .bubble code { background: rgba(255,255,255,0.12); }
}

/* ---- Retry button (user bubbles) ---- */
.retry-btn {
  display: none;
  align-self: flex-end;
  margin-top: 3px;
  padding: 0;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-secondary, #888);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
  line-height: 1;
}
.retry-btn:hover { opacity: 1; }
.msg-row.user:hover .retry-btn { display: block; }

/* ---- Bubble ---- */
.bubble {
  max-width: 70%;
  padding: 10px 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

.msg-body .bubble {
  max-width: none;
}

/* ---- Thinking bubble ---- */
.bubble.thinking .think-content {
  display: none;
  margin-top: 6px;
  white-space: pre-wrap;
}

.bubble.thinking.expanded .think-content {
  display: block;
}

.bubble.thinking .think-preview {
  display: inline;
}

.bubble.thinking.expanded .think-preview {
  display: none;
}

.think-arrow {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.bubble.thinking.expanded .think-arrow {
  transform: rotate(180deg);
}

/* ---- Tool call card ---- */
.tool-call-row {
  justify-content: center;
  margin-bottom: 6px;
}

.tool-card {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 6px 10px;
  max-width: 85%;
  justify-content: center;
}

.tool-tag {
  padding: 2px 8px;
  font-size: 11px;
  white-space: nowrap;
}

/* ---- Typing indicator ---- */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

/* ---- Input area ---- */
.input-area {
  position: relative;
  padding: 8px 12px;
  flex-shrink: 0;
}

.input-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 10px;
  border-radius: 22px;
}

.input-composer textarea {
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.4;
  border: none;
  background: transparent;
  width: 100%;
  padding: 0;
}

.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-actions button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

/* ---- + 弹出菜单 ---- */
.plus-menu {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 12px;
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.plus-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  background: transparent;
}

/* ---- Mobile safe area ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .input-area {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

/* ================================================================
   Home page — widget layout
   ================================================================ */
.home {
  justify-content: flex-start;
  align-items: stretch;
  padding: max(20px, env(safe-area-inset-top)) 16px 20px;
  gap: 12px;
  overflow-y: auto;
}

/* 通用 widget 卡片 */
.widget-card {
  border-radius: 20px;
  padding: 20px 22px;
  display: block;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

/* 时钟卡 */
.clock-card {
  text-align: center;
  padding: 28px 22px 24px;
}

/* Days 计数器卡 */
.days-card {
  cursor: pointer;
}

.days-entry { }
.days-entry-mt { margin-top: 0; }
.days-divider {
  border: none;
  border-top: 0.5px solid var(--input-border);
  margin: 12px 0;
}

.days-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.days-prefix {
  font-size: 15px;
  opacity: 0.6;
}

.days-num {
  font-size: 54px;
  line-height: 1;
  letter-spacing: -1px;
}

.days-suffix {
  font-size: 15px;
  opacity: 0.6;
}

.days-meta {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.5;
}

.days-empty {
  font-size: 14px;
  text-align: center;
  opacity: 0.4;
  padding: 8px 0;
}

/* 上次说到卡 */
.closeout-card { }

.widget-label {
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 8px;
}

.closeout-preview-text {
  font-size: 14px;
  line-height: 1.65;
  opacity: 0.5;
}

.closeout-preview-text.empty {
  opacity: 0.4;
}

/* 快速入口 */
.home-menu {
  display: flex;
  gap: 10px;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.menu-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 10px;
  text-decoration: none;
  border-radius: 18px;
}

.menu-icon-svg {
  width: 22px;
  height: 22px;
}

/* ================================================================
   通用弹窗 modal（Days 编辑 / 换窗确认）
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.45;
}

.modal-close:active { opacity: 0.8; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Days 编辑器内部 */
.days-editor-row {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.days-editor-bottom {
  display: flex;
  gap: 8px;
  align-items: center;
}

.days-editor-date {
  flex: 1;
}

.days-editor-type {
  width: 90px;
  flex-shrink: 0;
}

.days-editor-del {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.4;
  padding: 0 4px;
  flex-shrink: 0;
}

.days-editor-del:active { opacity: 0.8; }

.days-add-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 0;
  display: block;
  width: 100%;
  text-align: left;
}

/* ================================================================
   Settings page — layout
   ================================================================ */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-label {
  display: block;
  margin-bottom: 6px;
}

.setting-input {
  width: 100%;
  padding: 12px 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

select.setting-input {
  padding-right: 36px;
}

.key-input-wrap {
  position: relative;
}

.key-input-wrap .setting-input {
  padding-right: 48px;
}

.key-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.setting-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  flex: 1;
  padding: 14px;
  cursor: pointer;
  text-align: center;
}

.status-msg {
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
}

.setting-divider {
  border: none;
  margin: 28px 0;
}

/* ---- Toggle switch ---- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-desc {
  flex: 1;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 28px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ---- Textarea for prompts ---- */
.setting-textarea {
  width: 100%;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  min-height: 120px;
  max-height: 400px;
  line-height: 1.5;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* ---- Top bar actions (chat page) ---- */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-icon {
  text-decoration: none;
  font-size: 18px;
  opacity: 0.5;
}

/* ---- Merge suggestion card ---- */
.merge-row {
  justify-content: center;
  margin-bottom: 6px;
}

.merge-card {
  padding: 10px 14px;
  max-width: 85%;
  text-align: center;
}

.merge-header {
  font-size: 13px;
  margin-bottom: 4px;
}

.merge-preview {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.merge-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.merge-btn {
  padding: 4px 14px;
  font-size: 12px;
  border: none;
  cursor: pointer;
}

/* ================================================================
   Data panel — layout
   ================================================================ */
.data-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

.data-section {
  margin-bottom: 24px;
}

.data-section-title {
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.6;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.section-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.data-section-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.3s ease;
}

.data-section.collapsed .data-section-body {
  max-height: 0;
}

.data-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.data-card {
  padding: 14px;
  margin-bottom: 8px;
}

.data-card-sub {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 8px;
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.data-row-accent {
  margin-top: 4px;
  padding-top: 8px;
}

.closeout-text {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.closeout-text.empty {
  opacity: 0.5;
  text-align: center;
}

.history-card {
  cursor: default;
}

/* ── 对话历史：左滑删除 ─────────────────────────────── */
.history-swipe-wrap {
  position: relative;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 14px;
}

.history-swipe-wrap .data-card {
  margin-bottom: 0;
  position: relative;
  touch-action: pan-y;   /* 竖向滚动交给浏览器，横向留给左滑手势 */
  will-change: transform;
}

.halo-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(45, 52, 35, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.halo-dialog {
  background: var(--card-surface, rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(45, 52, 35, 0.18);
  padding: 20px 18px 14px;
  max-width: 320px;
  width: 100%;
}

.halo-dialog-msg {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.halo-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.halo-dialog-btn {
  font-size: 13px;
  font-family: inherit;
  padding: 7px 16px;
  border-radius: 10px;
  border: 1px solid rgba(128, 128, 128, 0.25);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.halo-dialog-btn.danger {
  background: #c0564f;
  border-color: #c0564f;
  color: #fff;
}

.halo-dialog-btn.primary {
  background: var(--accent, #7a8a5f);
  border-color: transparent;
  color: #fff;
}

.history-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 76px;
  border: none;
  background: #c0564f;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 0 14px 14px 0;
  opacity: 0;              /* 卡片半透明，收起时隐藏避免透色 */
  transition: opacity 0.15s;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.history-date {
  font-size: 12px;
  opacity: 0.6;
}

.history-meta {
  font-size: 11px;
  opacity: 0.5;
}

.history-title {
  font-size: 13px;
  margin-bottom: 2px;
}

.history-closeout {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 4px;
}

.history-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.export-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-border, rgba(128,128,128,0.3));
  background: transparent;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.15s;
}

.export-btn:hover {
  opacity: 1;
}
