/* Work OS unified UI layer
 * Load this file after style.css, experience.css, calendar.css and bjd.css.
 */

:root {
  --ui-bg: #f6f7fb;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f9fafc;
  --ui-surface-hover: #f3f4f8;
  --ui-text: #222631;
  --ui-text-secondary: #505867;
  --ui-text-muted: #828b9b;
  --ui-border: #dfe3ea;
  --ui-border-strong: #c9cfda;
  --ui-accent: #5b55e7;
  --ui-accent-hover: #4f49d8;
  --ui-accent-soft: #efeeff;
  --ui-accent-border: #c9c6fb;
  --ui-danger: #c45656;
  --ui-danger-soft: #fff3f3;
  --ui-success: #2f8f63;
  --ui-warning: #a66a27;
  --ui-control-height: 36px;
  --ui-control-height-sm: 30px;
  --ui-radius-sm: 7px;
  --ui-radius: 9px;
  --ui-radius-lg: 12px;
  --ui-shadow-popover: 0 14px 36px rgba(31, 36, 48, 0.14);
  --ui-focus-ring: 0 0 0 3px rgba(91, 85, 231, 0.12);

  /* Keep existing modules on one shared token set. */
  --bg: var(--ui-bg);
  --panel: var(--ui-surface);
  --panel-soft: var(--ui-surface-soft);
  --text: var(--ui-text);
  --text-2: var(--ui-text-secondary);
  --muted: var(--ui-text-muted);
  --border: var(--ui-border);
  --line: #eceff4;
  --accent: var(--ui-accent);
  --accent-soft: var(--ui-accent-soft);
  --red: var(--ui-danger);
  --green: var(--ui-success);
  --orange: var(--ui-warning);
  --radius-sm: var(--ui-radius-sm);
  --radius: var(--ui-radius);
  --radius-lg: var(--ui-radius-lg);
  --shadow: var(--ui-shadow-popover);
  --font-12: 12px;
  --font-13: 13px;
  --font-14: 14px;
  --font-16: 16px;
  --font-20: 20px;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
}

html,
body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button,
summary,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring);
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

::placeholder {
  color: #a0a7b4;
  opacity: 1;
}

/* Application frame */
.app-shell {
  grid-template-columns: 124px minmax(0, 1fr);
}

.sidebar {
  background: #fbfbfd;
  border-color: var(--ui-border);
  padding: 16px 10px;
}

.brand {
  gap: 9px;
  padding: 2px 5px 20px;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 600;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--ui-radius);
  background: var(--ui-accent);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(91, 85, 231, 0.2);
}

.nav {
  gap: 5px;
}

.nav-btn {
  height: var(--ui-control-height);
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius);
  color: var(--ui-text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease;
}

