/* 工具页现代化样式 - 与首页/下载页/文档页保持一致 */
:root {
  --primary-color: #0066ff;
  --secondary-color: #00d4ff;
  --accent-color: #ff6b35;
  --dark-bg: #1a1a2e;
  --light-bg: #f8f9fa;
  --text-dark: #2c3e50;
  --text-light: #6c757d;
  --border-color: #e9ecef;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* { box-sizing: border-box; }

body {
  font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--light-bg);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* 导航栏选中效果 */
.header .nav li a:hover,
.header .nav li a.active {
  color: #ffffff !important;
  background-color: #428BCA !important;
}

.hline {
  height: 1px;
  background: var(--border-color);
  margin: 0;
}

/* 工具页主容器 */
.tools-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* 覆盖 opener.css 中 .tools-api 的样式 */
.tools-api.tools-container {
  background: transparent;
  min-height: auto;
  margin: 0 auto;
}

/* 页面标题区 */
.tools-hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 50px 0;
  text-align: center;
  border-bottom: 1px solid #e9ecef;
}

.tools-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.tools-hero p {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* 现代化 Tab 导航 */
.tools-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 30px;
}

.tools-tabs .tab-btn {
  flex: 1;
  padding: 16px 20px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-light);
  background: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  position: relative;
}

.tools-tabs .tab-btn:hover {
  color: var(--primary-color);
  background: #f0f4ff;
}

.tools-tabs .tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: #f0f4ff;
  font-weight: 600;
}

.tools-tabs .tab-btn + .tab-btn {
  border-left: 1px solid var(--border-color);
}

/* Tab 内容面板 */
.tools-panel {
  display: none;
}

.tools-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* 应用选择卡片 */
.app-selector-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 24px 28px;
  margin-bottom: 24px;
}

/* 覆盖 opener.css 中 .app-list 的限制性样式 — 不再使用 app-list class */

.app-selector-card .selector-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  min-height: 36px;
}

.app-selector-card .selector-row:last-child {
  margin-bottom: 0;
}

.app-selector-card .selector-label {
  font-weight: 600;
  color: var(--text-dark);
  min-width: 120px;
  font-size: 14px;
  flex-shrink: 0;
}

.app-selector-card select.form-control {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.6;
  height: 42px;
  transition: border-color 0.3s ease;
  width: 200px;
  background: #fff;
}

.app-selector-card select.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.app-selector-card .yktApps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.app-selector-card .yktApps .item {
  background: linear-gradient(135deg, #e8f0fe 0%, #f0f4ff 100%);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.app-selector-card .client-id {
  font-family: 'Courier New', monospace;
  background: var(--light-bg);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--primary-color);
}

.app-selector-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.app-selector-card a:hover {
  text-decoration: underline;
}

/* 服务项图标 - 使用 opener.css 的 icons.png 精灵图 */
.app-selector-card .item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 12px;
  color: var(--primary-color);
  font-style: normal;
  font-size: 13px;
  line-height: 24px;
}

.app-selector-card .item s {
  background: url(/assets/images/icons.png) no-repeat 0 0;
  display: inline-block;
  width: 16px;
  height: 16px;
  overflow: hidden;
  margin-right: 3px;
  vertical-align: middle;
}

.app-selector-card .upyk s { background-position: 0 -180px; }
.app-selector-card .zjmv s { background-position: -38px -181px; }
.app-selector-card .mvrss s { background-position: -77px -181px; }
.app-selector-card .mstyle s { background-position: -116px -180px; }
.app-selector-card .mad s { background-position: -157px -181px; }
.app-selector-card .bfq s { background-position: -197px -180px; }
.app-selector-card .qys s { background-position: -238px -180px; }
.app-selector-card .contr s { background-position: -279px -180px; }
.app-selector-card .scret s { background-position: -316px -180px; }
.app-selector-card .share s { background-position: -352px -180px; }
.app-selector-card .zzzb s { background-position: -390px -180px; }
.app-selector-card .seo s { background-position: -429px -180px; }
.app-selector-card #item_amzply { background: url(/assets/images/icons2.png) no-repeat -29px -192px; }

/* 播放器代码 - 主区域 */
.player-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* 参数面板 */
.param-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.param-section {
  border-bottom: 1px solid var(--border-color);
}

.param-section:last-child {
  border-bottom: none;
}

.param-section-header {
  padding: 16px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
  user-select: none;
}

.param-section-header:hover {
  background: #f8fafc;
}

.param-section-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.param-section-header .toggle-icon {
  font-size: 12px;
  color: var(--text-light);
  transition: transform 0.3s ease;
}

