/* ========================================
 * Superscript & Subscript Generator 页面样式
 * ======================================== */

/* ---------- 页面容器 ---------- */
.ss-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* ---------- 页面标题区 ---------- */
.page-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.page-header h1 {
  font-size: 32px;
  color: #212529;
  margin-bottom: 12px;
  font-weight: 600;
}

.page-header p {
  font-size: 15px;
  color: #6c757d;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- 工具包装器 ---------- */
.tool-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .tool-wrapper {
    grid-template-columns: 1fr;
  }
}

/* ---------- 面板样式 ---------- */
.panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.panel h2 {
  font-size: 18px;
  color: #212529;
  margin-bottom: 12px;
  font-weight: 600;
}

/* ---------- 语法提示 ---------- */
.syntax-hint {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 12px;
  font-style: italic;
}

.syntax-hint code {
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* ---------- 输入区域 ---------- */
.input-panel textarea {
  width: 100%;
  height: 200px;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  resize: vertical;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.input-panel textarea:focus {
  outline: none;
  border-color: #007bff;
}

.input-panel textarea::placeholder {
  color: #adb5bd;
}

.char-count {
  margin-top: 10px;
  font-size: 13px;
  color: #6c757d;
  text-align: right;
}

/* ---------- 输出区域 ---------- */
.output-preview {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  min-height: 200px;
  margin-bottom: 12px;
  word-break: break-all;
  white-space: pre-wrap;
}

.output-content {
  font-size: 16px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #212529;
  line-height: 1.6;
}

.output-content:empty::before {
  content: 'Your superscript/subscript text will appear here...';
  color: #adb5bd;
}

.output-actions {
  display: flex;
  gap: 10px;
}

/* ---------- 按钮样式 ---------- */
.btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #007bff;
  color: #ffffff;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-large {
  width: 100%;
  max-width: 400px;
  padding: 16px 32px;
  font-size: 16px;
}

/* ---------- 语法说明区 ---------- */
.syntax-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.syntax-section h2 {
  font-size: 20px;
  color: #212529;
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
}

.syntax-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .syntax-cards {
    grid-template-columns: 1fr;
  }
}

.syntax-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.syntax-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: #007bff;
  color: #ffffff;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 12px;
}

.syntax-card h3 {
  font-size: 16px;
  color: #212529;
  margin-bottom: 8px;
  font-weight: 600;
}

.syntax-card p {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 12px;
}

.syntax-card code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.syntax-example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.example-label {
  color: #6c757d;
  font-size: 12px;
}

