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

:root {
  --bg-color: #f7f7f9;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e5ea;
  --sidebar-hover: #f2f2f7;
  --sidebar-text: #8e8e93;
  --sidebar-text-active: #000000;
  
  --chat-bg: #f7f7f9;
  --bubble-user: #007aff;
  --bubble-user-text: #ffffff;
  --bubble-bot: #ffffff;
  --bubble-bot-text: #1c1c1e;
  --bubble-bot-shadow: 0 2px 10px rgba(0,0,0,0.03);

  --accent-color: #007aff;
  --border-color: #d1d1d6;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: #1c1c1e;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#root {
  height: 100vh;
  display: flex;
}

/* Component Styles */

.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
}

.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid transparent;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #007aff 0%, #005bb5 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-item {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #3a3a3c;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.session-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.session-item:hover {
  background-color: var(--sidebar-hover);
}

.session-item:hover .session-delete-btn {
  opacity: 1;
}

.session-delete-btn {
  opacity: 0;
  transition: opacity 0.2s;
}

.session-item:hover .session-delete-btn {
  opacity: 1;
}

.session-item.active {
  background-color: #e5f1ff;
  color: var(--accent-color);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
}

.settings-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--sidebar-text-active);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.settings-btn:hover {
  background-color: var(--sidebar-hover);
}

.settings-btn.admin-btn {
  color: #ff9500;
}

.settings-btn.admin-btn:hover {
  background-color: rgba(255, 149, 0, 0.1);
}

/* Chat Area */

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background-color: var(--chat-bg);
}

.chat-header {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sidebar-border);
  font-weight: 600;
  font-size: 16px;
  color: #171717;
  position: sticky;
  top: 0;
  z-index: 10;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: slideIn 0.3s ease-out forwards;
}

.message-wrapper.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message-wrapper.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
}

.message-wrapper.user .message-bubble {
  background-color: var(--bubble-user);
  color: var(--bubble-user-text);
  border-bottom-right-radius: 4px;
}

.message-wrapper.assistant .message-bubble {
  background-color: var(--bubble-bot);
  color: var(--bubble-bot-text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--bubble-bot-shadow);
  border: 1px solid rgba(0,0,0,0.05);
}

.thinking-block {
  margin-bottom: 8px;
  padding: 12px;
  background-color: #f2f2f7;
  border-radius: 8px;
  border-left: 3px solid #8e8e93;
  font-size: 13px;
  color: #8e8e93;
  font-family: monospace;
}

.expert-tag {
  font-size: 12px;
  font-weight: 600;
  color: #ff9500;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Input Area */

.input-area {
  padding: 24px;
  background: linear-gradient(to top, var(--chat-bg) 70%, transparent);
}

.input-box {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-box:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.1);
}

.input-box textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  max-height: 150px;
  color: #171717;
}

.send-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  flex-shrink: 0;
}

/* Typing Indicator */

.typing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #8e8e93;
  margin: 0 4px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }

.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

.send-btn:hover {
  background-color: #005bb5;
  transform: scale(1.05);
}

.send-btn:disabled {
  background-color: #d1d1d6;
  cursor: not-allowed;
  transform: none;
}

/* Settings Modal */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out forwards;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 20px;
  width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #8e8e93;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

/* Toggle Switch */

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #34C759;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Utils */

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Markdown Styles */

.markdown-body {
  word-wrap: break-word;
  line-height: 1.6;
}

.markdown-body p {
  margin: 0 0 12px 0;
}

.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 16px 0 8px 0;
  font-weight: 600;
  line-height: 1.4;
}

.markdown-body h1 { font-size: 1.4em; }

.markdown-body h2 { font-size: 1.25em; }

.markdown-body h3 { font-size: 1.1em; }

.markdown-body ul, .markdown-body ol {
  margin: 0 0 12px 0;
  padding-left: 24px;
}

