* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Chiswick", "Book Antiqua", serif;
  font-size: 16px;
  line-height: 1.5;
  color: #2c3e50;
  background: linear-gradient(180deg, #f4f8fc 0%, #e9f1f8 100%);
}

a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #2c3e50;
}

img {
  max-width: 100%;
  height: auto;
}

.page-shell,
.periodic-shell {
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #f4f8fc 0%, #e9f1f8 100%);
}

.page-shell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.periodic-card,
.login-card,
.content-box {
  background: #ffffff;
  border: 1px solid #d8e1ea;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.10);
}

.page-title {
  font-size: 2.0em;
  color: #2c3e50;
  text-align: center;
  margin: 10px 0 14px;
  font-weight: bold;
  font-family: Georgia, "Chiswick", "Book Antiqua", serif;
  line-height: 1.2;
}

.page-subtitle {
  text-align: center;
  color: #5a6a7a;
  margin-bottom: 18px;
  font-family: Georgia, "Chiswick", "Book Antiqua", serif;
}

.page-subtitle a {
  color: #3498db;
  text-decoration: none;
}

.page-subtitle a:hover {
  color: #2c3e50;
}

.content-box {
  max-width: 980px;
  margin: 22px auto 0;
  padding: 22px 24px;
  color: #2c3e50;
  line-height: 1.6;
}

.step-intro {
  font-size: 1.08em;
  margin: 0 0 18px;
}

.step-intro strong {
  color: #3498db;
}

.footer-link {
  margin: 26px 0 8px;
  text-align: center;
}

.footer-link a {
  display: inline-block;
  padding: 12px 20px;
  background: #3498db;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.footer-link a:hover {
  background: #2c3e50;
  transform: translateY(-1px);
}

.periodic-card {
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 32px 34px 28px;
}

.periodic-title {
  text-align: center;
  margin: 0 0 12px;
  font-size: 1.9em;
  color: #2c3e50;
  font-family: Georgia, "Chiswick", "Book Antiqua", serif;
}

.periodic-lead {
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.6;
}

.periodic-divider {
  border: 0;
  border-top: 8px solid #dfe8f1;
  width: 50%;
  margin: 18px auto 22px;
}

.fill-status {
  margin: 10px 0 14px;
  text-align: center;
  font-weight: bold;
  color: #2c3e50;
}

.periodic-table-wrap {
  overflow-x: auto;
  margin: 18px 0 16px;
}

.periodic-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #d8e1ea;
  border-radius: 12px;
  overflow: hidden;
}

.periodic-table td {
  border: 1px solid #e6edf4;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  height: 58px;
  background: #fff;
}

.periodic-table td.empty {
  background: #f8fbfe;
}

.periodic-table button.elem {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px 4px;
  color: #2c3e50;
  font-family: Georgia, serif;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  position: relative;
  text-align: center;
  line-height: 1.05;
  white-space: nowrap;
}

.periodic-table button.elem sub {
  font-size: 0.72em;
  line-height: 1;
  position: relative;
  bottom: 0.3em;
  left: 0.95em;
}

.periodic-table button.elem b {
  display: block;
  line-height: 1;
}

.periodic-table button.elem:hover {
  background: #eaf4ff;
  transform: translateY(-1px);
}

.periodic-table button.elem.selected-first {
  background: #d9ecff;
  box-shadow: inset 0 0 0 2px #2b7cff;
}

.periodic-table button.elem.selected-second {
  background: #fff1c9;
  box-shadow: inset 0 0 0 2px #d49a00;
}

.form-block {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #d8e1ea;
  border-radius: 12px;
  background: #f8fbfe;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.form-label {
  min-width: 260px;
  color: #2c3e50;
}

.form-row input[type="text"],
.form-row input[type="password"] {
  width: 100%;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid #b9c7d6;
  border-radius: 10px;
  background: #ffffff;
  text-align: center;
  font-size: 1em;
  font-family: Georgia, serif;
  color: #2c3e50;
}

.form-row input[type="text"]:focus,
.form-row input[type="password"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.14);
}

.form-row input[type="submit"] {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #3498db;
  color: #fff;
  font-family: Georgia, serif;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}

.form-row input[type="submit"]:hover {
  background: #2c3e50;
  transform: translateY(-1px);
}

.login-card {
  width: 100%;
  max-width: 560px;
  padding: 30px 30px 26px;
  margin: 0 auto;
}

.login-title {
  text-align: center;
  margin: 0 0 10px;
  font-size: 1.7em;
  color: #2c3e50;
  font-family: Georgia, "Chiswick", "Book Antiqua", serif;
}

.login-subtitle {
  text-align: center;
  margin: 0 0 18px;
  color: #5a6a7a;
  line-height: 1.5;
}

.login-subtitle a {
  color: #3498db;
  text-decoration: none;
}

.login-subtitle a:hover {
  color: #2c3e50;
}

.login-divider {
  border: 0;
  border-top: 8px solid #dfe8f1;
  width: 50%;
  margin: 18px auto 22px;
}

.login-panel {
  max-width: 420px;
  margin: 0 auto;
}

.login-panel h3 {
  text-align: center;
  margin: 0 0 18px;
  font-size: 1.15em;
  color: #2c3e50;
}

.login-form table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.login-form td {
  padding: 8px 6px;
  vertical-align: middle;
}

.login-form td:first-child {
  width: 120px;
  font-weight: bold;
  color: #2c3e50;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #b9c7d6;
  border-radius: 10px;
  background: #fbfcfe;
  color: #1f2d3a;
  outline: none;
  font-size: 1em;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.login-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.login-actions input[type="submit"],
.login-actions input[type="reset"] {
  min-width: 132px;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #3498db;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.20);
}

.login-actions input[type="reset"] {
  background: #6c7a89;
  box-shadow: 0 8px 20px rgba(108, 122, 137, 0.18);
}

.login-actions input[type="submit"]:hover {
  background: #2c3e50;
  transform: translateY(-1px);
}

.login-actions input[type="reset"]:hover {
  background: #56616f;
  transform: translateY(-1px);
}

.login-note {
  margin-top: 16px;
  font-size: 0.95em;
  color: #5a6a7a;
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .periodic-card,
  .login-card,
  .content-box {
    padding: 22px 18px;
  }

  .form-label {
    min-width: 100%;
    text-align: center;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row input[type="text"],
  .form-row input[type="password"],
  .form-row input[type="submit"] {
    width: 100%;
    max-width: 320px;
  }

  .login-actions input[type="submit"],
  .login-actions input[type="reset"] {
    width: 100%;
    max-width: 320px;
  }
}