@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

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

body {
  font-family: 'Roboto', sans-serif;
  background: #fafafa;
  color: #212121;
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.1);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  padding: 16px 24px;
  text-align: center;
  color: white;
  position: relative;
}

.logo-icon {
  margin-bottom: 8px;
  display: inline-block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

h1 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 2px;
}

.subtitle {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 300;
}

.content {
  padding: 32px 24px;
}

/* 步骤指示器 - Material Stepper */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  padding: 20px 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item:not(.active):not(.completed) {
  opacity: 0.38;
}

.step-circle {
  width: 120px;
  height: 60px;
  border-radius: 14px;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 26px;
  color: #757575;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.step-item.active .step-circle {
  background: #1976d2;
  color: white;
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
}

.step-item.completed .step-circle {
  background: #4caf50;
  color: white;
}

.step-item span {
  font-size: 14px;
  font-weight: 500;
  color: #757575;
  letter-spacing: 0.5px;
}

.step-item.active span {
  color: #1976d2;
}

.step-item.completed span {
  color: #4caf50;
}

.step-line {
  width: 60px;
  height: 4px;
  background: #e0e0e0;
  margin: 0 10px;
  margin-bottom: 30px;
  transition: background 0.3s;
}

.step-line.completed {
  background: #4caf50;
}

/* 步骤面板 */
.step-panel {
  display: none;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-panel.active {
  display: block;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  color: #212121;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  color: #1976d2;
  font-size: 18px;
}

/* Material 表单 */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

label {
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
  color: #424242;
  font-size: 16px;
}

input, textarea {
  width: 100%;
  padding: 16px 24px;
  background: #ffffff;
  border: 2px solid #e8e8e8;
  border-radius: 50px;
  font-size: 16px;
  color: #212121;
  transition: all 0.3s ease;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

input:hover, textarea:hover {
  border-color: #1976d2;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.1);
}

input:focus, textarea:focus {
  outline: none;
  border-color: #1976d2;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.15);
}

input::placeholder, textarea::placeholder {
  color: #bdbdbd;
}

textarea {
  min-height: 100px;
  resize: vertical;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 24px;
  padding: 16px 20px;
}

/* Token帮助卡片 */
.token-help {
  background: #e3f2fd;
  padding: 14px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  border-left: 4px solid #1976d2;
}

.token-help p {
  font-size: 13px;
  color: #1565c0;
  line-height: 1.5;
  margin: 0;
}

.token-help a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 500;
}

.token-help a:hover {
  text-decoration: underline;
}

/* 内联按钮样式 */
.inline-btn {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(25, 118, 210, 0.1);
  color: #1565c0 !important;
  border: 1px solid rgba(25, 118, 210, 0.3);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.inline-btn:hover {
  background: rgba(25, 118, 210, 0.2);
  border-color: rgba(25, 118, 210, 0.5);
  text-decoration: none !important;
}

/* Token步骤列表 */
.token-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.token-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1565c0;
}

/* 步骤按钮样式 - 凸起效果 */
.step-btn {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(180deg, #42a5f5 0%, #1976d2 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 3px 0 #1565c0, 0 4px 6px rgba(0, 0, 0, 0.2);
  position: relative;
  top: 0;
}

.step-btn:hover {
  background: linear-gradient(180deg, #64b5f6 0%, #1e88e5 100%);
  text-decoration: none !important;
}

.step-btn:active {
  top: 3px;
  box-shadow: 0 0 0 #1565c0, 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Material 按钮 - 胶囊风格 */
.btn {
  display: block;
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.btn:hover {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
  box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
  transform: translateY(-1px);
}

.btn:active::after {
  width: 200px;
  height: 200px;
}

.btn:disabled {
  background: #bdbdbd;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  gap: 12px;
}

.btn-group .btn {
  flex: 1;
}

.btn-secondary {
  background: transparent;
  color: #1976d2;
  box-shadow: none;
  border: 2px solid #1976d2;
}

.btn-secondary:hover {
  background: rgba(25, 118, 210, 0.08);
  box-shadow: none;
  transform: none;
}

.btn-success {
  background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

/* 结果提示 */
.step-result {
  margin: 12px 0;
}

.alert {
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.alert-error {
  background: #ffebee;
  color: #c62828;
}

.alert-warning {
  background: #fff3e0;
  color: #ef6c00;
}

/* 确认信息卡片 */
.confirm-info {
  background: #fafafa;
  border-radius: 4px;
  margin-bottom: 24px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.confirm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e0e0e0;
}

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

.confirm-label {
  font-size: 13px;
  color: #757575;
  display: flex;
  align-items: center;
  gap: 10px;
}

.confirm-label i {
  color: #1976d2;
  font-size: 16px;
}

.confirm-value {
  font-size: 13px;
  font-weight: 500;
  color: #212121;
  text-align: right;
  word-break: break-all;
  max-width: 55%;
}

/* 警告卡片 */
.warning {
  background: #fff3e0;
  padding: 14px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  border-left: 4px solid #ff9800;
}

.warning-title {
  font-weight: 500;
  margin-bottom: 4px;
  color: #e65100;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.warning p {
  color: #757575;
  font-size: 12px;
  line-height: 1.5;
}

/* 最终结果 */
#finalResult {
  text-align: center;
  padding: 48px 24px;
}

#finalResult .result-icon {
  font-size: 72px;
  margin-bottom: 24px;
}

#finalResult .result-icon.success {
  color: #4caf50;
}

#finalResult .result-icon.error {
  color: #f44336;
}

#finalResult .result-title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #212121;
}

#finalResult .result-message {
  font-size: 14px;
  color: #757575;
  line-height: 1.6;
}

/* 历史记录链接 */
.view-records {
  text-align: center;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid #e0e0e0;
}

.view-records a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.2s;
}

