/**
 * Gesture Control Styles
 * 手勢控制系統樣式
 */
.custom-cursor {
  position: fixed;
  pointer-events: none !important;
  z-index: 10000;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 25%, rgba(34,34,34,0.75) 30%, rgba(85,85,85,0.35) 100%);
  border: 1.5px solid rgba(34,34,34,0.6);
  box-shadow: 0 0 18px rgba(34,34,34,0.35), 0 0 8px rgba(255,255,255,0.4) inset;
  transform: translate(-50%, -50%);
  transition: none;
  opacity: 1;
  will-change: transform;
}
.custom-cursor.pinching {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 25px rgba(34,34,34,0.5), 0 0 10px rgba(255,255,255,0.5) inset;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.progress-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.custom-cursor.pinching .progress-ring {
  opacity: 1;
}
.progress-ring-fill {
  transition: none;
}
.gesture-cursor {
  display: none !important;
}
.gesture-hover-highlight {
  position: fixed;
  pointer-events: none;
  z-index: 9997;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1), 0 0 20px rgba(255,255,255,0.3), inset 0 0 20px rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  opacity: 0;
  transition: opacity 0.15s ease, left 0.1s ease-out, top 0.1s ease-out, width 0.1s ease-out, height 0.1s ease-out;
}
@media (prefers-color-scheme: dark) {
  .gesture-hover-highlight {
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 0 24px rgba(255,255,255,0.25), inset 0 0 20px rgba(255,255,255,0.08);
  }
}
.gesture-arc {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 9998;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.2);
  border-right: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.25);
  width: 56px;
  height: 140px;
  border-radius: 70px 0 0 70px;
  padding: 16px 8px 16px 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  .gesture-arc {
    background: rgba(34,34,34,0.25);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
  }
}
.gesture-arc.expanded {
  width: 280px;
  height: auto;
  min-height: 340px;
  border-radius: 24px 0 0 24px;
  padding: 20px 16px 20px 20px;
  cursor: default;
}
.gesture-arc.expanded .gesture-arc-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
.gesture-arc.expanded .gesture-arc-expanded {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.gesture-arc:hover:not(.expanded) {
  width: 64px;
  background: rgba(255,255,255,0.18);
}
@media (prefers-color-scheme: dark) {
  .gesture-arc:hover:not(.expanded) {
    background: rgba(34,34,34,0.35);
  }
}
.gesture-arc-collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  transition: all 0.3s ease;
}
.gesture-arc-collapsed .arc-icon {
  width: 22px;
  height: 22px;
  color: rgba(0,0,0,0.75);
  opacity: 0.7;
}
@media (prefers-color-scheme: dark) {
  .gesture-arc-collapsed .arc-icon {
    color: rgba(255,255,255,0.85);
  }
}
.arc-status-dots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.arc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}
@media (prefers-color-scheme: dark) {
  .arc-dot {
    background: rgba(255,255,255,0.2);
  }
}
.arc-dot.status-active {
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 16px rgba(255,255,255,0.4);
  animation: dot-pulse 2s ease-in-out infinite;
}
.gesture-arc-close {
  position: fixed;
  top: calc(50% + 90px);
  right: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
}
.gesture-arc-close.visible:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}
.arc-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}
@media (prefers-color-scheme: dark) {
  .arc-close-btn {
    background: rgba(34,34,34,0.3);
    border-color: rgba(255,255,255,0.1);
  }
}
.arc-close-btn .close-icon {
  width: 18px;
  height: 18px;
  color: rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}
