:root {
  --primary: #3498db;
  --secondary: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --dark: #2c3e50;
  --light: #ecf0f1;
  --background: #f1f2f3;
  --card-bg: #ffffff;
  --border: #d1d8e0;
}

* {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
}

.container {
  box-sizing: border-box;
  max-width: 1560px;
  min-width: 1240px;
  margin: 25px auto;
}

.container *{
  box-sizing: border-box;
}

header {
  text-align: center;
  margin-bottom: 25px;
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

header p {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
}

.matrix{
  display: grid;
  grid-template-columns:repeat(2,1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.matrix-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.matrix-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: var(--dark);
}

.matrix-input {
  width: 100%;
  min-height: 300px;
  padding: 15px;
  font-family: monospace;
  font-size: 1rem;
  line-height: 1.5;
  border: 2px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  transition: border-color 0.3s;
}

.matrix-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.operations {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 25px;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-group-title {
  background: var(--dark);
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
}

.btn {
  padding: 12px 15px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
}

.btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-operation {
  background: var(--secondary);
}

.btn-operation:hover {
  background: #27ae60;
}

.btn-utility {
  background: var(--warning);
}

.btn-utility:hover {
  background: #e67e22;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #c0392b;
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.input-group button {
  width: auto;
}

.result-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 25px;
}

.result-section h2 {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: var(--dark);
}

.result-output {
  width: 100%;
  min-height: 240px;
  max-height: 960px;
  padding: 15px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: monospace;
  font-size: 1.1rem;
  line-height: 1.8;
  white-space: pre;
  overflow: auto;
}

.instructions {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.instructions-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.instructions-column h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.instructions-column ul {
  padding-left: 25px;
}

.instructions-column li {
  margin-top: 10px;
  line-height: 1.6;
}

.notice {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 15px 30px;
  border-radius: 8px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.notice.show {
  opacity: 1;
}

footer {
  text-align: center;
  color: #7f8c8d;
  font-size: 0.9rem;
}

.matrix-example {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  margin: 15px 0;
  font-family: monospace;
  font-size: 1.1rem;
}

.operation-example {
  background: #e8f4fc;
  padding: 12px;
  border-radius: 6px;
  margin: 5px 0;
  font-size: 0.95rem;
}

.error {
  color: var(--danger);
  font-weight: bold;
}
