/* ==============================
   亚创创目录 - 工具栏页面样式
   ============================== */

.tools-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 18px 26px;
}

/* 页面头部 */
.tools-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.tools-title {
  font-size: 20px;
  font-weight: 700;
  color: #202534;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.tools-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.tools-license-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.tools-license-badge.valid {
  background: rgba(16, 185, 129, 0.14);
  color: #0f8f5d;
  border: 1px solid rgba(16, 185, 129, 0.26);
}

.tools-license-badge.invalid {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.tools-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.tools-license-badge.valid .tools-badge-dot {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34,197,94,0.5);
}

.tools-license-badge.invalid .tools-badge-dot {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239,68,68,0.5);
}

/* 工具卡片网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-card-body,
  .tool-card-features,
  .tool-card-usage-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* 工具卡片 */
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(228, 196, 148, 0.5);
  border-radius: 20px;
  padding: 18px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 38px rgba(49, 38, 24, 0.08);
  backdrop-filter: blur(10px);
}

.tool-card[data-tool-id="amazon_bulk"] {
  grid-column: 1 / -1;
  min-height: 100%;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: auto -18px -24px auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 170, 59, 0.2), transparent 72%);
  opacity: 1;
  transition: transform 0.3s ease;
}

.tool-card:hover {
  box-shadow: 0 24px 52px rgba(49, 38, 24, 0.12);
  border-color: rgba(239, 123, 0, 0.35);
  transform: translateY(-3px);
}

.tool-card:hover::before {
  transform: scale(1.08);
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.tool-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #171b25 0%, #232a39 56%, #3a2d1f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd28a;
  flex-shrink: 0;
  box-shadow: 0 12px 24px rgba(23, 27, 37, 0.22);
}

.tool-card-icon svg {
  width: 18px;
  height: 18px;
}

.tool-card-meta {
  flex: 1;
  min-width: 0;
}

.tool-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #202534;
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.tool-card-version {
  display: inline-flex;
  width: fit-content;
  font-size: 11px;
  color: #6d4f2d;
  background: rgba(255, 244, 225, 0.86);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(229, 196, 142, 0.4);
}

.tool-card-desc {
  font-size: 12px;
  color: #5a6475;
  line-height: 1.65;
  margin: 0;
  max-width: 860px;
}

/* 标签 */
.tool-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.tool-tag {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 244, 225, 0.9);
  color: #8a4b0f;
  border: 1px solid rgba(254, 215, 170, 0.9);
  font-weight: 600;
}

/* 功能列表 */
.tool-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tool-card-features li {
  font-size: 12px;
  color: #465063;
  padding: 12px 12px 12px 32px;
  position: relative;
  line-height: 1.6;
  border-radius: 14px;
  border: 1px solid rgba(228, 196, 148, 0.36);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 247, 237, 0.92));
  box-shadow: 0 10px 24px rgba(170, 126, 68, 0.06);
}

.tool-card-features li::before {
  content: '✓';
  position: absolute;
  left: 12px;
  top: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ade80, #16a34a);
}

.tool-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.84fr);
  gap: 18px;
  align-items: stretch;
}

.tool-card-main,
.tool-card-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tool-card-side {
  min-width: 0;
}

.tool-card-section-title {
  font-size: 11px;
  font-weight: 800;
  color: #75532f;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tool-card-usage {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(228, 196, 148, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(255, 248, 239, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 30px rgba(170, 126, 68, 0.06);
}

.tool-card-usage-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-card-usage-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(228, 196, 148, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 243, 0.92));
  box-shadow: 0 10px 22px rgba(170, 126, 68, 0.06);
  color: #4f5a6d;
  font-size: 12px;
  line-height: 1.55;
}

.tool-usage-num {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ffb24b, #ef7b00);
  box-shadow: 0 8px 16px rgba(239, 123, 0, 0.18);
  margin-top: 1px;
}

/* 安装说明 */
.tool-card-install {
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.88), rgba(255, 252, 247, 0.94));
  border: 1px solid rgba(228, 196, 148, 0.48);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 0;
  box-shadow: 0 16px 34px rgba(170, 126, 68, 0.08);
}

.install-switcher {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-switcher-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.install-switcher-tab {
  border: 1px solid rgba(224, 181, 113, 0.55);
  background: rgba(255, 255, 255, 0.82);
  color: #8a5a22;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.install-switcher-tab-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.install-switcher-tab svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.install-switcher-tab:hover {
  border-color: rgba(239, 123, 0, 0.55);
  color: #7a4200;
}

.install-switcher-tab.active {
  background: linear-gradient(135deg, #ffb24b, #ef7b00);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px rgba(239, 123, 0, 0.2);
}

.install-switcher-panels {
  min-height: 0;
}

.install-switcher-panel {
  display: none;
}

.install-switcher-panel.active {
  display: block;
}

/* 安装步骤列表 */
.tool-card-install-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: none;
}

.tool-card-install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: #4f5a6d;
  line-height: 1.55;
  padding: 2px 0;
  min-width: 0;
}

.tool-card-install-steps .step-num {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9e2c, #ef7b00);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 1px;
}

/* ============ 下载后安装引导弹窗 ============ */
.install-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: igFadeIn 0.2s ease;
}

@keyframes igFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.install-guide-modal {
  background: linear-gradient(180deg, #fff8ee 0%, #ffffff 100%);
  border-radius: 24px;
  width: 480px;
  max-width: 92vw;
  padding: 28px 28px 22px;
  box-shadow: 0 26px 80px rgba(20, 20, 30, 0.24);
  border: 1px solid rgba(228, 196, 148, 0.45);
  animation: igSlideUp 0.25s ease;
}

@keyframes igSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.install-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.install-guide-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #202534;
}