.example-input {
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.example-arrow {
  color: #007bff;
  font-weight: bold;
}

.example-output {
  font-size: 16px;
}

/* ---------- 示例展示区 ---------- */
.examples-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.examples-section h2 {
  font-size: 20px;
  color: #212529;
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
}

.examples-category {
  margin-bottom: 20px;
}

.examples-category:last-child {
  margin-bottom: 0;
}

.examples-category h3 {
  font-size: 17px;
  color: #212529;
  margin-bottom: 12px;
  font-weight: 600;
  padding-left: 10px;
  border-left: 4px solid #007bff;
}

.examples-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.example-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.example-original {
  font-size: 15px;
  color: #495057;
  min-width: 160px;
  font-family: 'Courier New', monospace;
}

.example-arrow {
  font-size: 18px;
  color: #007bff;
  font-weight: bold;
}

.example-converted {
  font-size: 16px;
  color: #212529;
}

/* ---------- 知识科普区 ---------- */
.knowledge-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.knowledge-section h2 {
  font-size: 20px;
  color: #212529;
  margin-bottom: 16px;
  font-weight: 600;
}

.knowledge-section h3 {
  font-size: 17px;
  color: #212529;
  margin-bottom: 10px;
  margin-top: 20px;
  font-weight: 600;
}

.knowledge-section p {
  font-size: 15px;
  color: #6c757d;
  line-height: 1.7;
  margin-bottom: 12px;
}

.knowledge-section ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.knowledge-section ul li {
  list-style: disc;
  margin-bottom: 8px;
  font-size: 15px;
  color: #495057;
  line-height: 1.6;
}

.knowledge-section ul li strong {
  color: #212529;
}

/* ---------- 符号示例 ---------- */
.symbol-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.symbol-group {
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 18px;
}

/* ---------- 对比表格 ---------- */
.comparison-table {
  overflow-x: auto;
  margin-top: 12px;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.comparison-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #212529;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

/* ---------- 使用场景区 ---------- */
.use-cases-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.use-cases-section h2 {
  font-size: 20px;
  color: #212529;
  margin-bottom: 12px;
  font-weight: 600;
}

.use-cases-section p {
  font-size: 15px;
  color: #6c757d;
  margin-bottom: 16px;
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 576px) {
  .use-cases-grid {
    grid-template-columns: 1fr;
  }
}

.use-case-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 14px;
  color: #495057;
}

.use-case-icon {
  font-size: 20px;
}

/* ---------- 常见错误提示区 ---------- */
.tips-section {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.tips-section h2 {
  font-size: 20px;
  color: #856404;
  margin-bottom: 16px;
  font-weight: 600;
}

.tip-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  padding: 16px;
  border-radius: 8px;
}

.tip-icon {
  font-size: 24px;
}

.tip-content h3 {
  font-size: 15px;
  color: #212529;
  margin-bottom: 4px;
  font-weight: 600;
}

.tip-content p {
  font-size: 14px;
  color: #6c757d;
  margin: 0;
  line-height: 1.5;
}

.pro-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #e7f3ff;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.pro-tip-icon {
  font-size: 20px;
}

.pro-tip p {
  font-size: 14px;
  color: #495057;
  margin: 0;
  line-height: 1.6;
}

.pro-tip strong {
  color: #212529;
}

/* ---------- FAQ区 ---------- */
.faq-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.faq-section h2 {
  font-size: 20px;
  color: #212529;
  margin-bottom: 20px;
  font-weight: 600;
}

.faq-item {
  margin-bottom: 20px;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item h3 {
  font-size: 16px;
  color: #212529;
  margin-bottom: 8px;
  font-weight: 600;
}

.faq-item p {
  font-size: 15px;
  color: #6c757d;
  line-height: 1.6;
  margin: 0;
}

.faq-item code {
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* ---------- 支持平台区 ---------- */
.platforms-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.platforms-section h2 {
  font-size: 20px;
  color: #212529;
  margin-bottom: 16px;
  font-weight: 600;
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .platforms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .platforms-grid {
    grid-template-columns: 1fr;
  }
}

.platform-item {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  color: #495057;
  font-weight: 500;
}

/* ---------- 安全提示区 ---------- */
.security-section {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.security-icon {
  font-size: 32px;
}

.security-content h3 {
  font-size: 16px;
  color: #155724;
  margin-bottom: 4px;
  font-weight: 600;
}

.security-content p {
  font-size: 14px;
  color: #155724;
  line-height: 1.5;
  margin: 0;
}

/* ---------- 底部补充段落 ---------- */
.bottom-section {
  text-align: center;
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.bottom-section p {
  font-size: 15px;
  color: #6c757d;
  line-height: 1.6;
  margin: 0;
}

/* ---------- CTA区 ---------- */
.cta-section {
  text-align: center;
  margin-bottom: 32px;
}

/* ---------- 复制成功动画 ---------- */
.copy-success {
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* ---------- Toast样式 ---------- */
#common-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #212529;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

#common-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---------- 响应式调整 ---------- */
@media (max-width: 576px) {
  .ss-container {
    padding: 10px;
  }
  
  .panel {
    padding: 15px;
  }
  
  .output-preview {
    min-height: 150px;
  }
  
  .input-panel textarea {
    height: 150px;
  }
  
  .comparison-table {
    font-size: 13px;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 8px;
  }
}