/* End extract */
html,body {		
	font-size: 14px;	
}

:root {
	--w3-theme-l5: #f4faf4; /* 从 w3-theme-blue.css 拷贝过来 */
	--w3-theme-d5: #1565c0;	
    --form-gap: 12px;
    /*
	--max-width: 980px;
    --bg: #f7f8fb;
    --card: #ffffff;
    --accent: #007bff;
    --muted: #666; */ 
}

.w3-table-all td, 
.w3-table-all th {
  border: 1px solid #ccc;   /* 给每个格子加线 */
}
.w3-table-all {
  border-collapse: collapse; /* 避免双线 */
}

/* 偶数行套用 w3-theme-l3 */
.w3-table-all tr:nth-child(even) {
  background-color: inherit; /* 清掉默认颜色 */
}
.w3-table-all tr:nth-child(even) td {
  background-color: var(--w3-theme-l5);
}

.footer-container {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: #f1f1f1;
	border-top: 1px solid #ccc;
	display: flex;
	font-size: 13px;
	align-items: center;
	justify-content: space-between;
	padding: 8px 16px;
	z-index: 999;
	transition: background 0.3s;
	cursor: pointer;
}

.footer-container:hover {
	background: #e6e6e6;
}  

.footer-left, .footer-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.footer-container button {
	padding: 8px 10px;
	_font-size: 13px;
	line-height: 1.2;
	_background-color: red;
} 

/* Tom Select inline width & alignment */
.footer-container .ts-wrapper {
  display: inline-block !important;
  min-width: 30px;
  vertical-align: middle;
}

.ts-dropdown.dropup {
	top: auto !important;       /* reset top */
	bottom: 100% !important;    /* position above input */
	margin-bottom: 4px;         /* spacing */
}

/* Modal */	
.modalx-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.modalx {
  position: absolute;
  width: 400px;
  _height : 300px;
  background: #fff;
  _border: 1px solid #aaa;*/
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  box-sizing: border-box;
  overflow: hidden;	 
}

/*  .modalx-header,
.modalx-footer {      
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
} */

.modalx-header {    
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  cursor: move;
}

.modalx-footer {
  /*background: #007bff; 
  color: white;*/
  padding: 5px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  cursor: move;
}

.modalx-content {
  padding: 15px;
  height: calc(100% - 80px); 
  overflow: auto;
  box-sizing: border-box;
}

.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.w3-btn-small, .w3-button-small {
	border: none;
	display: inline-block;
	padding: 4px 8px;
	vertical-align: middle;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background-color: inherit;
	text-align: center;
	cursor: pointer;
	white-space: nowrap;
}