.nav-btn:hover {
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.nav-btn.active {
  border-color: #e3e1ff;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-weight: 600;
}

.main {
  padding: 0 28px 44px;
}

.topbar {
  height: 60px;
  margin-bottom: 12px;
  border-color: var(--ui-border);
}

.page-context-title,
.section-title-row h1,
.section-title-row h2,
.drawer h2,
.modal h2 {
  color: var(--ui-text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-meta,
.drawer-meta,
.muted-count,
.today-label,
.summary-empty,
.empty {
  color: var(--ui-text-muted);
}

/* Unified button family */
.primary-btn,
.ghost-btn,
.icon-btn,
.text-btn,
.viewer-btn,
.viewer-text-btn,
.viewer-scale,
.idea-load-more,
.bjd-upload-action {
  border-radius: var(--ui-radius);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.idea-load-more,
.bjd-upload-action {
  height: var(--ui-control-height);
}

.primary-btn {
  border-color: var(--ui-accent);
  background: var(--ui-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(36, 32, 110, 0.14);
}

.primary-btn:hover {
  border-color: var(--ui-accent-hover);
  background: var(--ui-accent-hover);
  filter: none;
}

.primary-btn:active {
  transform: translateY(1px);
}

.ghost-btn,
.icon-btn,
.idea-load-more,
.bjd-upload-action {
  border-color: var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
}

.ghost-btn:hover,
.icon-btn:hover,
.idea-load-more:hover,
.bjd-upload-action:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.icon-btn {
  width: var(--ui-control-height);
  padding: 0;
  font-size: 18px;
  font-weight: 400;
}

/* Close affordances stay light and never look like a secondary button. */
.drawer-head .icon-btn,
.modal-head .icon-btn,
.idea-viewer-toolbar [aria-label="关闭"] {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-text-muted);
  box-shadow: none;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.drawer-head .icon-btn:hover,
.modal-head .icon-btn:hover,
.idea-viewer-toolbar [aria-label="关闭"]:hover {
  border: 0;
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.text-btn {
  color: var(--ui-accent);
  font-weight: 500;
}

.text-btn:hover {
  color: var(--ui-accent-hover);
}

.small {
  height: var(--ui-control-height-sm);
  padding: 0 10px;
  font-size: 12px;
}

.danger,
.danger-text {
  color: var(--ui-danger) !important;
}

/* One control language for every form. */
input[type="text"],
input[type="search"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background-color: var(--ui-surface);
  color: var(--ui-text);
  outline: none;
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

input[type="text"],
input[type="search"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="time"],
input[type="datetime-local"],
select {
  min-height: var(--ui-control-height);
  padding: 0 11px;
}

textarea {
  min-height: 80px;
  padding: 9px 11px;
  line-height: 1.55;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23828b9b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

input[type="text"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
select:hover,
textarea:hover {
  border-color: var(--ui-border-strong);
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus,
.field-label input:focus,
.field-label select:focus,
.field-label textarea:focus {
  border-color: #9d98ef;
  box-shadow: var(--ui-focus-ring);
}

.field-label {
  color: var(--ui-text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.form-grid {
  gap: 12px;
}

.entry-form,
.modal form {
  gap: 15px;
}

.entry-form .field-label select {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding: 0 34px 0 11px;
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  font-size: 14px;
}

.idea-search-shell {
  height: var(--ui-control-height);
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
}

.idea-search-shell:focus-within {
  border-color: #9d98ef;
  box-shadow: var(--ui-focus-ring);
}

.idea-search-shell input,
.idea-search-shell input:hover,
.idea-search-shell input:focus {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

/* Tabs, segmented controls and status controls use the same active state. */
.month-tabs,
.idea-tabs,
.experience-tabs {
  gap: 4px;
}

.month-tab,
.idea-tab,
.experience-tab,
.experience-type-btn,
.calendar-mode,
.seg-btn,
.situation-btn {
  height: var(--ui-control-height);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-text-secondary);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease;
}

.month-tab:hover,
.idea-tab:hover,
.experience-tab:hover,
.experience-type-btn:hover,
.calendar-mode:hover,
.seg-btn:hover,
.situation-btn:hover {
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.month-tab.active,
.idea-tab.active,
.experience-tab.active,
.experience-type-btn.active,
.seg-btn.active,
.archive-toolbar .seg-btn.active {
  border-color: transparent;
  background: #ececf2;
  color: var(--ui-text);
  box-shadow: none;
  font-weight: 600;
}

.calendar-mode.active,
.situation-btn.active {
  border-color: var(--ui-accent-border);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  box-shadow: none;
  font-weight: 600;
}

.segmented {
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.situation-buttons {
  gap: 7px;
}

/* Cards, tables and surface hierarchy. */
.overview-strip,
.summary-kpis,
.today-card,
.completed-list,
.gantt-wrap,
.summary-panel,
.summary-card,
.archive-table,
.experience-table,
.experience-auto-card,
.idea-context-bar,
.idea-card,
.collection-card,
.calendar-grid,
.month-calendar,
.bjd-card,
.bjd-panel,
.bjd-library-card,
.bjd-piece-card {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
}

.today-card,
.summary-panel,
.summary-card,
.idea-card,
.collection-card,
.bjd-card,
.bjd-panel,
.bjd-library-card,
.bjd-piece-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
}

.today-card:hover,
.idea-card:hover,
.collection-card:hover,
.bjd-card:hover,
.bjd-library-card:hover,
.bjd-piece-card:hover {
  border-color: var(--ui-border-strong);
  box-shadow: 0 5px 18px rgba(31, 36, 48, 0.055);
}

.overview-metric,
.summary-kpi {
  padding: 12px 16px;
}

.overview-metric span,
.summary-kpi span {
  color: var(--ui-text-muted);
  font-size: 12px;
}

.overview-metric b,
.summary-kpi b {
  color: var(--ui-text);
  font-size: 16px;
  font-weight: 600;
}

.archive-head,
.gantt-head {
  background: var(--ui-surface-soft);
  color: var(--ui-text-muted);
  font-size: 12px;
}

.archive-row,
.completed-row,
.gantt-row,
.experience-row {
  border-color: var(--line);
}

.archive-head,
.experience-head,
.gantt-head {
  height: 40px;
  min-height: 40px;
}

.archive-row,
.completed-row,
.experience-row,
.gantt-row:not(.gantt-head) {
  min-height: 48px;
}

.today-card-title,
.archive-title-btn,
.item-open,
.summary-item-title {
  color: var(--ui-text);
  font-weight: 500;
}

.today-card-title:hover,
.archive-title-btn:hover,
.item-open:hover,
.summary-item-title:hover {
  color: var(--ui-accent);
}

.situation,
.idea-card-tags span,
.tag-filter,
.experience-badge,
.bjd-badge,
.bjd-chip {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.empty {
  padding: 42px 16px;
  font-size: 13px;
}

/* Popovers, drawers and modals. */
.drawer,
.modal-card,
.idea-detail-modal-card {
  background: var(--ui-surface);
}

.drawer {
  padding: 16px 18px 18px;
  box-shadow: -16px 0 44px rgba(31, 36, 48, 0.13);
}

.modal-card,
.idea-detail-modal-card {
  border: 1px solid rgba(223, 227, 234, 0.9);
  border-radius: 14px;
  box-shadow: var(--ui-shadow-popover);
}

.modal-card {
  padding: 16px 18px 18px;
}

.drawer-head,
.modal-head {
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-color: var(--ui-border);
}

.drawer-meta {
  margin-bottom: 1px;
}

.entry-form,
.modal form {
  margin-top: 12px;
}

.drawer-actions,
.modal-actions {
  gap: 8px;
  padding-top: 2px;
}

.backdrop,
.modal {
  background: rgba(25, 28, 37, 0.3);
  backdrop-filter: blur(1.5px);
}

.month-picker-shell {
  height: var(--ui-control-height);
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 500;
}

.month-picker-shell:hover,
.month-picker-shell[aria-expanded="true"] {
  border-color: var(--ui-accent-border);
  background: #faf9ff;
}

.month-picker-panel,
.menu-pop {
  border-color: var(--ui-border);
  border-radius: 11px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-popover);
}

.menu-pop button {
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text-secondary);
}

.menu-pop button:hover {
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.toast {
  border-radius: var(--ui-radius);
  background: #272b35;
  font-size: 12px;
}

/* Page-level rhythm: content sits closer to the title divider everywhere. */
.month-tabs,
.bjd-main-tabs,
.archive-toolbar,
.ideas-toolbar,
.experience-toolbar {
  margin-bottom: 8px;
}

.section-title-row {
  margin-top: 14px;
  margin-bottom: 8px;
}

.panel-head,
.summary-toolbar {
  margin-bottom: 6px;
}

/* Inspiration search and tabs share one stable toolbar row. */
.ideas-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 420px) max-content;
    align-items: center;
    justify-content: start;
    gap: 10px;
}

.idea-search-shell {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.idea-tabs {
  flex-wrap: nowrap;
  min-width: max-content;
}

/* Archive uses the exact same tab treatment as Month, Ideas and Experience. */
.archive-toolbar {
  align-items: center;
}

.archive-toolbar .segmented {
  display: flex;
}

.archive-toolbar .seg-btn {
  height: var(--ui-control-height);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-text-secondary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.archive-toolbar .seg-btn:hover {
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.archive-toolbar .seg-btn.active {
  border-color: transparent;
  background: #ececf2;
  color: var(--ui-text);
  font-weight: 600;
  box-shadow: none;
}

/* Large modal families share compact fixed regions and a scrollable body. */
.experience-modal-card .modal-head,
.calendar-modal-card .modal-head,
.bjd-modal-card .modal-head {
  min-height: 0;
  margin: 0;
  padding: 11px 16px 9px;
  align-items: center;
}

.experience-modal-card .modal-actions,
.calendar-modal-actions,
.bjd-modal-card .modal-actions {
  min-height: 0;
  margin: 0;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.experience-form-scroll,
.calendar-form-scroll {
  padding: 12px 16px;
}

.bjd-modal-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
}

.bjd-modal-card form {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 12px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bjd-modal-card .modal-actions {
  position: sticky;
  right: -16px;
  bottom: 0;
  left: -16px;
  margin: 2px -16px 0;
}

.idea-detail-modal {
  padding: 16px;
}

.idea-detail-modal-card {
  padding: 0;
}

.idea-detail-head {
  position: relative;
  top: auto;
  min-height: 44px;
  padding: 7px 12px 7px 16px;
}

.calendar-detail-actions {
  bottom: -18px;
  margin: 12px -18px -18px;
  padding: 8px 18px 10px;
}

/* Compact responsive rhythm without changing information architecture. */
@media (max-width: 900px) {
  .main {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 700px) {
  .sidebar {
    height: 58px;
    padding: 8px 10px;
    background: rgba(251, 251, 253, 0.96);
    backdrop-filter: blur(12px);
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .nav-btn {
    height: 40px;
    padding: 0 5px;
    font-size: 13px;
  }

  .main {
    padding: 0 12px 30px;
  }

  .topbar {
    height: 56px;
    margin-bottom: 10px;
  }

  .drawer {
    width: 100%;
    padding: 14px 16px 16px;
  }

  .ideas-toolbar {
    grid-template-columns: minmax(130px, 1fr) max-content;
    gap: 8px;
  }

  .idea-tabs {
    gap: 2px;
  }

  .idea-tab {
    padding: 0 8px;
    font-size: 12px;
  }

  .experience-modal-card .modal-head,
  .calendar-modal-card .modal-head,
  .bjd-modal-card .modal-head {
    padding: 9px 14px 8px;
  }

  .experience-modal-card .modal-actions,
  .calendar-modal-actions,
  .bjd-modal-card .modal-actions {
    padding: 8px 14px 9px;
  }

  .experience-form-scroll,
  .calendar-form-scroll {
    padding: 10px 14px;
  }

  .bjd-modal-card form {
    padding: 10px 14px 0;
  }

  .bjd-modal-card .modal-actions {
    margin-right: -14px;
    margin-left: -14px;
  }

  .idea-detail-modal {
    padding: 0;
  }

  .idea-detail-modal-card {
    padding: 0;
  }

  .idea-detail-head {
    position: sticky;
    top: 0;
    min-height: 42px;
    padding: 6px 10px 6px 14px;
  }

  .calendar-detail-actions {
    bottom: -16px;
    margin: 10px -16px -16px;
    padding: 8px 16px 9px;
  }
}

@media (max-width: 420px) {
  .ideas-toolbar {
    gap: 6px;
  }

  .idea-search-shell {
    padding: 0 9px;
  }

  .idea-search-icon {
    display: none;
  }

  .idea-tab {
    padding: 0 6px;
  }
}

/* Final layout corrections: keep toolbars single-line and modal shells identical. */
.experience-modal-card,
.calendar-modal-card {
  padding: 0;
}

.ideas-toolbar {
  grid-template-columns: max-content minmax(220px, 320px);
  justify-content: space-between;
  width: 100%;
}

.idea-tabs {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.idea-search-shell {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: min(320px, 100%);
}

.experience-toolbar {
  display: grid;
  grid-template-columns: max-content 280px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.experience-tabs {
  min-width: max-content;
  flex-wrap: nowrap;
}

.experience-search {
  width: 280px;
  max-width: 280px;
  min-width: 0;
  margin: 0;
}

/* Long BJD forms scroll independently from their fixed action footer. */
.bjd-modal-card > .modal-actions {
  position: static;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

@media (max-width: 700px) {
  .ideas-toolbar {
    grid-template-columns: max-content minmax(120px, 220px);
    gap: 8px;
  }

  .idea-search-shell {
    width: min(220px, 100%);
  }

  .experience-toolbar {
    grid-template-columns: max-content minmax(120px, 220px);
    align-items: center;
    gap: 8px;
  }

  .experience-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .experience-tabs::-webkit-scrollbar {
    display: none;
  }

  .experience-search {
    width: 100%;
    max-width: 220px;
  }

  .bjd-modal-card form {
    padding-bottom: 12px;
  }

  .bjd-modal-card > .modal-actions {
    padding: 8px 14px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Xiaohongshu link import and mixed-media inspiration records. */
.idea-modal-card {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.idea-modal-card > .modal-head {
  flex: 0 0 auto;
  padding: 12px 16px;
}

.idea-modal-card .idea-form {
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 0;
}

.idea-link-import {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.idea-link-import input,
.idea-link-import button {
  margin: 0;
  height: var(--control-h, 38px);
}

.idea-link-import button {
  white-space: nowrap;
}

.idea-link-status {
  grid-column: 1 / -1;
  color: var(--muted, #778196);
  font-size: 12px;
  line-height: 1.5;
}

.idea-media-review {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border, #dfe3ec);
  border-radius: 10px;
  background: #f8f9fc;
}

.idea-media-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text, #252a36);
  font-size: 13px;
}

.idea-media-review-head span {
  color: var(--muted, #778196);
  font-weight: 400;
}

.idea-image-preview {
  display: flex !important;
  gap: 8px;
  width: 100%;
  min-height: 132px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.idea-preview-item {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  height: 132px;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid var(--border, #dfe3ec);
  border-radius: 9px;
  background: #f4f5f9;
  scroll-snap-align: start;
}

.idea-preview-item img,
.idea-preview-item video {
  width: 100%;
  height: 132px;
  display: block;
  object-fit: cover;
}

.idea-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: auto;
  min-width: 42px;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(29, 33, 44, 0.82);
  font-size: 12px;
  line-height: 28px;
}

.idea-preview-kind,
.idea-video-mark {
  position: absolute;
  left: 7px;
  bottom: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 27, 38, 0.7);
  font-size: 11px;
  line-height: 18px;
  pointer-events: none;
}

.idea-card-image-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.collection-card > video {
  width: 100%;
  height: 160px;
  display: block;
  object-fit: cover;
}

.idea-detail-source {
  color: var(--primary, #5b54ea);
  text-decoration: none;
}

.idea-detail-mixed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: 12px;
  background: #f4f5f9;
}

.idea-detail-mixed-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #11131a;
}

.idea-detail-mixed-item img,
.idea-detail-mixed-item video {
  width: 100%;
  max-height: 480px;
  display: block;
  object-fit: contain;
}

.idea-detail-mixed-item > span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-size: 11px;
}

@media (max-width: 700px) {
  .idea-link-import {
    grid-template-columns: 1fr;
  }

  .idea-link-status {
    grid-column: 1;
  }

  .idea-detail-mixed-grid {
    grid-template-columns: 1fr;
  }

  /* iOS Safari 会对小于 16px 的可编辑控件自动放大页面。 */
  input,
  select,
  textarea,
  [contenteditable="true"] {
    font-size: 16px !important;
  }
}
