/* Device Management page styles */
:root {
  --dm-border: #e5e5ef;
  --dm-muted: #6b6f7b;
  --dm-heading: #1c1e26;
  --dm-accent: #E60039;
  --dm-success: #3fc36b;
  --dm-bg: #ffffff;
}

body {
  background: var(--dm-bg);
}

.device-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  color: var(--dm-heading);
}

.device-hero {
  text-align: center;
  margin-bottom: 32px;
}

.device-hero h1 {
  font-size: 32px;
  margin-bottom: 16px;
}

.device-hero__lead {
  font-size: 14px;
  color:#2A2B2E;
  line-height: 1.6;
}

.device-switch-panel {
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.device-switch-panel p {
    font-size: 14px;
  margin: 0;
  color: #666666;
  line-height: 1.5;
}

.device-switch-panel__control {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.switch-label {
  font-weight: 600;
  font-size: 14px;
}

.device-dialog {
  border-radius: 18px;
  max-width: 360px;
  top: 40% !important;
  margin: 0 auto;
  transform: translateY(-50%);
}

.device-dialog .el-dialog__header {
  border: none;
  padding: 16px 24px 0;
  min-height: 32px;
}

.device-dialog .el-dialog__title {
  display: none;
}


.device-dialog .el-dialog__body {
  padding: 8px 24px 0;
}

.device-dialog .el-dialog__headerbtn {
  top: 18px;
}

.device-dialog__message {
  margin: 0;
  text-align: center;
  line-height: 1.5;
  color: var(--dm-heading);
  font-size: 14px;
}

.device-dialog__footer {
    margin-top: 24px;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-dialog__footer .el-button {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  font-weight: 600;
}

.device-dialog__footer .el-button + .el-button {
  margin-left: 0;
}

.device-dialog__confirm.el-button {
  background: var(--dm-accent);
  border-color: var(--dm-accent);
  color: #fff;
}

.device-dialog__confirm.el-button:focus,
.device-dialog__confirm.el-button:hover {
  background: #CC002D;
  border-color: #CC002D;
  color: #fff;
}

.device-dialog__cancel.el-button {
  background: #fff;
  border-color: #d7d8e0;
  color: var(--dm-heading);
}

.device-dialog__cancel.el-button:focus,
.device-dialog__cancel.el-button:hover {
  border-color: #b4b7c3;
  color: var(--dm-heading);
}
.device-table-container {
  margin-top: 32px;
}

.device-table-wrapper {
  border: 1px solid var(--dm-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.device-list-mobile {
  display: none;
  margin-top: 16px;
}

.device-card-mobile {
  border: 1px solid var(--dm-border);
  border-radius: 16px;
  padding: 16px 18px;
  background: #fff;
  margin-bottom: 12px;
  box-shadow: 0 12px 20px rgba(15, 21, 53, 0.06);
}

.device-card-mobile__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.device-card-mobile__body {
  border-top: 1px solid var(--dm-border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.device-meta-row {
  display: flex;
  flex-direction: column;
  color: var(--dm-heading);
}

.meta-label {
  font-weight: 600;
  color: var(--dm-muted);
}

.meta-value {
  color: var(--dm-heading);
  line-height: 1.4;
}

.device-table {
  width: 100%;
  border-collapse: collapse;
}

.device-table thead {
  background: #faf7fb;
}

.device-table th,
.device-table td {
  padding: 18px 24px;
  text-align: left;
  border-bottom: 1px solid var(--dm-border);
  font-size: 14px;
}

.device-table th {
  font-weight: 600;
  color: var(--dm-heading);
}

.device-table tbody tr:last-child td {
  border-bottom: none;
}

.device-os {
  display: flex;
  align-items: center;
  gap: 14px;
}

.device-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1eff7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--dm-heading);
}

.device-icon::before {
  content: "";
  width: 24px;
  height: 24px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

.device-icon--desktop::before {
  background-image: url("data:image/svg+xml;utf8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M2.5 4C2.5 3.44771 2.94771 3 3.5 3H20.5C21.0523 3 21.5 3.44771 21.5 4V16C21.5 16.5523 21.0523 17 20.5 17H3.5C2.94771 17 2.5 16.5523 2.5 16V4Z' stroke='rgb(42,43,46)' stroke-linecap='round' stroke-linejoin='round'/><path d='M2.5 13C2.5 12.4477 2.94771 12 3.5 12H20.5C21.0523 12 21.5 12.4477 21.5 13V16C21.5 16.5523 21.0523 17 20.5 17H3.5C2.94771 17 2.5 16.5523 2.5 16V13Z' stroke='rgb(42,43,46)' stroke-linecap='round' stroke-linejoin='round'/><path d='M12 15.5C12.5523 15.5 13 15.0523 13 14.5C13 13.9477 12.5523 13.5 12 13.5C11.4477 13.5 11 13.9477 11 14.5C11 15.0523 11.4477 15.5 12 15.5Z' fill='rgb(42,43,46)'/><path d='M8.5 17L7 21H17L15.5 17' stroke='rgb(42,43,46)' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.device-icon--mobile::before,
.device-icon--tablet::before {
  background-image: url("data:image/svg+xml;utf8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M17 2H7C6.17157 2 5.5 2.67157 5.5 3.5V20.5C5.5 21.3284 6.17157 22 7 22H17C17.8284 22 18.5 21.3284 18.5 20.5V3.5C18.5 2.67157 17.8284 2 17 2Z' stroke='rgb(42,43,46)'/><path d='M11 5H13' stroke='rgb(42,43,46)' stroke-linecap='round' stroke-linejoin='round'/><path d='M10 19H14' stroke='rgb(42,43,46)' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.device-icon--other::before {
  content: "\1F4BB";
  background-image: none;
  font-size: 24px;
}

.device-os__name {
  font-weight: 600;
  margin-bottom: 2px;
}

.device-os__browser,
.device-location__ip {
  color: var(--dm-muted);
  font-size: 13px;
}

.device-location {
  line-height: 1.4;
}

.manage-cell {
  text-align: right;
}

.link-button {
  background: none;
  border: none;
  color: var(--dm-accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.current-session {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--dm-success);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dm-success);
  display: inline-block;
}

.device-back-btn {
  margin: 24px 0;
  display: block;
  background: #0055CD;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 36px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.device-list__state {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--dm-border);
  border-radius: 14px;
  color: var(--dm-muted);
}

.device-list__state h3 {
  margin: 18px 0 8px;
  color: var(--dm-heading);
}

.device-list__state .el-icon-loading {
  font-size: 40px;
  color: var(--dm-accent);
}

@media (max-width: 768px) {
  .device-switch-panel {
    align-items: flex-start;
  }

  .device-table th,
  .device-table td {
    padding: 14px;
  }

  .device-table-wrapper {
    display: none;
  }

  .device-list-mobile {
    display: block;
  }

  .device-back-btn {
    width: 100%;
  }

  .device-dialog {
    max-width: 300px;
    width: calc(100% - 200px);
  }

}

/* Keep body width stable when Element UI dialogs lock scroll on mobile */
@media (max-width: 768px) {
  body.el-popup-parent--hidden {
    padding-right: 0 !important;
    overflow: hidden;
  }
}

/* 增加更具体的选择器 */
.device-table:not([cellpadding]) th,
.device-table:not([cellpadding]) td {
    padding: 11px 48px !important;
}
