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

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f5f5f5;
  color: #2c2c2c;
  height: 100vh;
  overflow: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 顶栏 */
.topbar {
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #e2e2e2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.topbar-status {
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 6px;
  height: 6px;
  background: #52c41a;
  border-radius: 50%;
}

/* 内容区 */
.content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左栏 */
.left {
  width: 340px;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.form-area {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.field {
  margin-bottom: 12px;
}

.field-label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: #1677ff;
}

.btn-query {
  width: 100%;
  height: 36px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-query:hover { background: #0958d9; }
.btn-query:disabled { background: #91caff; cursor: wait; }

.tip-box {
  margin-top: 10px;
  padding: 6px 10px;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 4px;
  font-size: 11px;
  color: #ad6800;
  line-height: 1.5;
}

/* 邮件列表 */
.mail-list {
  flex: 1;
  overflow-y: auto;
}

.mail-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.1s;
}

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

.mail-item.active {
  background: #e6f4ff;
  border-left: 2px solid #1677ff;
}

.mail-item .m-subject {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-item .m-from {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-item .m-date {
  font-size: 11px;
  color: #bbb;
  margin-top: 2px;
}

.list-loading, .list-empty {
  padding: 40px 16px;
  text-align: center;
  color: #ccc;
  font-size: 13px;
}

.list-loading .spin {
  width: 24px;
  height: 24px;
  border: 2px solid #e8e8e8;
  border-top-color: #1677ff;
  border-radius: 50%;
  animation: sp 0.6s linear infinite;
  margin: 0 auto 8px;
}

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

/* 右栏 */
.right {
  flex: 1;
  background: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.right-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d9d9d9;
  font-size: 14px;
}

.detail-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.detail-head .d-subject {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 10px;
  line-height: 1.4;
}

.detail-head .d-meta {
  font-size: 12px;
  color: #999;
  line-height: 1.8;
}

.detail-head .d-meta span { color: #555; }

.steam-code {
  margin: 12px 24px;
  padding: 12px 16px;
  background: #1b2838;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.steam-code .sc-label { font-size: 12px; color: #66c0f4; }
.steam-code .sc-value { font-size: 24px; font-weight: 700; color: #fff; letter-spacing: 4px; }
.steam-code .sc-copy {
  padding: 6px 14px;
  background: #66c0f4;
  color: #1b2838;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.detail-body { flex: 1; }
.detail-body iframe { width: 100%; min-height: 500px; border: none; }

/* Toast */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: #ff4d4f;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 99;
  transition: transform 0.25s;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* 滚动条 */
.mail-list::-webkit-scrollbar, .right::-webkit-scrollbar { width: 4px; }
.mail-list::-webkit-scrollbar-thumb, .right::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
