/* ag-market.css — 網頁行情查詢中心共用樣式（App 風） */

/* 漲跌顏色 */
.chg { font-weight: 600; white-space: nowrap; }
.chg-up { color: #c0392b; }
.chg-down { color: #27ae60; }
.chg-flat { color: #999; }
.chg small { font-weight: 400; font-size: 0.8em; }

/* 類型 tabs */
.ag-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.ag-type-tab {
  padding: 7px 18px; border: 1px solid #ccd0d8; border-radius: 20px;
  background: #fff; color: #444; font-size: 0.95em; cursor: pointer;
  text-decoration: none; transition: all .15s;
}
.ag-type-tab:hover { background: #e8f0fc; border-color: #99b8e8; }
.ag-type-tab.active { background: #2980b9; border-color: #2471a3; color: #fff; font-weight: 700; }
.ag-type-tab:disabled { opacity: .45; cursor: not-allowed; }

/* 市場 pills */
.ag-market-pills { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.ag-mkt-pill {
  padding: 4px 12px; border: 1px solid #d0d0d0; border-radius: 14px;
  background: #f5f5f5; color: #555; font-size: 0.85em; cursor: pointer;
  text-decoration: none; transition: all .12s;
}
.ag-mkt-pill:hover { background: #e8f0fc; border-color: #99b8e8; }
.ag-mkt-pill.active { background: #325da7; border-color: #26477a; color: #fff; font-weight: 700; }

/* 分類 pills */
.ag-cat-pills { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.ag-cat-pill {
  padding: 3px 11px; border: 1px solid #d8d8d8; border-radius: 13px;
  background: #fafafa; color: #666; font-size: 0.82em; cursor: pointer;
}
.ag-cat-pill:hover { background: #eef4fb; }
.ag-cat-pill.active { background: #27ae60; border-color: #1e8449; color: #fff; font-weight: 600; }

/* 表格容器：mobile 橫向捲動 */
.ag-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e0e4ea; border-radius: 6px; margin: 8px 0; }
table.ag-table { width: 100%; border-collapse: collapse; font-size: 0.9em; min-width: 720px; }
table.ag-table thead th {
  background: #f4f6f8; color: #555; font-weight: 700; text-align: center;
  padding: 8px 6px; border-bottom: 2px solid #d8dde3; white-space: nowrap; position: sticky; top: 0;
}
table.ag-table tbody td { padding: 7px 6px; border-bottom: 1px solid #eef0f3; text-align: center; white-space: nowrap; }
table.ag-table tbody tr:hover { background: #f7fafd; }
table.ag-table .col-goods { text-align: left; font-weight: 700; color: #333; min-width: 90px; }
table.ag-table .col-price { font-size: 1.05em; font-weight: 700; }
table.ag-table .row-actions a { text-decoration: none; margin: 0 3px; font-size: 1.1em; }
table.ag-table .fav-on { color: #c0392b; }

/* 分頁 */
.ag-pager { display: flex; gap: 6px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.ag-pager button {
  padding: 5px 12px; border: 1px solid #ccd0d8; border-radius: 14px;
  background: #fff; color: #444; cursor: pointer; font-size: .88em;
}
.ag-pager button.active { background: #2980b9; color: #fff; font-weight: 700; border-color: #2471a3; }
.ag-pager button:disabled { opacity: .4; cursor: default; }

/* 圖表 modal */
.ag-chart-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1050; display: none; }
.ag-chart-modal.open { display: block; }
.ag-chart-box {
  background: #fff; margin: 6vh auto; width: 92%; max-width: 760px;
  border-radius: 10px; padding: 14px; box-shadow: 0 6px 30px rgba(0,0,0,.3);
}
.ag-chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ag-chart-title { font-weight: 700; color: #333; }
.ag-chart-close { cursor: pointer; font-size: 1.3em; color: #888; border: none; background: none; }
.ag-chart-seg { display: flex; gap: 6px; margin-bottom: 6px; }
.ag-chart-seg button {
  padding: 4px 14px; border: 1px solid #ccd0d8; border-radius: 13px;
  background: #fff; cursor: pointer; font-size: .85em;
}
.ag-chart-seg button.active { background: #2980b9; color: #fff; font-weight: 700; border-color: #2471a3; }

/* toast */
.ag-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(50,50,50,.92); color: #fff; padding: 9px 18px;
  border-radius: 6px; z-index: 2000; font-size: .92em; display: none;
}

/* 資料日期列 */
.ag-data-date { color: #888; font-size: .85em; margin: 4px 0; }

/* 我的最愛卡片 */
.ag-fav-sec-title {
  font-weight: 700; color: #325da7; margin: 12px 0 6px;
  padding-bottom: 4px; border-bottom: 2px solid #e8edf5; font-size: .95em;
}
.ag-fav-card {
  border: 1px solid #e0e4ea; border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; background: #fff;
}
.ag-fav-head { display: flex; justify-content: space-between; align-items: center; }
.ag-fav-name { font-weight: 700; color: #333; }
.ag-fav-sub { color: #888; font-weight: 400; font-size: .85em; }
.ag-fav-actions a { text-decoration: none; margin-right: 8px; font-size: 1.05em; }
.ag-fav-actions button {
  border: 1px solid #e0b3b3; background: #fdecec; color: #c0392b;
  border-radius: 12px; padding: 2px 10px; cursor: pointer; font-size: .8em;
}
.ag-fav-body { margin-top: 6px; font-size: .92em; }
