/* modules/diy-settings/style.css */
/* DIY 自定义窗样式 */

.diy-window {
  background: var(--bg-panel, #fff);
  border-radius: var(--r-md, 8px);
  box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,0.15));
  font-family: var(--font-family, system-ui);
}

.diy-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.diy-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.diy-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.diy-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  transition: all var(--dur-fast, 150ms);
}

.diy-tab:hover {
  background: var(--bg-hover, #f3f4f6);
}

.diy-tab.active {
  color: var(--c-accent, #2563eb);
  border-bottom: 2px solid var(--c-accent, #2563eb);
  margin-bottom: -1px;
}

.diy-content {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.diy-section {
  margin-bottom: 20px;
}

.diy-section label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary, #111827);
}

.diy-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diy-color-row input[type="color"] {
  width: 40px;
  height: 32px;
  border: none;
  border-radius: var(--r-sm, 4px);
  cursor: pointer;
}

.diy-color-row span {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.diy-section select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--r-sm, 4px);
  background: var(--bg-input, #fff);
  font-size: 14px;
}

.diy-section input[type="range"] {
  width: calc(100% - 50px);
  vertical-align: middle;
}

.diy-section span {
  display: inline-block;
  width: 45px;
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
}

/* 模组列表 */
.diy-module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--r-sm, 4px);
  margin-bottom: 8px;
}

.diy-module-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.diy-module-icon {
  font-size: 20px;
}

.diy-module-name {
  font-size: 14px;
  font-weight: 500;
}

.diy-module-desc {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
}

.diy-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary, #6b7280);
}

/* 复用 settings-panel 的 toggle-switch 样式 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: var(--dur-fast, 150ms);
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: var(--dur-fast, 150ms);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--c-accent, #2563eb);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* ===== 可下载模组区 (09-07) ===== */
.diy-dl-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  margin: 18px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.diy-dl-btn {
  padding: 6px 16px;
  border: 1px solid var(--c-accent, #2563eb);
  border-radius: var(--r-sm, 4px);
  background: var(--c-accent, #2563eb);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: opacity var(--dur-fast, 150ms);
  white-space: nowrap;
}

.diy-dl-btn:hover {
  opacity: 0.85;
}

.diy-dl-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.diy-dl-done {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  white-space: nowrap;
}

.diy-module-ver {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary, #6b7280);
}
