
/* ========== Text Encrypt Tool Page ========== */
:root {
  --te-bg: #1e1e2e;
  --te-bg-card: #181825;
  --te-bg-surface: #313244;
  --te-text: #cdd6f4;
  --te-text-muted: #6c7086;
  --te-heading: #cdd6f4;
  --te-border: #313244;
  --te-primary: #89b4fa;
  --te-accent: #a6e3a1;
  --te-warn: #f9e2af;
  --te-error: #f38ba8;
  --te-mauve: #cba6f7;
  --te-peach: #fab387;
  --te-teal: #94e2d5;
  --te-sky: #89dceb;
  --te-rosewater: #f5e0dc;
  --te-green: #a6e3a1;
  --te-red: #f38ba8;
  --te-blue: #89b4fa;
  --te-yellow: #f9e2af;
  --te-maroon: #eba0ac;
  --te-pink: #f5c2e7;
  --te-flamingo: #f2cdcd;
  --te-mantle: #181825;
  --te-crust: #11111b;
  --te-overlay0: #6c7086;
  --te-overlay1: #7f849c;
  --te-overlay2: #9399b2;
  --te-subtext0: #a6adc8;
  --te-subtext1: #bac2de;
  --te-surface0: #313244;
  --te-surface1: #45475a;
  --te-surface2: #585b70;
}

.tool-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.tool-header {
  text-align: center;
  margin-bottom: 24px;
}

.tool-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--te-heading);
  margin-bottom: 8px;
}

.tool-header .tool-desc {
  font-size: 16px;
  color: var(--te-text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Toolbar */
.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--te-bg-card);
  border-radius: 12px;
  border: 1px solid var(--te-border);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tool-btn-primary {
  background: var(--te-primary);
  color: #1e1e2e;
}

.tool-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.tool-btn-secondary {
  background: var(--te-accent);
  color: #1e1e2e;
}

.tool-btn-secondary:hover {
  filter: brightness(1.1);
}

.tool-btn-outline {
  background: transparent;
  color: var(--te-text);
  border: 1px solid var(--te-border);
}

.tool-btn-outline:hover {
  background: var(--te-surface0);
  border-color: var(--te-primary);
}

.tool-btn-danger {
  background: var(--te-error);
  color: #1e1e2e;
}

.tool-btn-danger:hover {
  filter: brightness(1.1);
}

.tool-btn-purple {
  background: var(--te-mauve);
  color: #1e1e2e;
}

.tool-btn-purple:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.tool-btn-teal {
  background: var(--te-teal);
  color: #1e1e2e;
}

.tool-btn-teal:hover {
  filter: brightness(1.1);
}

.tool-btn-peach {
  background: var(--te-peach);
  color: #1e1e2e;
}

.tool-btn-peach:hover {
  filter: brightness(1.1);
}

.tool-btn.active-mode {
  outline: 3px solid var(--te-primary);
  outline-offset: 2px;
}

/* Input area */
.tool-input-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.editor-panel {
  background: var(--te-bg-card);
  border: 1px solid var(--te-border);
  border-radius: 12px;
  overflow: hidden;
}

.editor-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--te-surface0);
  border-bottom: 1px solid var(--te-border);
}

.editor-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--te-heading);
}

.editor-panel-header .panel-actions {
  display: flex;
  gap: 8px;
}

.panel-btn {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--te-border);
  border-radius: 6px;
  background: var(--te-bg);
  color: var(--te-text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.panel-btn:hover {
  background: var(--te-surface1);
  border-color: var(--te-primary);
}

.editor-panel textarea {
  width: 100%;
  height: 200px;
  padding: 16px;
  border: none;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  background: var(--te-bg);
  color: var(--te-text);
  box-sizing: border-box;
}

.editor-panel textarea:focus {
  outline: none;
}

.editor-panel textarea::placeholder {
  color: var(--te-overlay0);
}

/* Stats bar */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
  background: var(--te-bg-card);
  border-radius: 8px;
  border: 1px solid var(--te-border);
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--te-text);
  align-items: center;
}

