/* 组件外层容器 */
.progress-bar-component-wrapper {
  margin-bottom: 20px;
  border: 1px solid var(--border-primary, #e5e7eb);
  border-radius: var(--border-radius, 8px);
  padding: 15px;
  background-color: var(--bg-card, #fff);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

/* 外层标题样式 */
.progress-bar-component-wrapper .widget-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--caption-color, #1e293b);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--theme-color, #147b96);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.widget-title-text {
  flex: 1;
}

/* 二维码触发器 */
.qrcode-trigger {
  position: relative;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--theme-color, #147b96);
  border-radius: 4px;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.qrcode-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(20, 123, 150, 0.3);
}

.qrcode-icon {
  color: #fff;
  width: 16px;
  height: 16px;
  display: block;
}

/* 二维码弹窗 */
.qrcode-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e5e7eb);
  border-radius: var(--border-radius, 8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.qrcode-popup img {
  width: 150px;
  height: 150px;
  display: block;
}

.qrcode-trigger:hover .qrcode-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 组件内容区域 */
.progress-bar-component {
  border: 1px solid var(--border-secondary, #f1f5f9);
  border-radius: var(--border-radius-sm, 6px);
  padding: 15px;
  background-color: var(--bg-secondary, #f8fafc);
}

/* 标题渐变文字动画 */
.progress-bar-component .masked {
  text-align: center;
  background-image: -webkit-linear-gradient(
    left,
    #147b96,
    #e6d205 25%,
    #147b96 50%,
    #e6d205 75%,
    #147b96
  );
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  -webkit-background-size: 200% 100%;
  -webkit-animation: masked-animation 4s infinite linear;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

@-webkit-keyframes masked-animation {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* 进度条容器 */
.progress-bar-component .progress-container {
  padding-bottom: 1px;
}

.progress-bar-component .progress {
  overflow: hidden;
  background-color: var(--bg-hover, #f5f5f5);
  border-radius: var(--border-radius-sm, 4px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  margin: 10px;
}

/* 进度条 */
.progress-bar-component .progress-bar {
  float: left;
  height: 100%;
  font-size: 12px;
  line-height: 20px;
  color: #fff;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transition: width 0.6s ease;
}

/* 条纹效果 */
.progress-bar-component .progress-bar-striped {
  background-image: -webkit-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  -webkit-background-size: 40px 40px;
  background-size: 40px 40px;
}

/* 动画效果 */
.progress-bar-component .progress-bar-animated {
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  0% {
    background-position: 40px 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* 更新日志折叠面板 */
.changelog-section {
  margin-top: 15px;
  border: 1px solid var(--border-secondary, #f1f5f9);
  border-radius: var(--border-radius-sm, 6px);
  overflow: hidden;
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: var(--bg-secondary, #f8fafc);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.changelog-header:hover {
  background-color: var(--bg-hover, #f1f5f9);
}

.changelog-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--caption-color, #1e293b);
}

.changelog-toggle {
  font-size: 12px;
  color: var(--text-secondary, #475569);
  transition: transform 0.3s ease;
}

.changelog-section.expanded .changelog-toggle {
  transform: rotate(180deg);
}

.changelog-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background-color: var(--bg-card, #fff);
}

.changelog-section.expanded .changelog-content {
  max-height: 500px;
  border-top: 1px solid var(--border-secondary, #f1f5f9);
}

.changelog-text {
  padding: 15px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-content, #334155);
  white-space: pre-wrap;
  font-family: inherit;
}

/* 深色模式适配 */
html[data-theme="dark"] .progress-bar-component-wrapper {
  border-color: var(--border-primary, #3a3a3a);
  background-color: var(--bg-card, #2a2a2a);
}

html[data-theme="dark"] .progress-bar-component-wrapper .widget-title {
  color: var(--caption-color, #e8e8e8);
}

html[data-theme="dark"] .qrcode-popup {
  background: var(--bg-card, #2a2a2a);
  border-color: var(--border-primary, #3a3a3a);
}

html[data-theme="dark"] .qrcode-trigger {
  background: var(--theme-color, #147b96);
}

html[data-theme="dark"] .progress-bar-component {
  border-color: var(--border-secondary, #2a2a2a);
  background-color: var(--bg-body, #16161a);
}

html[data-theme="dark"] .progress-bar-component .progress {
  background-color: var(--bg-hover, #3a3a3a);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .changelog-header {
  border-color: var(--border-primary, #3a3a3a);
}

html[data-theme="dark"] .changelog-content {
  background-color: var(--bg-secondary, #222222);
  border-color: var(--border-secondary, #2a2a2a);
}

html[data-theme="dark"] .changelog-text {
  color: var(--text-content, #c0c0c0);
}