.view-records a:hover {
  background: rgba(25, 118, 210, 0.08);
}

/* Footer */
footer {
  text-align: center;
  padding: 16px 24px;
  color: #9e9e9e;
  font-size: 12px;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
}

/* 模态框 - Material Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: #ffffff;
  border-radius: 4px;
  padding: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  box-shadow: 0 11px 15px -7px rgba(0,0,0,0.2), 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12);
}

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

.modal-title {
  font-size: 20px;
  font-weight: 500;
  color: #212121;
}

.modal-close {
  background: transparent;
  border: none;
  color: #757575;
  cursor: pointer;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.modal-content {
  overflow-y: auto;
  max-height: calc(80vh - 100px);
}

.history-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr 2fr 1.2fr;
  gap: 16px;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 500;
  color: #757575;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
  border-radius: 4px;
  margin-bottom: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: 1.5fr 1fr 2fr 1.2fr;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  transition: background 0.2s;
}

.history-item:hover {
  background: #fafafa;
}

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

.history-item.history-empty {
  grid-template-columns: 1fr;
  text-align: center;
  color: #9e9e9e;
  padding: 48px;
}

.history-value {
  color: #757575;
  word-break: break-all;
}

.history-result {
  color: #212121;
  font-weight: 500;
}

/* 响应式 */
@media (max-width: 520px) {
  body { padding: 0; }
  .container { border-radius: 0; min-height: 100vh; box-shadow: none; }
  header { padding: 20px 16px; }
  .content { padding: 20px 16px; }
  h1 { font-size: 20px; }
  .step-line { width: 24px; margin: 0 8px; }
  .step-circle { width: 32px; height: 32px; font-size: 13px; }
  .step-item span { font-size: 10px; }
  .btn-group { flex-direction: column; }
  .confirm-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .confirm-value { max-width: 100%; text-align: left; }
  .history-header, .history-item { grid-template-columns: 1fr 1fr; }
}
