* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.container {
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
}

/* ===== Card ===== */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.icon {
  font-size: 48px;
  margin-bottom: 12px;
}

h1 {
  font-size: 22px;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 28px;
}

/* ===== Form ===== */
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.input:focus {
  border-color: #1a73e8;
}

.btn {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-appearance: none;
}

.btn:active {
  background: #1557b0;
  transform: scale(0.98);
}

.btn:disabled {
  background: #a0c4f1;
  cursor: not-allowed;
}

.btn-full {
  margin-top: 12px;
}

/* ===== Result ===== */
.result {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  animation: fadeIn 0.3s;
}

.result.success {
  background: #e6f7ed;
  color: #0d7d3e;
}

.result.fail {
  background: #fdecea;
  color: #c5221f;
}

.result .result-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

.result .result-text {
  font-size: 16px;
  font-weight: 400;
  margin-top: 4px;
  color: #666;
}

/* ===== Loading ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 24px;
}

.admin-link {
  font-size: 12px;
  color: #bbb;
  text-decoration: none;
}

.admin-link:hover {
  color: #888;
}

/* ===== Admin ===== */
.hidden {
  display: none !important;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.panel-header h1 {
  margin-bottom: 0;
}

.btn-link {
  background: none;
  border: none;
  color: #999;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-link:hover {
  color: #666;
}

.section {
  text-align: left;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.section h2 {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
}

.count {
  font-size: 13px;
  color: #999;
  font-weight: 400;
}

.textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #333;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.textarea:focus {
  border-color: #1a73e8;
}

.error-msg {
  color: #c5221f;
  font-size: 14px;
  margin-top: 12px;
}

.result-msg {
  margin-top: 12px;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
}

.result-msg.success {
  background: #e6f7ed;
  color: #0d7d3e;
}

.result-msg.error {
  background: #fdecea;
  color: #c5221f;
}

.status-msg {
  text-align: center;
  color: #999;
  font-size: 14px;
  margin-top: 12px;
}

/* ===== Serial List ===== */
.serial-list {
  margin-top: 8px;
}

.serial-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.serial-item:last-child {
  border-bottom: none;
}

.serial-item .sn {
  font-size: 14px;
  color: #333;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  word-break: break-all;
}

.serial-item .del-btn {
  background: none;
  border: 1px solid #e0e0e0;
  color: #999;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 12px;
}

.serial-item .del-btn:active {
  background: #fdecea;
  border-color: #c5221f;
  color: #c5221f;
}
