* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #ff4757;
  --primary-light: #ff6b81;
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #252525;
  --text: #e8e8e8;
  --text-muted: #888;
  --border: #333;
  --warning: #ffa502;
  --danger: #ff4757;
  --success: #2ed573;
  --tag-danger: rgba(255, 71, 87, 0.15);
  --tag-warning: rgba(255, 165, 2, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #ff8a5c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.platform-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.tab:hover {
  border-color: var(--primary-light);
  color: var(--text);
}

.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.editor-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

textarea {
  width: 100%;
  min-height: 200px;
  padding: 1.2rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  resize: vertical;
  font-family: inherit;
}

textarea:focus {
  outline: none;
}

textarea::placeholder {
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

#char-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-primary, .btn-secondary {
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  font-weight: 500;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.3s ease;
}

.results.hidden {
  display: none;
}

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

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.results-summary {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

.results-summary.safe {
  background: rgba(46, 213, 115, 0.15);
  color: var(--success);
}

.results-summary.warning {
  background: var(--tag-warning);
  color: var(--warning);
}

.results-summary.danger {
  background: var(--tag-danger);
  color: var(--danger);
}

.highlighted-content {
  padding: 1rem;
  background: var(--surface-2);
  border-radius: 8px;
  line-height: 2;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.highlighted-content mark {
  background: var(--tag-danger);
  color: var(--danger);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  border-bottom: 2px solid var(--danger);
  font-weight: 500;
}

.highlighted-content mark.warning {
  background: var(--tag-warning);
  color: var(--warning);
  border-bottom-color: var(--warning);
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.word-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.word-tag.danger {
  background: var(--tag-danger);
  color: var(--danger);
}

.word-tag.warning {
  background: var(--tag-warning);
  color: var(--warning);
}

.word-tag .count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.info-section {
  margin-top: 3rem;
}

.info-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.faq-grid {
  display: grid;
  gap: 1rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
}

.faq-item h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.faq-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

footer {
  text-align: center;
  padding-top: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer a {
  color: var(--primary-light);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .container {
    padding: 1.5rem 1rem;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .tab {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  textarea {
    min-height: 150px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
