:root {
  --primary: #2563eb;
  --accent: #16a34a;
  --bg1: #f8fafc;
  --bg2: #eef2ff;
  --radius: 12px;
  --border: #e5e7eb;
  --text: #111827;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

main {
  flex: 1;
  max-width: 700px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2rem;
  margin: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

main:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

aside {
  width: 300px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin: 1rem;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  line-height: 1.7;
}

aside .logo img {
  width: min(80vw, 140px);
  height: auto;
}

h1 {
  color: var(--primary);
  margin-bottom: 1rem;
  text-align: center;
}

h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  text-align: left;
}

label {
  display: block;
  font-weight: 600;
  margin: 0.5rem 0;
}

.time-inputs {
  display: flex;
  gap: 0.5rem;
}

input[type="number"] {
  flex: 1;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 1rem;
  text-align: center;
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.2);
  transition: all 0.2s ease;
}

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

.tools {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  justify-content: center;
}

.result {
  background: #f9fafb;
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-top: 1rem;
  font-family: monospace;
  border: 1px solid #e2e8f0;
  line-height: 1.6;
  white-space: normal; /* 改为 normal，因为我们现在用 HTML 换行 */
  overflow-x: auto;
}

textarea {
  width: 100%;
  height: 70px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 0.5rem;
  font-family: monospace;
  margin-top: 0.5rem;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

ul {
  padding-left: 1.2rem;
}

ul li {
  margin: 0.3rem 0;
}

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

a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  aside {
    width: 100%;
    order: 2;
  }
  main {
    order: 1;
  }
}

  .table-wrapper {display: flex; flex-wrap: wrap; justify-content: center; gap: 30px;}
  table {border-collapse: collapse; width: 46px; box-shadow: 0 3px 8px rgba(0,0,0,0.1); background: #fff;}
  th, td {border: 1px solid #ddd; padding: 8px 10px; text-align: center;}
  th {background-color: #f2f2f2; font-weight: 600;}
  tr:nth-child(even) {background-color: #fafafa;}
  caption {font-weight: 600; margin-bottom: 5px;}