/* 广告列表 + 广告详情弹窗（方案A）。All selectors use the .ad-… namespace (list) or .ad-modal (dialog).
   The list stays neutral (no amber): ads are separated from data by hairlines and carry a 「广告」 tag. */

/* ---------- List ---------- */
.ad-list { min-width: 0; }
.ad-list-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ad-list-head h2 { font-size: 17px; font-weight: 700; line-height: 1.3; }
.ad-tag { height: 18px; padding: 0 5px; border-radius: 3px; color: var(--text-2); font-weight: 400; flex: none; }
.ad-list-hint { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
/* 「查看全部」 → #/ads (neutral, not amber: ads stay visually separate from the data) */
.ad-list-more {
  flex: none; display: inline-flex; align-items: center; gap: 1px; min-height: 24px; margin-left: 4px;
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.ad-list-more.is-alone { margin-left: auto; }
.ad-list-more:hover { color: var(--text); }
.ad-list-more .ico { width: 14px; height: 14px; }
.ad-list--section .ad-list-more { font-size: 13px; }
@media (max-width: 767px) {
  .ad-list-more { min-height: 44px; padding-left: 8px; }
}

.ad-list-box {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--panel); overflow: hidden;
}
.ad-item { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.ad-item:last-child { border-bottom: 0; }

.ad-thumb {
  flex: none; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid var(--line-2); border-radius: var(--r-1);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.ad-thumb:hover { border-color: var(--text-3); }
.ad-thumb:active { transform: scale(.97); }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-thumb .ad-thumb-ico { width: 24px; height: 24px; }
.ad-thumb .ad-thumb-k { font-size: 11px; line-height: 1; }

.ad-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ad-item-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ad-item-title strong { font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-item-desc { font-size: 12px; line-height: 1.55; color: var(--text-2); }
.ad-item-fields { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-field { font-size: 12px; line-height: 18px; padding: 0 5px; border-radius: 3px; background: var(--panel-2); color: var(--text-2); }

.ad-empty { padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ad-empty .ico { color: var(--text-3); width: 28px; height: 28px; }
.ad-empty strong { font-size: 13px; }
.ad-empty span { font-size: 12px; color: var(--text-2); }

/* section variant: heading above a bordered list (mobile / stacked rail) */
.ad-list--section .ad-list-head { margin-bottom: 8px; }

/* rail variant: the whole block is one panel (desktop right rail) */
.ad-list--rail { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--panel); }
.ad-list--rail .ad-list-head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ad-list--rail .ad-list-head h2 { font-size: 13px; }
.ad-list--rail .ad-list-box { border: 0; border-radius: 0 0 var(--r-2) var(--r-2); background: transparent; }
.ad-list--rail .ad-item { gap: 10px; padding: 10px 12px; }
.ad-list--rail .ad-item-main { gap: 3px; }
.ad-list--rail .ad-item-title strong { font-size: 13px; }
.ad-list--rail .ad-item-desc { line-height: 1.5; }
.ad-list--rail .ad-thumb .ad-thumb-ico { width: 22px; height: 22px; }

/* ---------- Detail modal ---------- */
.modal.ad-modal { border-radius: 8px; }
.ad-modal .modal-head { padding: 12px 10px 12px 20px; }
.ad-modal .modal-head h2 { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 20px; }
.ad-modal .ad-title-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-modal .modal-close { width: 40px; height: 40px; border-color: transparent; color: var(--text); }
.ad-modal .modal-body { padding: 20px; }

.ad-detail { display: flex; flex-direction: column; gap: 16px; }
.ad-hero { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-2); overflow: hidden; }
.ad-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* adTile() sets its size inline; stretch it to the 16:9 box and enlarge its glyph/label */
.ad-hero .ad-tile { width: 100% !important; height: 100% !important; border-radius: var(--r-2) !important; gap: 8px !important; }
.ad-hero .ad-tile .ico { width: 56px; height: 56px; }
.ad-hero .ad-tile .ico svg { stroke-width: 1.2; }
.ad-hero .ad-tile .mono { font-size: 13px !important; }

.ad-content { font-size: 15px; line-height: 1.75; color: #C9CED8; white-space: pre-line; overflow-wrap: anywhere; }

.ad-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ad-actions.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-btn { height: 46px; gap: 8px; font-size: 15px; min-width: 0; padding: 0 14px; }
.ad-btn .ico { width: 18px; height: 18px; }
.ad-btn .ad-host { font-size: 12px; font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ad-btn.btn-primary .ad-host { opacity: .8; }
.ad-btn-web { background: var(--panel-2); border-color: var(--line-2); font-weight: 400; }
.ad-btn-web .ad-host { color: var(--text-2); }
.ad-btn-web:hover { background: var(--panel-2); border-color: var(--text-3); }

.ad-code {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 8px 8px 8px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-2);
}
.ad-code-k { font-size: 13px; color: var(--text-2); flex: none; }
.ad-code-v {
  font-size: 20px; font-weight: 700; letter-spacing: .12em; color: var(--accent);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all;
}
.ad-copy { margin-left: auto; flex: none; height: 36px; padding: 0 16px; background: var(--panel-2); }
.ad-copy.is-done { color: var(--live); border-color: rgba(47, 217, 143, .45); }

.ad-note { font-size: 12px; line-height: 1.6; color: var(--text-3); }

@media (max-width: 767px) {
  .ad-modal .modal-head { padding: 0 8px 8px 16px; border-bottom: 0; }
  .ad-modal .modal-head h2 { font-size: 19px; gap: 8px; }
  .ad-modal .modal-close { width: 44px; height: 44px; }
  .ad-modal .modal-body { padding: 0 16px 20px; }
  .ad-detail { gap: 14px; }
  .ad-hero .ad-tile .ico { width: 40px; height: 40px; }
  .ad-hero .ad-tile .mono { font-size: 12px !important; }
  .ad-content { font-size: 14px; }
  .ad-actions.is-two { grid-template-columns: minmax(0, 1fr); }
  .ad-btn { height: 48px; }
  .ad-code { gap: 10px; padding-left: 12px; }
  .ad-copy { height: 44px; padding: 0 14px; }
}
