@import url('https://fonts.googleapis.com/css2?family=Quattrocento:wght@400;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');

    body {
      background-color: #23272e;
      color: #fff;
      padding: 32px;
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 32px;
      min-height: 100vh;
    }
    
    .container {
      max-width: 700px;   /* 或你想要的寬度 */
      margin: 0 auto;     /* 上下 0，左右 auto */
    }
    
    
    h1 {
      font-weight: bold;
      margin-bottom: 28px;
      letter-spacing: 2px;
    }
    
    .top-link {
        color: #28a745;
        font-weight: bold;
        text-decoration: none;
        margin-right: 16px;
    }
    .top-link:hover {
        text-decoration: underline;
    }
    
    #reading {
      font-size: 1.25em;
      color: #ffd700;
      letter-spacing: 2px;
      margin-bottom: 16px;
      margin-top: 20px;
      font-weight: bold;
    }
    #control_panel {
      margin-top: 30px;
      background: #181b20;
      border-radius: 16px;
      padding: 28px 32px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.24);
      max-width: 700px;
    }
    .panel-buttons {
      display: flex;
      gap: 12px;
      margin-bottom: 20px;
    }
    .track {
      margin-bottom: 22px;
      padding: 12px 18px 16px 18px;
      border-radius: 12px;
      background: #32363e;
      box-shadow: 0 2px 6px rgba(0,0,0,0.11);
      font-size: 1.06em;
      transition: box-shadow 0.2s;
      /*display: flex;*/
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
    }

    
    .track label {
      margin-left: 8px;
      font-size: 1em;
      font-weight: 400;
      color: #90ee90;
    }
	
	/* 針對 track-name 加上固定寬度、文字超過時用省略號 */

.track .track-name {
  flex: 1;                /* 文字區域可伸展 */
  min-width: 120px;       /* 至少 120px */
  max-width: 300px;       /* 最多 300px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
}

	
	
    .track input[type='range'] {
      width: 120px;
      margin-left: 12px;
      accent-color: #45d8d5;
    }
    .track img {
      vertical-align: middle;
      margin-right: 6px;
    }
    .track a img {
      margin-right: 0;
      margin-left: 12px;
    }
    #pitch_shift {
      vertical-align: middle;
      margin: 0 10px;
      width: 150px;
      accent-color: #90ee90;
    }
    #pitch_value {
      color: #ffd700;
      font-weight: 600;
      margin-left: 6px;
    }
    @media (max-width: 600px) {
      #control_panel {
        padding: 15px 8px;
        max-width: 98vw;
      }
      .track {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 6px 10px 8px;
      }
      .t_top {
        flex-wrap: wrap;
        gap: 7px;
      }
      .track input[type='range'] {
        width: 80px;
      }
    }

	label {
		padding: 0;
		margin-right: 1px;
		margin-left: 1px;
		cursor: pointer;
	}

	input[type=checkbox] {
	    display: none;
    }
    
    input[type=checkbox] + span {
    	display: inline-block;
    	background-color: #e0e0e0;
    	padding: 3px 6px;
    	border-radius: 6px;
    	border: 1px solid #ccc;
    	color: #333;
    	cursor: pointer;
    	transition: background-color 0.2s, color 0.2s;
    	/*font-size: 0.9em;*/
    	font-weight: 500;
    	user-select:none ;
    }
    
    input[type=checkbox]:hover + span {
    	background-color: #d0d0d0;
    }
    
    input[type=checkbox]:checked + span {
    	background-color: #007bff; /* 藍色選中 */
    	color: white;
    	border-color: #007bff;
    }
    
    .level-meter-container {
      width: 8px;
      height: 48px;
      background: #444;
      position: relative;
      display: inline-block;
      border-radius: 4px;
      overflow: hidden;
    }
    
    .level-meter-bar {
      width: 100%;
      background: #0f0;
      position: absolute;
      bottom: 0;
      height: 0%;
      transition: height 0.1s;
    }
    
    .volume-slider {
      width: 100px;
      accent-color: #90ee90;
      margin-left: 4px;
    }

    .track .col-12 {
      margin-bottom: 6px;
    }
    
    .track .track-name {
      
      max-width: 150px;
      display: inline-block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      
     
      width: 30%;                     /* 根據你的設計，改成你想要的固定寬度 */
      font-weight: bold;                /* 可以視需求加粗或調字級 */
      margin-right: 0.5rem;             /* 右側留點空間給 S / M 按鈕 */
      cursor: default; 
    }
    
    @media (max-width: 600px) {
      .track .t_top {
        flex-direction: column;
        align-items: flex-start;
      }
    }
    
    .volume-wrapper {
  position: relative;
  width: 160px;
  height: 20px;
  margin-top: 6px;
}

    .volume-meter-progress {
      width: 100%;
      height: 100%;
      border-radius: 4px;
      background-color: #333;
      accent-color: #00ff00; /* Meter 顏色 */
    }
    
    .volume-slider-on-progress {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: transparent;
      -webkit-appearance: none;
      appearance: none;
      z-index: 2;
    }
    
    .volume-slider-on-progress::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 10px;
      height: 20px;
      background: #90ee90;
      cursor: pointer;
      border-radius: 4px;
    }
    
    .volume-slider-on-progress::-moz-range-thumb {
      width: 10px;
      height: 20px;
      background: #90ee90;
      cursor: pointer;
      border-radius: 4px;
    }
    
    .volume-wrapper {
  position: relative;
  width: 160px;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #333;
  margin-right: 8px;
}

.volume-meter-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background-color: #0f0; /* 預設綠 */
  transition: width 0.1s, background-color 0.1s;
  z-index: 1;
}

.volume-slider {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 16px;
  background: #90ee90;
  border-radius: 4px;
  cursor: pointer;
}
.volume-val {
  min-width: 50px;
  text-align: left;
  font-family: monospace;
  color: #ffd700;
}

.track.dragging {
    opacity: 0.8;
    background: #f0f0f0;
}

.track.placeholder {
    border: 2px dashed #aaa;
    background: transparent;
}

#progressWrap { position:relative; width:100%; height:50px; }
#progressBar  { width:100%; height:50px; }
#playhead{
position:absolute; top:0; bottom:0; left:0;
width:2px; background:#ff2d55; pointer-events:none;
}


/*拖拉*/

  #trackList .track { background:#2b2f36; border:1px solid #444; border-radius:8px; padding:8px; }
  #trackList .drag-handle {
    width:28px; height:28px; border-radius:6px; background:#1f2329; color:#fff;
    display:flex; align-items:center; justify-content:center; cursor:grab; user-select:none;
  }
  #trackList .drag-handle:active { cursor:grabbing; }
  #trackList .move-btns { display:inline-flex; gap:4px; }
  #trackList .drag-placeholder { height:48px; border:2px dashed #888; border-radius:8px; margin:4px 0; }

.drag-handle {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1f2329;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: default;       /* 預設箭頭 */
  user-select: none;
  transition: all 0.15s ease;  /* 平滑效果 */
}

.drag-handle:hover {
  cursor: pointer;       /* 滑過去變手指 */
  background: #2d3239;   /* 顏色稍微變亮 */
  transform: scale(1.1); /* 微微放大 */
}


