/* ===================================================================
 * StockSearch — 復古券商 UI
 * 樣式取自 2025_files/all.css 與 saved_resource.html 的實際渲染值
 *   買進 #FF1D1D / 賣出 #0000FF / 資料列 #FFD2D2 / 表頭 #3e83c9 / 合計 #CCCCCC
 * =================================================================== */

/* arial 在前讓英數走 Arial，中文自然落到新細明體 —— 這是當年台灣 Windows 的實際樣子 */
body {
    background-color: #FFFFFF;
    font-family: arial, verdana, "新細明體", PMingLiU, sans-serif;
    color: #000000;
    font-size: 10pt;
    margin: 0;
    padding: 0;
}

a:link, a:visited, a:active { color: blue; }

/* -------------------------------------------------
 * 頁首 / 分頁列（仿 menus.jsp 的 frame 選單）
 * ------------------------------------------------- */
/* 三條橫帶各自滿版、左右不內縮，內容統一縮排 8px */
#header {
    background-color: #FBF1BC;
    padding: 0;
}

#header .title {
    font-size: 12pt;
    font-weight: bold;
    padding: 6px 8px;
}

/* 分頁列：padding-bottom 為 0，讓標籤底緣貼齊灰條底部 */
.mainNavg {
    background-color: #cccccc;
    border-top: 1px solid #AAAAAA;
    padding: 4px 8px 0 8px;
}

.mainNavg ul { margin: 0; padding: 0; list-style: none; }
.mainNavg ul li { float: left; margin: 0 3px 0 0; }

.mainNavg ul li a {
    display: block;
    padding: 4px 18px;
    line-height: 16px;
    text-align: center;
    text-decoration: none;
    font-size: 9pt;
    color: #000;
    background: #e1e1e1;
    border: 1px solid #bbbbbb;
    border-bottom: 0 none;
    outline: none;
}

.mainNavg ul li a:hover {
    border-color: #AAAAAA;
    background: #ededed;
    text-decoration: underline;
}

/* 選取中的標籤與查詢列同底色，兩塊接成一體 */
.mainNavg ul li a.nowShowA {
    background: #F4F4F4;
    border-color: #AAAAAA;
    font-weight: bold;
}

.clear { clear: both; }

/* -------------------------------------------------
 * 查詢表單
 * ------------------------------------------------- */
#queryBar {
    background-color: #F4F4F4;
    border-bottom: 1px solid #AAAAAA;
    padding: 8px;
}

/* 螢幕窄時整列自動換行，不會撐破畫面 */
#queryForm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

#queryBar .field {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

#queryBar label { font-size: 10pt; }

#queryBar input[type="text"] {
    font-family: arial, verdana, "新細明體", PMingLiU, sans-serif;
    font-size: 10pt;
    padding: 2px 3px;
    border: 1px solid #7F9DB9;
    width: 11em;
    max-width: 100%;
    min-width: 0;
}

#queryBar select {
    font-family: arial, verdana, "新細明體", PMingLiU, sans-serif;
    font-size: 10pt;
}

/* 當年的按鈕就是 ridge 斜角框 */
.fbutton {
    font-family: arial, verdana, "新細明體", PMingLiU, sans-serif;
    font-size: 12px;
    border-style: ridge;
    padding: 1px 10px;
    cursor: pointer;
}

.sbutton {
    font-family: arial, verdana, "新細明體", PMingLiU, sans-serif;
    font-size: 10px;
    border-style: ridge;
    padding: 1px 8px;
    cursor: pointer;
}

.fbutton[disabled], .sbutton[disabled] { color: #999999; cursor: default; }

/* -------------------------------------------------
 * 內容區
 * ------------------------------------------------- */
#content { padding: 8px; }

#status {
    padding: 4px 2px;
    font-size: 10pt;
    min-height: 16px;
}

#status .err { color: #CC0000; font-weight: bold; }
#status .warn { color: #AA6600; }

#summaryLine {
    padding: 3px 2px 6px 2px;
    font-size: 10pt;
}

#summaryLine b { font-size: 11pt; }

/* -------------------------------------------------
 * 資料表格
 *   cellspacing=1 + bordercolor 底色 = 當年的格線做法
 * ------------------------------------------------- */
/* 表格外層：內容太寬時在自己的框內橫向捲動，不讓整頁跟著捲 */
.tableWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

table.grid {
    border-collapse: separate;
    border-spacing: 1px;
    background-color: #AAAAAA;   /* 格線顏色由底色透出 */
    margin: 0;
    /* 有空間就撐滿版；內容撐不下時保持自然寬度交給外層捲動 */
    width: 100%;
    min-width: max-content;
}

table.grid th {
    font-family: arial, verdana, "新細明體", PMingLiU, sans-serif;
    font-size: 10pt;
    white-space: nowrap;
    color: white;
    background-color: #3e83c9;
    border-top: #5ea3e9 1px solid;
    border-left: #5ea3e9 1px solid;
    border-right: #1e63a9 1px solid;
    border-bottom: #1e63a9 1px solid;
    padding: 3px 6px;
    font-weight: normal;
}

table.grid td {
    font-family: arial, verdana, "新細明體", PMingLiU, sans-serif;
    font-size: 10pt;
    white-space: nowrap;
    padding: 3px 6px;
    background-color: #FFD2D2;   /* 資料列底色 */
}

table.grid td.numeric { text-align: right; }
table.grid td.center  { text-align: center; }

/* 買 紅 / 賣 藍 —— 依實際頁面的 inline font color */
.TDBUY  { color: #FF1D1D; }
.TDSELL { color: #0000FF; }

/* 合計列 */
table.grid tr.grand td {
    background-color: #CCCCCC;
    font-weight: bold;
}

table.grid tr.grand.net td {
    background-color: #BFBFBF;
    border-top: 2px solid #888888;
}

/* -------------------------------------------------
 * 區塊標題（總計 / 客戶彙總 / 每日明細）
 * 純文字，無底色無框線 —— 顏色只留給真正的資料表格
 * ------------------------------------------------- */
.secHead {
    font-size: 12pt;
    font-weight: bold;
    color: #000000;
    padding: 0 2px;
    margin: 26px 0 6px 0;
}

.secHead:first-child { margin-top: 2px; }

/* -------------------------------------------------
 * 每日分隔（純文字，不是表格列也不是色塊）
 * ------------------------------------------------- */
.dayHead {
    margin: 18px 0 4px 0;
    padding: 0 2px;
}

.dayHead .d {
    font-size: 11pt;
    font-weight: bold;
    margin-right: 14px;
}

.dayHead .s {
    font-size: 10pt;
    color: #333333;
}

/* -------------------------------------------------
 * 手機
 * ------------------------------------------------- */
@media (max-width: 640px) {
    body { font-size: 9pt; }

    #header .title { font-size: 11pt; padding: 5px 6px; }

    .mainNavg { padding: 4px 6px 0 6px; }
    .mainNavg ul li a { padding: 4px 12px; }

    #queryBar { padding: 6px; }
    #queryBar input[type="text"] { width: 9em; }
    #queryBar label, #queryBar select, .fbutton { font-size: 9pt; }

    #content { padding: 5px; }

    table.grid th, table.grid td { padding: 3px 5px; font-size: 9pt; }

    .secHead { font-size: 11pt; margin: 20px 0 5px 0; }
    .dayHead { margin: 14px 0 4px 0; }
    .dayHead .d { font-size: 10pt; display: block; margin-right: 0; }
    .dayHead .s { font-size: 9pt; }
}
