@charset "utf-8";
/* CSS Document */
/* styles.css */

/* 基础布局与配色 */
/* =====================
   Global Styles
===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f9fafc;
  color: #333;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 {
  color: #222;
}

/* =====================
   Header
===================== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: #ffffff;
  border-bottom: 1px solid #e1e4e8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo h1 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.logo p {
  font-size: 0.9rem;
  color: #555;
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-select img {
  width: 24px;
  height: 16px;
  border: 1px solid #ccc;
  border-radius: 2px;
}

select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* =====================
   Layout
===================== */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 30px;
  flex-grow: 1;
}

.input-section, .results {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-top: 10px;
  margin-bottom: 15px;
  resize: vertical;
}

/* =====================
   Controls & Buttons
===================== */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
  align-items: center;
}

.btn-group, .result-actions {
  display: flex;
  gap: 10px;
}

button {
  cursor: pointer;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: #007bff;
  color: #fff;
}
.btn-primary:hover { background: #0069d9; }

.btn-secondary {
  background: #6c757d;
  color: #fff;
}
.btn-secondary:hover { background: #5a6268; }

.btn-success {
  background: #28a745;
  color: #fff;
}
.btn-success:hover { background: #218838; }

.btn-danger {
  background: #dc3545;
  color: #fff;
}
.btn-danger:hover { background: #c82333; }

/* =====================
   Results Section
===================== */
.results h2 {
  margin-bottom: 15px;
}

.result-section {
  margin-bottom: 20px;
}

/* =====================
   Footer
===================== */
footer {
  background: #f1f3f5;
  text-align: center;
  padding: 12px 20px;
  font-size: 0.85rem;
  color: #555;
  border-top: 1px solid #e1e4e8;
}

/* =====================
   Responsive
===================== */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Language Switcher Styles */
.lang-switcher {
  position: absolute;
  top: 10px;
  right: 20px;
  cursor: pointer;
  z-index: 999;
}

.lang-icon {
  width: 40px;
  height: 25px;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 5px;
  object-fit: cover;
}

.lang-menu {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.lang-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lang-menu li {
  padding: 10px;
}

.lang-menu li a {
  text-decoration: none;
  color: #333;
  display: block;
}

.lang-menu li a:hover {
  background-color: #f1f1f1;
  color: #007bff;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .lang-switcher {
    top: 15px;
    right: 15px;
  }

  .lang-menu {
    top: 35px;
    right: 0;
  }
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 5px;
}

.flag-icon {
  width: 24px;    /* 小方形国旗宽 */
  height: 16px;   /* 小方形国旗高 */
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid #ccc;
}
