/* 全局样式 */
:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --background: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

h1 {
  text-align: center;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.description {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 选项卡样式 - 优化桌面显示 */
.tabs {
  margin-bottom: 2rem;
}

.tab-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem; /* 增大字体大小 */
  color: var(--text-secondary);
  position: relative;
  transition: all 0.2s ease;
  border-radius: var(--radius) var(--radius) 0 0;
  flex: 1; /* 让按钮平均分配空间 */
  max-width: 200px; /* 设置最大宽度 */
}

@media (min-width: 768px) {
  .tab-btn {
    padding: 1rem 1.5rem; /* 在桌面端增加内边距 */
    font-size: 1.125rem; /* 在桌面端增大字体 */
  }
}

.tab-btn:hover {
  color: var(--primary);
  background-color: rgba(59, 130, 246, 0.05);
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px; /* 增加高度使其更明显 */
  background-color: var(--primary);
}

.tab-content {
  padding: 0.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* 上传区域样式 */
.upload-area {
  margin-bottom: 1.5rem;
}

.upload-box {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: rgba(226, 232, 240, 0.3);
}

.upload-box:hover {
  border-color: var(--primary);
  background-color: rgba(59, 130, 246, 0.05);
}

.upload-box p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.file-select-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-select-btn:hover {
  background-color: var(--primary-hover);
}

/* 密码输入区域 */
.password-input {
  margin-bottom: 1.5rem;
}

.password-input label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

.password-input input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.password-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 检测按钮 */
.check-btn {
  display: block;
  width: 100%;
  padding: 0.875rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.check-btn:hover {
  background-color: var(--primary-hover);
}

.check-btn:disabled {
  background-color: var(--border-hover);
  cursor: not-allowed;
}

/* 结果区域 */
.result-area {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  animation: fadeIn 0.3s ease;
}

.result-area h3 {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
}

.loading {
  text-align: center;
  padding: 1rem;
  color: var(--text-secondary);
}

/* 描述文件检测结果样式 */
.permissions-section {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.permissions-preview {
  color: var(--text-secondary);
}

.permissions-count {
  color: var(--text-secondary);
  margin-left: 0.25rem;
  font-size: 0.875rem;
}

.show-all-permissions,
.show-all-devices {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.75rem;
  margin-left: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.show-all-permissions:hover,
.show-all-devices:hover {
  background: var(--border);
  color: var(--text);
}

.permissions-full,
.devices-full {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(226, 232, 240, 0.3);
  border-radius: var(--radius);
}

.permission-item,
.device-item {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border);
  font-size: 0.875rem;
}

.permission-item:last-child,
.device-item:last-child {
  border-bottom: none;
}

/* 设备列表样式 */
.devices-section {
  margin: 1.25rem 0;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.device-count-box {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius);
  padding: 0.25rem 0.75rem;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.device-id {
  font-family: monospace;
  color: var(--text-secondary);
  background: rgba(226, 232, 240, 0.5);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

/* 结果区域的通用样式优化 */
.result-item p {
  margin: 0.75rem 0;
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-item strong {
  color: var(--text);
  min-width: 120px;
  font-weight: 500;
  font-size: 0.875rem;
}

.error-message {
  padding: 1rem;
  background-color: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius);
  border-left: 3px solid var(--error);
}

.error-message h3 {
  color: var(--error);
  margin-bottom: 0.5rem;
}

/* 页脚 */
footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* 悬浮按钮样式 */
.floating-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 1.5rem;
}

.floating-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.floating-button i {
  font-size: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    margin: 1rem;
    padding: 1.5rem;
    border-radius: var(--radius);
  }

  h1 {
    font-size: 1.5rem;
  }

  .description {
    font-size: 0.875rem;
  }

  .tab-btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  .upload-box {
    padding: 1.5rem 1rem;
  }

  .result-item p {
    flex-direction: column;
    gap: 0.25rem;
  }

  .result-item strong {
    min-width: auto;
  }

  .floating-button {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 0.5rem;
    padding: 1.25rem;
  }

  .tab-header {
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.625rem 0.5rem;
    font-size: 0.75rem;
  }

  .tab-btn.active::after {
    display: none;
  }

  .tab-btn.active {
    background-color: rgba(59, 130, 246, 0.1);
    border-bottom: 2px solid var(--primary);
  }

  .upload-box {
    padding: 1.25rem 0.75rem;
  }

  .file-select-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .check-btn {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .show-all-permissions,
  .show-all-devices {
    margin-top: 0.5rem;
    margin-left: 0;
  }

  .device-count-box {
    display: block;
    margin-bottom: 0.5rem;
  }
}