.stats-bar .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-bar .stat-label {
  color: var(--te-text-muted);
}

.stats-bar .stat-value {
  font-weight: 600;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  color: var(--te-primary);
}

/* Section card */
.section-card {
  background: var(--te-bg-card);
  border: 1px solid var(--te-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.section-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--te-heading);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card h3 .badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--te-surface0);
  color: var(--te-text-muted);
}

/* Multi-algorithm table */
.alg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.alg-table th,
.alg-table td {
  padding: 8px 12px;
  border: 1px solid var(--te-border);
  text-align: left;
  color: var(--te-text);
}

.alg-table th {
  background: var(--te-surface0);
  font-weight: 600;
  color: var(--te-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alg-table td {
  background: var(--te-bg);
  word-break: break-all;
}

.alg-table .alg-name {
  font-weight: 600;
  color: var(--te-primary);
  white-space: nowrap;
}

.alg-table .alg-hash {
  font-size: 12px;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alg-table .alg-time {
  color: var(--te-text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.alg-table .alg-actions {
  display: flex;
  gap: 4px;
}

.alg-table .alg-actions button {
  padding: 3px 8px;
  font-size: 11px;
  border: 1px solid var(--te-border);
  border-radius: 4px;
  background: var(--te-surface0);
  color: var(--te-text);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.alg-table .alg-actions button:hover {
  background: var(--te-surface1);
  border-color: var(--te-primary);
}

/* Form controls */
.tool-select {
  padding: 8px 12px;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--te-bg);
  color: var(--te-text);
  cursor: pointer;
}

.tool-select:focus {
  outline: none;
  border-color: var(--te-primary);
}

.tool-input {
  padding: 8px 12px;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--te-bg);
  color: var(--te-text);
  width: 100%;
  box-sizing: border-box;
}

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

.tool-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--te-text-muted);
  margin-bottom: 4px;
}

/* Options bar */
.options-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--te-bg-card);
  border-radius: 8px;
  border: 1px solid var(--te-border);
}

.option-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--te-text);
  cursor: pointer;
  user-select: none;
}

.option-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--te-primary);
  cursor: pointer;
}

/* File upload zone */
.file-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 24px;
  background: var(--te-bg-card);
  border: 2px dashed var(--te-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 150px;
}

.file-upload-zone:hover {
  border-color: var(--te-primary);
  background: var(--te-surface0);
}

.file-upload-zone.dragover {
  border-color: var(--te-primary);
  background: var(--te-surface0);
}

.file-upload-zone .upload-icon {
  font-size: 40px;
  color: var(--te-primary);
  opacity: 0.6;
}

.file-upload-zone .upload-text {
  font-size: 15px;
  color: var(--te-text);
}

.file-upload-zone .upload-text span {
  color: var(--te-primary);
  font-weight: 600;
}

.file-upload-zone .upload-hint {
  font-size: 13px;
  color: var(--te-text-muted);
}

.file-upload-zone input[type="file"] {
  display: none;
}

/* Status box */
.status-box {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  display: none;
  line-height: 1.5;
}

.status-box.show {
  display: block;
}

.status-success {
  background: var(--te-surface0);
  border: 1px solid var(--te-accent);
  color: var(--te-accent);
}

.status-error {
  background: var(--te-surface0);
  border: 1px solid var(--te-error);
  color: var(--te-error);
}

.status-info {
  background: var(--te-surface0);
  border: 1px solid var(--te-primary);
  color: var(--te-primary);
}

/* Grid for form rows */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.form-row .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--te-text-muted);
  margin-bottom: 4px;
}

.form-row .form-group input,
.form-row .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--te-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--te-bg);
  color: var(--te-text);
  box-sizing: border-box;
}

.form-row .form-group input:focus,
.form-row .form-group select:focus {
  outline: none;
  border-color: var(--te-primary);
}

/* Result display */
.result-display {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--te-bg);
  border: 1px solid var(--te-border);
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  color: var(--te-accent);
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.result-display.show {
  display: block;
}

/* Canvas */
.vis-canvas {
  width: 100%;
  max-width: 800px;
  height: 200px;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: var(--te-bg);
  margin-top: 8px;
}

