:root {
  --primary-color: #5B8DEE;
  --bg-color: #F5F7FA;
  --card-bg: #FFFFFF;
  --text-primary: #2C3E50;
  --text-secondary: #7F8C8D;
  --border-color: #E1E8ED;
  --success-color: #27AE60;
  --warning-color: #F39C12;
  --danger-color: #E74C3C;
  --info-color: #3498DB;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px;
}

.header {
  text-align: center;
  margin-bottom: 20px;
  padding: 15px 10px;
  position: relative;
}

.lang-switch {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  background: white;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.lang-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.lang-btn:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--primary-color);
  color: white;
}

.header h1 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 600;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card h2 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 600;
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s ease;
  line-height: 1.6;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.file-info {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg-color);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  display: none;
}

.file-info.show {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.stat-item {
  text-align: center;
  padding: 14px 12px;
  background: var(--bg-color);
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.actions-section {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--primary-color);
  color: white;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary {
  background: var(--text-secondary);
}

.btn-success {
  background: var(--success-color);
}

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

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

.btn-info {
  background: var(--info-color);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h2 {
  margin-bottom: 0;
}

#historyList {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-color);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.history-item:hover {
  background: #E8EDF2;
  transform: translateX(4px);
}

.history-info {
  flex: 1;
}

.history-title {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}

.history-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.history-preview {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.btn-delete,
.btn-load {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete {
  background: var(--danger-color);
  color: white;
}

.btn-delete:hover {
  background: #C0392B;
}

.btn-load {
  background: var(--info-color);
  color: white;
}

.btn-load:hover {
  background: #2980B9;
}

.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-overlay p {
  color: white;
  margin-top: 16px;
  font-size: 16px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  background: var(--success-color);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  z-index: 1001;
  pointer-events: none;
  max-width: 300px;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notification.error {
  background: var(--danger-color);
}

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

.notification.info {
  background: var(--info-color);
}

.footer {
  margin-top: 40px;
  padding: 30px 0 20px;
  background: linear-gradient(to bottom, transparent, var(--bg-color));
  border-top: 1px solid var(--border-color);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.footer-section {
  margin-bottom: 30px;
}

.footer-section h3 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-section p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.feature-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.feature-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  position: relative;
  padding-left: 16px;
}

.feature-list li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-color);
}

.reviews {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.review-item {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid var(--primary-color);
  margin: 0;
}

.review-item p {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-style: italic;
}

.review-item cite {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: normal;
}

.faq-list {
  margin: 0;
}

.faq-list dt {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
}

.faq-list dt:first-child {
  margin-top: 0;
}

.faq-list dd {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 0;
  margin-bottom: 8px;
  line-height: 1.6;
}

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0;
}

.copyright {
  font-size: 12px;
}