@media (prefers-color-scheme: dark) {
  .arc-close-btn .close-icon {
    color: rgba(255,255,255,0.5);
  }
}
.arc-close-btn .close-countdown {
  position: absolute;
  font-size: 16px;
  font-weight: 700;
  color: #f44;
  opacity: 0;
  transition: all 0.2s ease;
}
.arc-close-btn:hover {
  background: rgba(255,80,80,0.2);
  border-color: rgba(255,80,80,0.4);
  transform: scale(1.1);
}
.arc-close-btn:hover .close-icon {
  color: #f44;
}
.arc-close-btn.counting {
  background: rgba(255,80,80,0.25);
  border-color: rgba(255,80,80,0.5);
  box-shadow: 0 0 20px rgba(255,80,80,0.3);
}
.arc-close-btn.counting .close-icon {
  opacity: 0.3;
  transform: scale(0.7);
}
.arc-close-btn.counting .close-countdown {
  opacity: 1;
  animation: countdown-pulse 1s ease-in-out infinite;
}
.gesture-arc-expanded {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.arc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.arc-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(0,0,0,0.75);
  letter-spacing: 0.3px;
}
@media (prefers-color-scheme: dark) {
  .arc-title {
    color: rgba(255,255,255,0.85);
  }
}
.arc-collapse-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: rgba(0,0,0,0.5);
  transition: all 0.2s ease;
}
.arc-collapse-btn svg {
  width: 16px;
  height: 16px;
}
.arc-collapse-btn:hover {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.75);
}
@media (prefers-color-scheme: dark) {
  .arc-collapse-btn {
    color: rgba(255,255,255,0.5);
  }
  .arc-collapse-btn:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
  }
}
.arc-status-row {
  display: flex;
  gap: 8px;
}
.arc-status-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
}
.arc-status-item span {
  font-size: 10px;
  color: rgba(0,0,0,0.5);
}
@media (prefers-color-scheme: dark) {
  .arc-status-item {
    background: rgba(255,255,255,0.06);
  }
  .arc-status-item span {
    color: rgba(255,255,255,0.5);
  }
}
.arc-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}
@media (prefers-color-scheme: dark) {
  .arc-status-indicator {
    background: rgba(255,255,255,0.2);
  }
}
.arc-status-indicator.status-active {
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.9), 0 0 16px rgba(255,255,255,0.5);
  animation: dot-pulse 2s ease-in-out infinite;
}
.arc-toggle-btn {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.arc-toggle-btn:hover {
  background: rgba(0,0,0,0.85);
  transform: translateY(-1px);
}
.arc-toggle-btn[data-state="on"] {
  background: rgba(255,255,255,0.15);
  color: rgba(0,0,0,0.75);
  border: 1px solid rgba(0,0,0,0.1);
}
.arc-toggle-btn[data-state="on"]:hover {
  background: rgba(255,255,255,0.25);
}
.arc-toggle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
@media (prefers-color-scheme: dark) {
  .arc-toggle-btn {
    background: rgba(255,255,255,0.9);
    color: #222;
  }
  .arc-toggle-btn:hover {
    background: #fff;
  }
  .arc-toggle-btn[data-state="on"] {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.15);
  }
  .arc-toggle-btn[data-state="on"]:hover {
    background: rgba(255,255,255,0.18);
  }
}
.arc-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.arc-setting {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.arc-setting label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(0,0,0,0.5);
}
@media (prefers-color-scheme: dark) {
  .arc-setting label {
    color: rgba(255,255,255,0.5);
  }
}
.arc-setting .setting-val {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  color: rgba(0,0,0,0.75);
}
@media (prefers-color-scheme: dark) {
  .arc-setting .setting-val {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
  }
}
.arc-setting input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.12);
  outline: none;
  appearance: none;
  cursor: pointer;
}
.arc-setting input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: all 0.15s ease;
}
.arc-setting input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
@media (prefers-color-scheme: dark) {
  .arc-setting input[type="range"] {
    background: rgba(255,255,255,0.15);
  }
  .arc-setting input[type="range"]::-webkit-slider-thumb {
    background: rgba(255,255,255,0.85);
  }
}
.arc-setting.arc-checkbox label {
  flex-direction: row;
  gap: 8px;
  cursor: pointer;
}
.arc-setting.arc-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #222;
}
@media (prefers-color-scheme: dark) {
  .arc-setting.arc-checkbox input[type="checkbox"] {
    accent-color: #ddd;
  }
}
.arc-tips {
  padding: 10px 12px;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
}
.arc-tips p {
  margin: 0;
  font-size: 11px;
  color: rgba(0,0,0,0.5);
  line-height: 1.6;
}
.arc-tips p:not(:last-child) {
  margin-bottom: 4px;
}
@media (prefers-color-scheme: dark) {
  .arc-tips {
    background: rgba(255,255,255,0.04);
  }
  .arc-tips p {
    color: rgba(255,255,255,0.5);
  }
}
.gesture-error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 10001;
  animation: toast-in 0.3s ease-out;
  transition: opacity 0.3s ease;
  font-size: 13px;
  max-width: 90%;
}
#gesture-debug-canvas {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px;
}
@media (max-width: 768px) {
  .gesture-arc {
    top: auto;
    bottom: 20px;
    transform: none;
  }
  .gesture-arc.expanded {
    width: calc(100vw - 40px);
    max-width: 320px;
    border-radius: 20px 0 0 20px;
  }
  #gesture-debug-canvas {
    width: 180px !important;
    height: 135px !important;
    top: auto !important;
    bottom: 180px !important;
  }
}
.gesture-arc *:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
  border-radius: 4px;
}
@media print {
  .gesture-arc,
  .gesture-cursor,
  #gesture-debug-canvas,
  .gesture-error-toast {
    display: none !important;
  }
}
@-moz-keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 16px rgba(255,255,255,0.4);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 12px #fff, 0 0 24px rgba(255,255,255,0.6);
  }
}
@-webkit-keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 16px rgba(255,255,255,0.4);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 12px #fff, 0 0 24px rgba(255,255,255,0.6);
  }
}
@-o-keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 16px rgba(255,255,255,0.4);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 12px #fff, 0 0 24px rgba(255,255,255,0.6);
  }
}
@keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 16px rgba(255,255,255,0.4);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 12px #fff, 0 0 24px rgba(255,255,255,0.6);
  }
}
@-moz-keyframes countdown-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
@-webkit-keyframes countdown-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
@-o-keyframes countdown-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
@keyframes countdown-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
@-moz-keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@-webkit-keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@-o-keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