/* Compare result */
.compare-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.compare-result.match {
  background: var(--te-surface0);
  color: var(--te-accent);
  border: 1px solid var(--te-accent);
}

.compare-result.nomatch {
  background: var(--te-surface0);
  color: var(--te-error);
  border: 1px solid var(--te-error);
}

/* History */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--te-bg);
  border: 1px solid var(--te-border);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  color: var(--te-text);
  cursor: pointer;
  transition: all 0.15s;
}

.history-item:hover {
  border-color: var(--te-primary);
}

.history-item .history-alg {
  color: var(--te-primary);
  font-weight: 600;
  margin-right: 8px;
  white-space: nowrap;
}

.history-item .history-hash {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 12px;
}

.history-item .history-time {
  color: var(--te-text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Slider */
.tool-slider {
  width: 100%;
  accent-color: var(--te-primary);
}

.slider-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--te-primary);
  min-width: 24px;
  text-align: center;
}

/* Batch table */
.batch-table-wrap {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--te-border);
  border-radius: 8px;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.batch-table th,
.batch-table td {
  padding: 6px 10px;
  border: 1px solid var(--te-border);
  text-align: left;
  color: var(--te-text);
}

.batch-table th {
  background: var(--te-surface0);
  font-weight: 600;
  color: var(--te-heading);
  position: sticky;
  top: 0;
}

.batch-table td {
  word-break: break-all;
}

/* Performance chart */
.perf-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.perf-bar-label {
  width: 80px;
  font-size: 12px;
  font-weight: 600;
  color: var(--te-primary);
  text-align: right;
  flex-shrink: 0;
}

.perf-bar-track {
  flex: 1;
  height: 20px;
  background: var(--te-surface0);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.perf-bar-fill {
  height: 100%;
  background: var(--te-primary);
  border-radius: 4px;
  transition: width 0.3s;
  min-width: 2px;
}

.perf-bar-ms {
  font-size: 11px;
  color: var(--te-text-muted);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

/* Info section */
.tool-info {
  margin-top: 32px;
  padding: 24px;
  background: var(--te-bg-card);
  border-radius: 12px;
  border: 1px solid var(--te-border);
}

.tool-info h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--te-heading);
  margin-bottom: 16px;
}

.tool-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--te-heading);
  margin: 20px 0 12px;
}

.tool-info p {
  font-size: 15px;
  color: var(--te-text);
  line-height: 1.8;
  margin-bottom: 12px;
}

.tool-info ul {
  margin: 0 0 16px 24px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--te-text);
}

.tool-info li {
  margin-bottom: 6px;
}

.tool-info code {
  background: var(--te-surface0);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  color: var(--te-peach);
}

.tool-info .info-tip {
  padding: 12px 16px;
  background: var(--te-surface0);
  border-radius: 8px;
  color: var(--te-primary);
  margin-top: 16px;
  border: 1px solid var(--te-border);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  background: var(--te-surface0);
  color: var(--te-text);
  border: 1px solid var(--te-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tabs */
.section-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--te-surface0);
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--te-text-muted);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.section-tab:hover {
  color: var(--te-text);
  background: var(--te-surface1);
}

.section-tab.active {
  background: var(--te-bg);
  color: var(--te-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 900px) {
  .tool-input-area {
    grid-template-columns: 1fr;
  }

  .alg-table .alg-hash {
    max-width: 200px;
  }
}

@media (max-width: 600px) {
  .tool-container {
    padding: 16px;
  }

  .tool-header h1 {
    font-size: 24px;
  }

  .tool-toolbar {
    padding: 12px;
    gap: 8px;
  }

  .tool-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .editor-panel textarea {
    height: 150px;
  }

  .stats-bar {
    gap: 10px;
    font-size: 13px;
  }

  .form-row .form-group {
    min-width: 100%;
  }

  .alg-table {
    font-size: 12px;
  }

  .alg-table th,
  .alg-table td {
    padding: 6px 8px;
  }

  .section-tab {
    padding: 6px 12px;
    font-size: 12px;
  }
}