.markdown-body ul:last-child, .markdown-body ol:last-child {
  margin-bottom: 0;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body strong {
  font-weight: 600;
  color: inherit;
}

.markdown-body code {
  background: rgba(0,0,0,0.05);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9em;
}

.message-wrapper.user .markdown-body code {
  background: rgba(255,255,255,0.2);
}

/* Mobile Responsive Styling */

.menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #171717;
  margin-right: 12px;
  padding: 4px;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .menu-btn {
    display: flex;
    align-items: center;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    z-index: 100;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    backdrop-filter: blur(2px);
  }

  .chat-header {
    padding: 0 16px;
  }

  .messages-area {
    padding: 16px;
    gap: 16px;
  }

  .message-wrapper {
    max-width: 90%;
  }

  .input-area {
    padding: 16px;
  }

  /* 手机上只显示 + 号 */
  .new-chat-text {
    display: none;
  }
}

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background: var(--bg-color);
  font-family: var(--font-family);
}

.login-card {
  background: #ffffff;
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  text-align: center;
  width: 100%;
  max-width: 440px;
  margin: 0 16px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #171717;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 15px;
  color: #8e8e93;
  margin-bottom: 24px;
}

/* ===== Login Mode Tabs ===== */
.login-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: #f7f7f9;
  padding: 4px;
  border-radius: 12px;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #8e8e93;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab:hover {
  color: #6d6d72;
}

.mode-tab.active {
  background: #ffffff;
  color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ===== Login Content ===== */
.login-content {
  min-height: 200px;
}

/* ===== Error ===== */
.error-text {
  color: #ff3b30;
  font-size: 13px;
  margin: 0 0 16px 0;
  text-align: center;
  padding: 10px 16px;
  background: rgba(255, 59, 48, 0.06);
  border-radius: 10px;
  line-height: 1.5;
}

/* ===== Mobile Login ===== */
.mobile-login {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wechat-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #07c160;
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  width: 100%;
}

.wechat-login-btn:hover {
  background-color: #06ad56;
  transform: translateY(-1px);
}

.wechat-login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-tips {
  font-size: 12px;
  color: #c7c7cc;
  margin: 0;
}

/* ===== Desktop QR Login ===== */
.desktop-login {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qrcode-container {
  width: 220px;
  height: 220px;
  border: 1px solid #e5e5ea;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: #ffffff;
  overflow: hidden;
}

.qr-image {
  width: 200px;
  height: 200px;
  border-radius: 8px;
}

.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #8e8e93;
  font-size: 13px;
}

.scan-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease-out;
}

.scan-success p {
  color: #171717;
  font-weight: 500;
  font-size: 14px;
  margin: 0;
}

.qr-expired {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #8e8e93;
}

.qr-expired p {
  margin: 0;
  font-size: 14px;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--accent-color);
  background: transparent;
  color: var(--accent-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.refresh-btn:hover {
  background: rgba(0, 122, 255, 0.06);
}

.qr-tips {
  font-size: 14px;
  color: #8e8e93;
  margin: 0;
}

/* ===== Dev Login ===== */
.dev-login-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f2f2f7;
}

.dev-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #c7c7cc;
  font-size: 12px;
  cursor: pointer;
  margin: 0 auto;
  padding: 4px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.dev-toggle:hover {
  color: #8e8e93;
  background: #f7f7f9;
}

.dev-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  animation: fadeIn 0.2s ease-out;
}

.dev-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #f7f7f9;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dev-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
  background: #ffffff;
}

