/* WzSLinker Options Page - 抖音风格主题 */

/* 抖音风格色彩变量 */
:root {
  /* 抖音品牌色 */
  --douyin-pink: #FE2C55;
  --douyin-pink-light: #FF4D6D;
  --douyin-pink-dark: #E01E45;
  
  /* 抖音辅助色 */
  --douyin-cyan: #00F5FF;
  --douyin-cyan-light: #33F7FF;
  
  /* 黑白灰系统 */
  --douyin-black: #161823;
  --douyin-gray-dark: #2F3542;
  --douyin-gray: #8A8A8E;
  --douyin-gray-light: #C7C7CC;
  --douyin-white: #FFFFFF;
  --douyin-bg: #F7F8FA;
  
  /* 功能色 */
  --color-success: #00D68F;
  --color-warning: #FFBB33;
  --color-danger: #FF4757;
  --color-info: #4A90E2;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  margin: 0;
  padding: 12px;
  background: linear-gradient(135deg, var(--douyin-black) 0%, var(--douyin-gray-dark) 100%);
  color: var(--douyin-black);
  line-height: 1.4;
  font-size: 13px;
}

.main-opt {
  max-width: 750px;
  margin: 0 auto;
  background: var(--douyin-white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 14px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 标题 ========== */
h1 {
  text-align: center;
  margin: 0 0 12px 0;
  font-size: 22px;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--douyin-bg);
  background: linear-gradient(135deg, var(--douyin-pink), var(--douyin-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== 状态消息 ========== */
.message {
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.info {
  background: var(--douyin-bg);
  color: var(--douyin-gray);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.message.error {
  background: rgba(255, 71, 87, 0.1);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.message.success {
  background: rgba(0, 214, 143, 0.1);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

/* ========== 设置容器 ========== */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ========== 区域样式 ========== */
.section {
  background: var(--douyin-white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--douyin-pink), var(--douyin-cyan));
}

.section h2 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--douyin-black);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--douyin-bg);
}

/* ========== 界面设置 ========== */
.interface-settings-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: var(--douyin-bg);
  padding: 10px;
  border-radius: 6px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.setting-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--douyin-gray);
  text-align: center;
  margin: 0;
}

.setting-group input[type="color"] {
  width: 50px;
  height: 32px;
  padding: 0;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  cursor: pointer;
  background: none;
  transition: all 0.2s;
}

.setting-group input[type="color"]:hover {
  border-color: var(--douyin-pink);
  transform: scale(1.05);
}

.setting-group select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  font-size: 11px;
  background: var(--douyin-white);
  color: var(--douyin-black);
  cursor: pointer;
}

/* ========== 开关样式 ========== */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--douyin-gray-light);
  transition: 0.3s;
  border-radius: 22px;
}

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

input:checked + .slider {
  background: linear-gradient(135deg, var(--douyin-pink), var(--douyin-pink-light));
}

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

/* ========== 样式预览 ========== */
.style-preview {
  margin-top: 10px;
  padding: 10px;
  background: var(--douyin-bg);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.style-preview label {
  font-size: 11px;
  font-weight: 600;
  color: var(--douyin-gray);
  margin-bottom: 6px;
  display: block;
}

.preview-text {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.preview-stock {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.preview-stock.normal {
  background-color: var(--preview-highlight-color, #fff3cd);
  color: var(--preview-text-color, #ff0000);
}

.preview-stock.glow {
  background-color: var(--preview-highlight-color, #fff3cd);
  color: var(--preview-text-color, #ff0000);
  box-shadow: 0 0 10px var(--preview-text-color, #ff0000);
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px var(--preview-text-color, #ff0000); }
  50% { box-shadow: 0 0 18px var(--preview-text-color, #ff0000); }
}

.preview-stock.none {
  background-color: transparent;
  color: var(--preview-text-color, #ff0000);
  text-decoration: underline;
}

/* ========== 数据管理 ========== */
.data-management-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.data-management-row button {
  flex: 1;
  max-width: 200px;
}

/* ========== 高级设置 ========== */
.advanced-settings-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}

.service-config-group {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.service-config-group .setting-group {
  align-items: flex-start;
}

.service-config-group .setting-group label {
  align-self: flex-start;
  text-align: left;
  margin-bottom: 4px;
}

.service-config-group input,
.service-config-group select {
  width: 100%;
  box-sizing: border-box;
}

.advanced-settings-row button {
  height: 32px;
  padding: 0 16px;
  white-space: nowrap;
}

/* ========== 提示文本 ========== */
.hint {
  font-size: 10px;
  color: var(--douyin-gray);
  font-style: italic;
  margin-top: 3px;
  display: block;
}

.reset-section {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* ========== 输入框 ========== */
input[type="text"],
input[type="file"],
select {
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  font-size: 12px;
  background: var(--douyin-white);
  color: var(--douyin-black);
  transition: all 0.2s;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--douyin-pink);
  box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.1);
}

input[type="text"]::placeholder {
  color: var(--douyin-gray);
}

/* ========== 按钮 ========== */
button {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: white;
}

button:not(.danger) {
  background: linear-gradient(135deg, var(--douyin-pink), var(--douyin-pink-light));
  box-shadow: 0 2px 8px rgba(254, 44, 85, 0.3);
}

button:not(.danger):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.4);
}

button.danger {
  background: var(--color-danger);
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

button.danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

/* ========== 按钮组 ========== */
.button-group {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--douyin-bg);
}

.button-group button {
  padding: 10px 30px;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--douyin-pink), var(--douyin-cyan));
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.3);
}

.button-group button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(254, 44, 85, 0.4);
}

/* ========== 工具类 ========== */
.hidden {
  display: none !important;
}

/* ========== 响应式 ========== */
@media (max-width: 800px) {
  .main-opt {
    max-width: 600px;
    padding: 12px;
  }
  
  .interface-settings-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .service-config-group {
    grid-template-columns: 1fr;
  }
  
  .advanced-settings-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .advanced-settings-row button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  body {
    padding: 8px;
  }
  
  .main-opt {
    padding: 10px;
  }
  
  h1 {
    font-size: 18px;
    margin-bottom: 10px;
  }
  
  .interface-settings-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .section {
    padding: 8px;
  }
  
  .data-management-row {
    flex-direction: column;
  }
  
  .data-management-row button {
    max-width: none;
  }
}
