* {
  margin: 0;
  padding: 0;
}

body {
  background: #f1f2f3;
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1560px;
  min-width: 1240px;
  margin: 25px auto;
  color: #333;
}

.container * {
  box-sizing: border-box;
}

header {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

header h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
}

header p {
  font-size: 16px;
  opacity: 0.85;
}

.calculator {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
  padding: 20px;
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

.input-section {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.input-group {
  flex: 1;
  min-width: 300px;
}

.container label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-container {
  display: flex;
  gap: 10px;
}

.container input[type="text"] {
  flex: 1;
  padding: 14px;
  border: 2px solid #dce1e6;
  border-radius: 8px;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.container input[type="text"]:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.container select {
  width: 120px;
  padding: 14px 10px;
  border: 2px solid #dce1e6;
  border-radius: 8px;
  font-size: 1.05rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s;
}

select:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.operator-group {
  display: flex;
  flex-direction: column;
  width: 190px;
  text-align: center;
}
.operator-group select{
  width: 100%;
}
.button-group {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

button {
  padding: 14px 64px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.calculate-btn {
  background: linear-gradient(to right, #3498db, #2980b9);
  color: white;
  box-shadow: 0 4px 6px rgba(52, 152, 219, 0.3);
}

.copy-btn {
  background: linear-gradient(to right, #2ecc71, #27ae60);
  color: white;
  box-shadow: 0 4px 6px rgba(46, 204, 113, 0.3);
}

.clear-btn {
  background: linear-gradient(to right, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 4px 6px rgba(231, 76, 60, 0.3);
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(-1px);
}

.result-section {

}

.result-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.result-title {
  font-size: 1.3rem;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.binary-representation {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  line-height: 2;
  overflow-x: auto;
  border: 1px solid #e9ecef;
}

.bit-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  gap: 10px;
}

.yunsuan{
  flex-direction: row;
  align-items: center;
  margin-top: 25px;
}


.bit-row:last-child{
  margin-bottom: 0;
}

.bit-label {
  font-weight: bold;
  color: #495057;
  font-size: 1.1rem;
}

.bit-value {
  flex: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bit {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #e9ecef;
  font-weight: bold;
  transition: all 0.3s;
  font-size: 1.1rem;
}

.bit.active {
  background: linear-gradient(to bottom, #3498db, #2980b9);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.operator {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 6px;
  color: #e74c3c;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.result-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
  transition: all 0.3s;
}

.result-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.result-card h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3498db;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: #27ae60;
  margin: 15px 0;
  word-break: break-all;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #27ae60;
}

.copy-icon {
  cursor: pointer;
  margin-left: 10px;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.copy-icon:hover {
  color: #3498db;
  transform: scale(1.1);
}

.info-section {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
  padding: 20px;
  margin-bottom: 25px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.info-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s;
}

.info-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.info-card h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3498db;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card ul {
  padding-left: 25px;
}

.info-card li{
  margin-top: 12px;
  position: relative;
}

.info-card li:before {
  content: "•";
  color: #3498db;
  font-weight: bold;
  position: absolute;
  left: -20px;
  top: 0;
}

.notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 15px 35px;
  border-radius: 10px;
  font-size: 1.1rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

footer {
  text-align: center;
  color: #6c757d;
}

.bit-explanation {
  margin-top: 20px;
  padding: 15px 20px;
  background: #f0f7ff;
  border-radius: 10px;
  border-left: 4px solid #3498db;
  font-size: 1.05rem;
}

.input-hint {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 5px;
  font-style: italic;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: 'Courier New', monospace;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.result-table th {
  background: linear-gradient(to right, #3498db, #2980b9);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: bold;
}

.result-table td {
  padding: 12px 15px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.result-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.result-table tr:hover {
  background-color: #e9f7fe;
}

.base-name {
  font-weight: bold;
  color: #2c3e50;
}

.expression-cell {
  font-weight: bold;
  color: #27ae60;
}
