body {
    font-family: -apple-system, sans-serif; background: var(--bg);
    margin: 0; display: flex; flex-direction: column;
    align-items: center; min-height: 100vh;
}

h1 { font-size: 1.5rem; color: #333; }

:root { --primary: #007bff; --bg: #f4f7f6; }

#status { color: #666; margin: 1rem 0; font-size: 0.9rem; }

.hidden { display: none; }

.card {
    background: white; padding: 2rem; border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); text-align: center;
    width: 85%; max-width: 400px; margin-top: 15vh;
}

.app-shroud {
    position:fixed; top:0; left:0; width:100%; height:100%;
    background:rgba(0,0,0,0.8); z-index:9999; color:white;
    text-align:center; padding-top:20px;
}

.app-shroud H1 {
    font-size: 20px;
    color: white;
}

.app-shroud strong {
    color: cyan;
    font-size: 30px;
}

.installGuideOverlay {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 350px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 9999;
  padding: 20px;
  border: 1px solid #ddd;
}

.iosGuide h3 { margin-top: 0; font-size: 1.1rem; color: #333; }
.guide-step { font-size: 0.95rem; line-height: 1.6; color: #555; margin: 15px 0; }

.icon-share {
  width: 24px;
  height: 24px;
  background-color: #007AFF;
  display: inline-block;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12V19c0 1 1 2 2 2h12c1 0 2-1 2-2V12'/%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='M17 8l-5-5-5 5'/%3E%3C/svg%3E");
}

.close-btn {
  position: absolute;
  top: 10px; right: 10px;
  border: none; background: none; font-size: 20px; cursor: pointer; color: #999;
}

.btn {
  background: var(--primary); color: white; border: none;
  padding: 14px 28px; border-radius: 8px; cursor: pointer;
  font-size: 1rem; width: 100%; transition: 0.2s;
}

.btn:disabled { background: #ccc; }

.copyright { text-align: right; font-style: italic; font-size: 0.8rem;}

.install-button {
    background-color: #007AFF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}
.install-button:active {
    transform: scale(0.95);
}

.conversion-panel {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    background: #f8f9fa;
    padding: 8px 1px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 10px;
}

.select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.select-group label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-left: 2px;
}

select {
    appearance: none;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 4px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus {
    outline: none;
    border-color: #007aff;
}

#swap-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: background 0.2s;
}

#swap-btn:hover { background: #f0f0f0; }
.setting-item {
  display: flex;
  /* justify-content: flex-end;*/ /* 容器佈局：向右對齊 */
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  background: #ffffff;
  border-bottom: 1px solid #f0f0f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.setting-label {
  font-size: 16px;
  color: #333;
  cursor: pointer;
  user-select: none; /* 防止長按文字時被選取，這在 PWA 很重要 */
}

/* 隱藏原生 Checkbox */
.switch-input {
  display: none;
}

.switch-slider {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  background-color: #ccc;
  border-radius: 20px;
  transition: 0.3s;
  cursor: pointer;
}

.switch-slider::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background-color: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 點選後的狀態 (建議使用主題色) */
.switch-input:checked + .switch-slider {
  background-color: #007aff; /* iOS 藍 */
}

.switch-input:checked + .switch-slider::after {
  transform: translateX(20px);
}

.setting-item:active {
  background-color: #f9f9f9; /* 點擊時的底色回饋 */
}

.switch-slider:active::after {
  width: 20px; /* 壓下去時圓點變長，模擬物理感 */
}

.setting-v2h {
    display: flex;
    align-items: center; /* 確保圖示與文字垂直置中 */
    cursor: pointer;
}

.setting-v2h::before {
    content: "";
    display: inline-block;
    width: 20px;  /* 配合 input 大小調整 */
    height: 20px;
    margin-right: 8px; /* 圖示與文字的間距 */
    background-repeat: no-repeat;
    background-size: contain;

    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="4" fill="%23007bff" fill-opacity="0.1" stroke="%23007bff" stroke-width="2"/><g transform="translate(6, 6)" stroke="%23007bff" stroke-width="2.5" stroke-linecap="round"><line x1="0" y1="0" x2="0" y2="12" stroke-dasharray="3, 3.5"/><line x1="4" y1="0" x2="4" y2="12" stroke-dasharray="3, 3.5"/><line x1="8" y1="0" x2="8" y2="12" stroke-dasharray="3, 3.5"/><line x1="12" y1="0" x2="12" y2="12" stroke-dasharray="3, 3.5"/></g></svg>');

}