.dev-submit {
  padding: 10px 20px;
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.dev-submit:hover {
  background: #005bb5;
}

.dev-submit:disabled {
  background: #d1d1d6;
  cursor: not-allowed;
}

/* ===== Password & Invite Login ===== */
.password-login,
.invite-login {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #6d6d72;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

.form-input:disabled {
  background: #f7f7f9;
  color: #c7c7cc;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-top: 8px;
}

.login-btn:hover {
  background: #005bb5;
  transform: translateY(-1px);
}

.login-btn:disabled {
  background: #d1d1d6;
  cursor: not-allowed;
  transform: none;
}

/* ===== Animations ===== */
.spin-icon {
  animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.admin-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.admin-panel {
  background: #ffffff;
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f2f2f7;
}

.admin-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #171717;
}

.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f7f7f9;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #8e8e93;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #ebebf0;
  color: #6d6d72;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 24px 0;
  border-bottom: 1px solid #f2f2f7;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 10px 10px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: #8e8e93;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.admin-tab:hover {
  color: #6d6d72;
}

.admin-tab.active {
  color: var(--accent-color, #007aff);
}

.admin-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color, #007aff);
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

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

.section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #171717;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--accent-color, #007aff);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #005bb5;
}

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

.btn-secondary {
  padding: 10px 16px;
  background: #f7f7f9;
  color: #6d6d72;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #ebebf0;
}

/* 创建表单 */
.create-form {
  background: #f7f7f9;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row:last-of-type {
  margin-bottom: 0;
}

.form-row label {
  width: 100px;
  font-size: 13px;
  font-weight: 500;
  color: #6d6d72;
}

.form-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent-color, #007aff);
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

/* 邀请码列表 */
.invite-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f7f7f9;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.invite-item:hover {
  background: #f0f0f5;
}

.invite-item.expired {
  opacity: 0.6;
}

.invite-item.inactive {
  opacity: 0.5;
}

.invite-info {
  flex: 1;
}

.invite-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.code-text {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 15px;
  font-weight: 600;
  color: #171717;
  letter-spacing: 0.5px;
}

.copy-btn {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  border-radius: 6px;
  cursor: pointer;
  color: #8e8e93;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: var(--accent-color, #007aff);
  border-color: var(--accent-color, #007aff);
}

.invite-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #8e8e93;
  flex-wrap: wrap;
}

.bound-card {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(0, 122, 255, 0.1);
  border-radius: 6px;
  color: #007aff;
  font-weight: 500;
}

.expires-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.expired-badge {
  color: #ff3b30;
  font-weight: 500;
}

.note {
  color: #6d6d72;
  font-style: italic;
}

.delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #8e8e93;
  transition: all 0.2s;
}

.delete-btn:hover {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
}

/* 用户表格 */
.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f2f2f7;
}

.user-table th {
  font-size: 12px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
}

.user-table td {
  font-size: 14px;
  color: #171717;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.role-badge.admin {
  background: rgba(255, 149, 0, 0.1);
  color: #ff9500;
}

.role-badge.user {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(7, 193, 96, 0.1);
  color: #07c160;
}

.status-badge.inactive {
  background: rgba(142, 142, 147, 0.1);
  color: #8e8e93;
}

/* 日志列表 */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  padding: 12px 16px;
  background: #f7f7f9;
  border-radius: 10px;
}

.log-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.log-admin {
  font-weight: 600;
  color: #171717;
}

.log-action {
  color: #6d6d72;
}

.log-time {
  margin-left: auto;
  color: #8e8e93;
  font-size: 12px;
}

.log-details {
  margin-top: 8px;
  font-size: 12px;
  color: #8e8e93;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
}

.empty-text {
  text-align: center;
  color: #8e8e93;
  font-size: 14px;
  padding: 40px 0;
}

/* 用户卡片列表 */
.user-cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.user-card-item {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: #f7f7f9;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.user-card-item:hover {
  background: #f0f0f5;
  border-color: #e5e5ea;
}

.card-info {
  flex: 1;
}

.card-nickname {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #171717;
}

.card-real-name {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6d6d72;
}

.card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-detail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #8e8e93;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  cursor: pointer;
  color: #8e8e93;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--accent-color, #007aff);
  border-color: var(--accent-color, #007aff);
}

.edit-btn:hover {
  color: #ff9500;
  border-color: #ff9500;
}

/* 关系列表 */
.relationships-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.relationship-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f7f7f9;
  border-radius: 10px;
}

.relationship-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rel-card {
  padding: 4px 10px;
  background: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #171717;
}

.rel-type {
  padding: 4px 10px;
  background: rgba(0, 122, 255, 0.1);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #007aff;
}

/* 弹窗 */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f2f2f7;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #171717;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid #f2f2f7;
  justify-content: flex-end;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* 手机端：只显示图标，隐藏文字 */
@media (max-width: 768px) {
  .admin-tab-text {
    display: none;
  }

  .admin-tab {
    padding: 10px 12px;
  }

  .admin-panel {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .admin-content {
    padding: 16px;
  }
}