.param-section.open .toggle-icon {
  transform: rotate(180deg);
}

.param-section-body {
  padding: 0 24px 20px;
}

.param-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  margin: 0;
}

.param-item:last-child {
  border-bottom: none;
}

.param-item dt,
.param-item label {
  font-weight: 500;
  color: var(--text-dark);
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  margin: 0;
  float: none;
}

.param-item dt label {
  min-width: auto;
  margin: 0;
}

.param-item label input[type="checkbox"] {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

.param-item dd,
.param-item .param-desc {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.param-item dd a,
.param-item .param-desc a {
  color: var(--primary-color);
  text-decoration: none;
}

.param-item dd a:hover,
.param-item .param-desc a:hover {
  text-decoration: underline;
}

.lib {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  padding: 10px 0;
  cursor: pointer;
}

.lib input[type="checkbox"] {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

.libDec {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.7;
  padding: 8px 0;
}

.libDec a {
  color: var(--primary-color);
  text-decoration: none;
}

.libDec .red, .red {
  color: #dc3545;
  font-style: normal;
}

/* 代码预览区 */
.code-preview {
  background: #1e293b;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.code-preview-header {
  background: #0f172a;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-preview-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.code-preview-header .dot-red { background: #ff5f57; }
.code-preview-header .dot-yellow { background: #febc2e; }
.code-preview-header .dot-green { background: #28c840; }

.code-preview-header span.title {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-left: 8px;
}

.code-preview .green {
  color: #94a3b8;
  font-size: 12px;
  padding: 12px 20px;
  line-height: 1.6;
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-preview .green .red {
  color: #f87171;
}

.code-show {
  padding: 20px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: #e2e8f0;
  overflow-x: auto;
}

.code-show p {
  margin: 0;
  white-space: nowrap;
}

.code-show .tint {
  padding-left: 20px;
}

.code-show .c0 { color: #f472b6; }
.code-show .c1 { color: #fbbf24; }
.code-show .c2 { color: #34d399; }

.code-show .hide { display: none; }

/* 回调/API 代码示例 */
.callback {
  margin-bottom: 16px;
}

.callback strong {
  display: block;
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.callback ul {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px 20px;
  list-style: none;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.8;
  margin: 0;
}

/* 上传工具面板 */
.upload-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 30px;
  text-align: center;
}

.upload-panel iframe {
  border: none;
  border-radius: 8px;
  width: 100%;
  max-width: 700px;
  height: 700px;
}

/* Token 面板 */
.token-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.token-tip {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 18px 22px;
  color: #166534;
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 24px;
}

.token-tip a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
}

.token-tip a:hover {
  text-decoration: underline;
}

.token-fields dl {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  margin: 0;
}

.token-fields dl:last-child {
  border-bottom: none;
}

.token-fields dt {
  font-weight: 600;
  color: var(--text-dark);
  min-width: 140px;
  font-size: 14px;
}

.token-fields dd {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.token-fields input {
  flex: 1;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--light-bg);
  color: var(--text-dark);
  transition: border-color 0.3s ease;
}

.token-fields input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.token-fields .copyBtn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.token-fields .copyBtn:hover {
  background: #0052cc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.token-fields #expires_in {
  color: var(--text-light);
  font-size: 14px;
}

/* 成功模态框 */
.modal .modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal .modal-body {
  padding: 24px;
}

.btn-modern {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-modern.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-modern.btn-primary:hover {
  background: #0052cc;
  transform: translateY(-1px);
}

.btn-modern.btn-secondary {
  background: #fff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-modern.btn-secondary:hover {
  background: var(--primary-color);
  color: #fff;
}

/* 现代化页脚 */
.modern-footer {
  background: var(--dark-bg);
  color: white;
  padding: 40px 0;
  margin-top: 0;
}

.modern-footer .footer-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.modern-footer .footer-bottom {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.modern-footer .footer-bottom p {
  margin-bottom: 8px;
  font-size: 14px;
}

.modern-footer .footer-bottom a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.modern-footer .footer-bottom a:hover {
  color: white;
}

/* 隐藏原始页脚 */
.footer {
  display: none;
}

/* 响应式 */
@media (max-width: 768px) {
  .player-main {
    grid-template-columns: 1fr;
  }

  .code-preview {
    position: static;
  }

  .tools-tabs {
    flex-direction: column;
  }

  .tools-tabs .tab-btn + .tab-btn {
    border-left: none;
    border-top: 1px solid var(--border-color);
  }

  .tools-hero h1 {
    font-size: 1.6rem;
  }

  .app-selector-card .selector-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .token-fields dl {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .token-fields dd {
    width: 100%;
  }
}