.w3-button-small:hover{color:#000!important;background-color:#ccc!important}

/*.modalx-button {
  padding: 4px 12px;
  background-color: #fff;
  border: none;     
  border-radius: 4px;
  cursor: pointer;     
}

.modalx-button:hover {
  background-color: #e0e0e0;
}  */
	
.resizer {
  position: absolute;
  background: transparent;
}

.resizer.top { top: -4px; left: 0; height: 8px; width: 100%; cursor: n-resize; }
.resizer.right { top: 0; right: -4px; width: 8px; height: 100%; cursor: e-resize; }
.resizer.bottom { bottom: -4px; left: 0; height: 8px; width: 100%; cursor: s-resize; }
.resizer.left { top: 0; left: -4px; width: 8px; height: 100%; cursor: w-resize; }

.resizer.tl, .resizer.tr, .resizer.bl, .resizer.br {
  width: 10px;
  height: 10px;
  _background: #007bff;
  position: absolute;
}

.resizer.tl { top: -5px; left: -5px; cursor: nw-resize; }
.resizer.tr { top: -5px; right: -5px; cursor: ne-resize; }
.resizer.bl { bottom: -5px; left: -5px; cursor: sw-resize; }
.resizer.br { bottom: -5px; right: -5px; cursor: se-resize; } 

/* Grid container */
.responsive-form {   
	display: grid;
	_grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	grid-template-columns: repeat(12, 1fr); /* 12-column grid */
	_gap: 16px;
	gap: var(--form-gap);
	align-items: start;
}

.responsive-form label {
	_display: _block;
	margin-bottom: 4px;
	_font-weight: bold;
}

/* Grid container */
.modal-form {   
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	_gap: 16px;
	gap: var(--form-gap);
	align-items: start;
}

.modal-form label {
	_display: block;
	margin-bottom: 4px;
	_font-weight: bold;
}

label {
	color: brown;             /* readable dark gray */
	font-size: 0.9rem;    
}


/* Span multiple columns */
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.full-width { grid-column: 1 / -1; }

/* Buttons container */
.button-group {
	grid-column: 1 / -1; /* full width */
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

.checkbox-group {
	display: block;       /* container is block */	
}

.checkbox-group div {
	display: block;       /* each checkbox on its own line */
	margin-bottom: 2px;   /* spacing between checkboxes */
}

.checkbox-group div input[type='checkbox'] {
	position: static;     /* override W3.CSS absolute positioning */
	margin-right: 2px;    /* space between checkbox and label text */
}	

.readonly-input {
	display: block;
	padding: 4px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background-color: #f9f9f9;
	min-width: 200px;
}

.w3-input {
	padding: 4px 8px;
	border-radius: 4px;
}

.w3-select {
	padding: 6px 8px;   
	border-radius: 4px;
}

.radio-group div {
	display: inline;    /* inline layout for each radio + label */
	margin-right: 24px;       /* horizontal gap between items */
	vertical-align: middle;   /* align with other text */
}

.radio-group input[type='radio'] {
	position: static;         /* override W3.CSS absolute positioning */
	margin-right: 4px;        /* space between radio and label text */
}

.w3-padding-bottom-64
{
	padding-bottom: 64px !important;
}

.w3-padding-left-8
{
	padding-left: 8px !important;
}


.w3-padding-left-16
{
	padding-left: 16px !important;
}

/* Overlay */
.modalz-overlay {	
	position: fixed; 	
	inset:0;
	background: rgba(0,0,0,0.5);
	display: none;
	justify-content: center; 
	align-items: center;
	opacity:0; 
	transition: opacity 0.25s ease;
}

/* Modal container */
.modalz {
	position: absolute;
	background: white;
	font-size:14px; 
	_border-radius: 8px;
	_border:1px solid #ccc;
	_min-width: 300px; 
	_min-height:200px;
	display:flex; 
	flex-direction:column;
	overflow:hidden;
	box-shadow:0 5px 15px rgba(0,0,0,0.3);
	opacity:10; 
	transition: box-shadow 0.15s ease, 
	transform 0.15s ease, opacity 0.25s ease;
	_width: 80%;       /* default width */
	_max-width: 95%; /* desktop max width */
	_height: auto;
}

/* Header */
.modalz-header {
	flex:0 0 auto;
	padding: 8px 10px;
	font-size:15px; 
	cursor:move;
	background:#2d89ef; 
	color:white; 
	_font-weight:bold;
	display:flex; 
	justify-content:space-between; 
	align-items:center;
}

/* Content */
.modalz-content {
	flex:1 1 auto;
	padding:10px;
	overflow:auto;
	position: relative;
}

/* Footer */
.modalz-footer {
	flex:0 0 auto;
	padding:8px;
	cursor:move;
	display:flex;	
	justify-content:space-between;
	background:#f0f0f0;
	border-top:1px solid #ccc;
}

.modalz-footer button { 
	margin:2px; 
}

.close-button { 
	background:none; 
	border:none; 
	font-size:16px; 
	color:white; 
	cursor:pointer; 
}

/* Resizers */
.resizeModalz {
  position:absolute; 
  background:transparent; 
  z-index:10000;
}

/* Edges */
.resizeModalz.left, 
.resizeModalz.right { 
	width:6px; 
	height:100%; 
	top:0; 
}

.resizeModalz.left { 
	left:-3px; 
	cursor:w-resize; 
}

.resizeModalz.right { 
	right:-3px; 
	cursor:e-resize; 
}

.resizeModalz.top, 
.resizeModalz.bottom { 
	height:6px; 
	width:100%; 
	left:0; 
}

.resizeModalz.top { 
	top:-3px; 
	cursor:n-resize; 
}

.resizeModalz.bottom { 
	bottom:-3px; 
	cursor:s-resize; 
}

/* Corners */
.resizeModalz.tl, 
.resizeModalz.tr, 
.resizeModalz.bl, 
.resizeModalz.br {
  width:16px; 
  height:16px; 
  z-index:10001;
}

.resizeModalz.tl { 
	top:-8px; 
	left:-8px; 
	cursor:nw-resize; 
}

.resizeModalz.tr { 
	top:-8px; 
	right:-8px; 
	cursor:ne-resize; 
}

.resizeModalz.bl { 
	bottom:-8px; 
	left:-8px; 
	cursor:sw-resize; 
}

.resizeModalz.br { 
	bottom:-8px; 
	right:-8px; 
	cursor:se-resize; 
}

/* Spinner */
.modalz-spinner {
  position: absolute;
  top:50%; left:50%;
  transform: translate(-50%, -50%);
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2d89ef;
  border-radius: 50%;
  width: 30px; 
  height: 30px;
  animation: spin 1s linear infinite;
  z-index: 5000;
}
  

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
  
/* Overlay */
.modalq-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	display: none; /* hidden by default */
	justify-content: center;
	align-items: center;
	_z-index: 1000;
}

/* modalq */
.modalq {
	background: white;
	border-radius: 8px;
	padding: 20px;
	width: 80vw;  /* responsive width */
	height: 70vh;
	max-width: 95% /* 800px; desktop max */
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 5px 20px rgba(0,0,0,0.3);
	text-align: center;
}  
 
/* Tab container */
.tab-container {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  border-bottom: none;
}

/* Tab buttons */
.tab-container button {
  flex: 0 0 auto;
  padding: 4px 14px;
  cursor: pointer;
  border: 1px solid #aaa;
  background: #f1f1f1;
  color: #000;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #aaa;
  margin-right: -1px;
  transition: background 0.2s;
}
.tab-container button:hover { background: #e0e0e0; }

/* Active tab */
.tab-container button.active {
  background: #fff;
  _color: #007bff;
  _font-weight: bold;
  border: 1px solid #aaa;
  border-bottom-color: transparent; /* merge with content */
  z-index: 2;
  position: relative;
  cursor: default;
}

/* Content wrapper */
.tab-contents {
  border: 1px solid #aaa;
  border-radius: 0 0 8px 8px;
  background: #fff;
  margin-top: -1px; /* merge with active tab */
  overflow: hidden;
  position: relative;
}

/* Individual panels */
.tab-content {
  display: none;
  width: 100%;
  padding: 15px;
  _transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}
.tab-content.slide-left { transform: translateX(-100%); }
.tab-content.slide-right { transform: translateX(100%); }
 
 
/* Make dropdown always float above all elements */
.ts-dropdown {
    z-index: 2147483647 !important; /* Max safe z-index */
    position: absolute !important;
}

/* Optional: Ensure option list stays above */
.ts-dropdown .ts-options,
.ts-dropdown .ts-option {
    z-index: 2147483647 !important;
} 
 
.sort-icon {
	float: right;
	width: 14px;
	height: 14px;
	margin-left: 5px;
	cursor: pointer;
	_fill: white;
}

.sort-icon-15 {
	float: right;
	width: 15px;
	height: 15px;
	margin-left: 5px;
	cursor: pointer;
	_fill: white;
} 
 
.button-icon {
	float: right;
	width: 14px;
	height: 14px;
	_margin-left: 5px;
	cursor: pointer;
	_fill: white;
}  

.w3-input-sm {
    padding: 5px 8px;
    display: block;
    border: none;
    border-bottom: 1px solid #ccc;
    width: 100%;
	border-radius: 4px;
}

 
/* Mobile adjustments  @media screen and (max-width: 768px) {*/
@media screen and (max-width: 768px) { 
		
	.responsive-form {
	  grid-template-columns: 1fr; /* single column */
	}

	/* All spans full width on mobile */
	.span-2, .span-3, .span-4, .full-width {
	  grid-column: 1 / -1;
	}

	/* Buttons stacked */
	.button-group {
	  flex-direction: column;
	  align-items: stretch;
	}	 
		
	.footer-container button {
		padding: 4px 8px;
		font-size: 10px;
		line-height: 1.2;
		_background-color: blue;
	 }	

	.ts-control {			
		padding: 1px 4px;
		font-size: 10px;
	}

	#btn-start,#btn-end {
		display: none; !important; /* force hide on mobile */		
	}
	
	.tab-container button {
		border-radius: 0;
		margin-right: 0;
	}
	
	.tab-contents {
		border-radius: 0;
	}
	
	.modalz {
		width: 95vw !important;      
		max-width: 95vw !important;
		_height: 90vh !important;
		_max-height: 95vh !important;		
	}
	
}   
