/* ============================================
   Mobile Responsive Styles
   Target: phone portrait (max-width: 768px)
   ============================================ */

/* --- Hamburger button: hidden on desktop --- */
.hamburger-btn { display: none; }

/* --- Mobile overrides --- */
@media (max-width: 768px) {

  /* === Global Layout === */
  #container { width: 100%; padding: 0; }
  #header { height: auto; padding: 8px; }
  #title h1 { font-size: 1.1em; }
  #loginfo { float: none; text-align: left; margin-top: 5px; }
  #main { padding: 8px; }
  #footer { padding: 8px; }
  fieldset { padding: 8px; }
  body { font-size: 14px; }

  /* === Hamburger Menu === */
  .hamburger-btn {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    line-height: 1;
  }
  #menu { position: relative; text-align: left !important; }
  #menu ul {
    display: none !important;
    margin: 0 !important;
    width: 100% !important;
  }
  #menu ul.open { display: block !important; }
  #menu ul li {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }
  #menu ul li a {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }

  /* === Table Horizontal Scroll === */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
  }
  .table-responsive table {
    min-width: 600px;
  }

  /* === Login / Register / ChangePassword Panels === */
  #login,
  #login.login-panel {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
  }
  .login-panel .login-submit,
  .login-panel .login-captcha-frame,
  .login-panel .login-links {
    width: 100% !important;
    box-sizing: border-box;
  }
  .login-panel .sms-input-group .btn-send-code {
    flex: 0 0 auto;
    width: auto !important;
  }
  fieldset label {
    float: none;
    width: auto;
    display: block;
    margin-bottom: 4px;
  }

  /* === BaoJia / GPLBaoJia Page Sections === */
  #BJXunjia,
  #BJAdd,
  #BJList {
    margin-bottom: 12px;
  }
  #BJXunjia fieldset,
  #BJAdd fieldset,
  #BJList fieldset {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    padding: 12px;
  }
  #BJXunjia fieldset legend,
  #BJAdd fieldset legend,
  #BJList fieldset legend {
    font-size: 15px;
    padding: 4px 12px;
  }

  /* === BaoJia Form Vertical Stack === */
  #BJAdd table#master tr,
  #BJAdd > fieldset > table:not(.item-section) tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  #BJAdd table#master td,
  #BJAdd > fieldset > table:not(.item-section) td {
    display: block !important;
    width: 100% !important;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
  }
  #BJAdd table#master td:last-child,
  #BJAdd > fieldset > table:not(.item-section) td:last-child {
    border-bottom: none;
  }
  #BJAdd table#master input,
  #BJAdd > fieldset > table:not(.item-section) input,
  #BJAdd table#master select {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    font-size: 14px;
    margin-top: 4px;
  }
  #BJAdd table#master td:first-child,
  #BJAdd > fieldset > table:not(.item-section) td:first-child {
    font-weight: bold;
    padding-top: 10px;
    color: #1a5276;
    font-size: 13px;
  }

  /* 分项说明录入区 */
  #BJAdd > fieldset > .item-section td {
    display: block;
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
  }
  #BJAdd > fieldset > .item-section td:last-child {
    border-bottom: none;
  }
  #BJAdd > fieldset > .item-section td.item {
    font-weight: bold;
    color: #1a5276;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
    margin-top: 6px;
  }
  #BJAdd > fieldset > .item-section input[type="text"] {
    width: 100% !important;
    box-sizing: border-box;
    height: 38px;
    font-size: 15px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 8px;
  }
  #BJAdd > fieldset > .item-section input[type="submit"] {
    width: 100%;
    height: 44px;
    font-size: 15px;
    border-radius: 4px;
    margin-top: 4px;
  }

  /* 报价录入区的分隔线 */
  #BJAdd fieldset hr {
    margin: 12px 0;
    border-top-color: #d5dbdb;
  }

  /* 完成报价/删除报价按钮 */
  #BJAdd fieldset table:last-of-type td {
    text-align: center;
    padding: 10px 12px;
  }
  #BJAdd fieldset table:last-of-type input[type="submit"],
  #BJAdd fieldset table:last-of-type input[type="button"] {
    width: 48%;
    margin: 0 1%;
    font-size: 15px;
    border-radius: 4px;
  }

  /* 添加按钮 */
  #BJAdd > fieldset > table input[type="submit"],
  #BJAdd > fieldset > table input[type="button"] {
    width: 100%;
    margin-top: 8px;
    font-size: 15px;
    border-radius: 4px;
  }

  /* === BJList Summary Table Vertical Stack === */
  #BJList fieldset > div > table {
    margin-bottom: 8px;
  }
  #BJList fieldset > div > table tr {
    display: flex;
    flex-direction: column;
  }
  #BJList fieldset > div > table td {
    display: block;
    width: 100%;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
  }
  #BJList fieldset > div > table td:last-child {
    border-bottom: none;
  }
  #BJList fieldset > div > table td:first-child {
    font-weight: bold;
    padding-top: 8px;
    color: #1a5276;
    font-size: 13px;
  }
  #BJList fieldset > div > table input,
  #BJList fieldset > div > table select {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    font-size: 14px;
    margin-top: 4px;
  }

  /* 修改按钮 */
  #BJList fieldset > div > table input[type="submit"],
  #BJList fieldset > div > table input[type="button"] {
    width: 100%;
    margin-top: 8px;
    font-size: 15px;
    border-radius: 4px;
  }

  /* === BaoJia GridView (报价内容) === */
  #BJList .table-responsive table {
    min-width: 500px;
  }
  #BJList .GridViewStyle {
    font-size: 13px;
  }
  #BJList .GridViewStyle td,
  #BJList .GridViewStyle th {
    padding: 6px 4px;
    white-space: nowrap;
  }

  /* === Default.aspx Filter Bar === */
  .filter-bar {
    position: static !important;
    left: auto !important;
    padding: 8px;
  }
  .filter-bar select,
  .filter-bar input[type="text"] {
    max-width: 120px;
    box-sizing: border-box;
  }

  /* === HistoricalPrice Filter Bar === */
  #myprice {
    padding: 8px;
    line-height: 2;
  }

  /* === GPLPoSearch Summary Table === */
  #BJList table tr {
    display: flex;
    flex-direction: column;
  }
  #BJList table td {
    display: block;
    width: 100%;
    padding: 2px 0;
  }

  /* === Universal Input / Button === */
  input[type="text"],
  input[type="password"],
  textarea,
  select {
    max-width: 100%;
    box-sizing: border-box;
  }
  input[type="button"],
  input[type="submit"],
  button {
    min-height: 44px;
    padding: 8px 16px;
  }
}