.install-guide-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.install-guide-close:hover {
  color: #374151;
}

.install-guide-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
}

.install-guide-steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  border-bottom: 1px solid #f3f4f6;
}

.install-guide-steps li:last-child {
  border-bottom: none;
}

.install-switcher--guide {
  gap: 14px;
  margin-bottom: 18px;
}

.install-switcher--guide .install-switcher-tabs {
  gap: 10px;
}

.install-switcher--guide .install-switcher-tab {
  padding: 10px 14px;
  font-size: 13px;
}

.install-switcher--guide .install-switcher-tab svg {
  width: 15px;
  height: 15px;
}

.guide-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9900, #ff7700);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.install-guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 244, 225, 0.82);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 12px;
  color: #8a4b0f;
  line-height: 1.5;
  margin-bottom: 18px;
}

.install-guide-tip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.install-guide-ok {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff9e2c, #ef7b00);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.install-guide-ok:hover {
  background: linear-gradient(135deg, #f09520, #da7000);
}

/* 下载按钮 */
.tool-card-actions {
  display: flex;
  justify-content: stretch;
  align-items: end;
  margin-top: auto;
}

.tool-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  background: linear-gradient(135deg, #ff9e2c, #ef7b00);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 14px 28px rgba(239, 123, 0, 0.26);
}

.tool-download-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #f09520, #da7000);
  box-shadow: 0 18px 32px rgba(239, 123, 0, 0.32);
  transform: translateY(-1px);
}

.tool-download-btn:active:not(:disabled) {
  transform: translateY(0);
}

.tool-download-btn:disabled,
.tool-download-btn.disabled {
  background: rgba(203, 213, 225, 0.92);
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.tool-download-btn svg {
  width: 14px;
  height: 14px;
}

/* 空状态 */
.tools-empty {
  text-align: center;
  padding: 42px 20px;
  color: #7c8298;
}

.tools-empty-icon svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.tools-empty p {
  font-size: 14px;
  margin: 0;
}

/* 导航徽章 */
.nav-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #ff9900;
  color: #000;
  font-weight: 600;
  margin-left: auto;
  line-height: 1.4;
}

[data-theme="dark"] .tool-card {
  background: linear-gradient(135deg, rgba(28, 36, 49, 0.94), rgba(20, 27, 39, 0.98));
  border-color: rgba(96, 114, 138, 0.42);
  box-shadow: 0 20px 44px rgba(8, 12, 20, 0.35);
}

[data-theme="dark"] .tool-card-name,
[data-theme="dark"] .install-guide-header h3 {
  color: #f8fafc;
}

[data-theme="dark"] .tool-card-desc,
[data-theme="dark"] .tool-card-features li,
[data-theme="dark"] .tool-card-usage-list li,
[data-theme="dark"] .tool-card-install-steps li,
[data-theme="dark"] .tools-empty {
  color: #94a3b8;
}

[data-theme="dark"] .tool-card-version,
[data-theme="dark"] .tool-tag,
[data-theme="dark"] .tool-card-install,
[data-theme="dark"] .tool-card-usage {
  background: rgba(43, 55, 74, 0.86);
  border-color: rgba(96, 114, 138, 0.42);
  color: #f7d6a0;
}

[data-theme="dark"] .tool-card-section-title {
  color: #f7d6a0;
}

[data-theme="dark"] .tool-card-features li {
  border-color: rgba(96, 114, 138, 0.34);
  background: linear-gradient(180deg, rgba(32, 43, 60, 0.94), rgba(26, 35, 49, 0.9));
  box-shadow: 0 12px 24px rgba(8, 12, 20, 0.18);
}

[data-theme="dark"] .tool-card-usage-list li {
  border-color: rgba(96, 114, 138, 0.36);
  background: linear-gradient(180deg, rgba(32, 43, 60, 0.94), rgba(26, 35, 49, 0.9));
  box-shadow: 0 12px 24px rgba(8, 12, 20, 0.24);
}

[data-theme="dark"] .install-switcher-tab {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(96, 114, 138, 0.42);
  color: #d8b98c;
}

[data-theme="dark"] .install-switcher-tab:hover {
  border-color: rgba(255, 173, 74, 0.58);
  color: #ffd79a;
}

[data-theme="dark"] .install-switcher-tab.active {
  background: linear-gradient(135deg, #ffad4a, #ef7b00);
  color: #fff;
}

@media (max-width: 640px) {
  .tool-card {
    padding: 14px;
  }

  .tool-card[data-tool-id="amazon_bulk"] {
    grid-column: auto;
  }

  .tool-card-features,
  .tool-card-body {
    grid-template-columns: 1fr;
  }

  .tool-card-usage-list {
    grid-template-columns: 1fr;
  }

  .tool-download-btn {
    width: 100%;
    justify-content: center;
  }

  .tool-card-actions {
    justify-content: stretch;
  }

  .install-switcher-tabs {
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] .install-guide-modal {
  background: linear-gradient(180deg, #1a2231 0%, #111827 100%);
  border-color: rgba(96, 114, 138, 0.45);
}

[data-theme="dark"] .install-guide-steps li {
  color: #cbd5e1;
  border-bottom-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .install-guide-tip {
  background: rgba(69, 52, 28, 0.46);
  border-color: rgba(245, 158, 11, 0.24);
  color: #f6d8a7;
}

[data-theme="dark"] .tool-download-btn:disabled,
[data-theme="dark"] .tool-download-btn.disabled {
  background: rgba(71, 85, 105, 0.9);
  color: #94a3b8;
}
