* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #333; }
.hidden { display: none !important; }

/* 登录页 */
.login-container {
  display: flex; justify-content: center; align-items: center; min-height: 100vh;
}
.login-box {
  background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  width: 380px;
}
.login-box h2 { text-align: center; margin-bottom: 24px; color: #1a73e8; }
.login-box input {
  width: 100%; padding: 10px 12px; margin-bottom: 16px; border: 1px solid #ddd;
  border-radius: 4px; font-size: 14px;
}
.login-box button {
  width: 100%; padding: 10px; background: #1a73e8; color: #fff; border: none;
  border-radius: 4px; font-size: 16px; cursor: pointer;
}
.login-box button:hover { background: #1557b0; }
.login-error { color: #e74c3c; font-size: 13px; margin-bottom: 12px; text-align: center; }

/* 主布局 */
.app-header {
  background: #1a73e8; color: #fff; padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-header h1 { font-size: 18px; font-weight: 500; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-right span { font-size: 14px; opacity: 0.9; }
.btn-logout {
  background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 6px 16px;
  border-radius: 4px; cursor: pointer; font-size: 13px;
}

.app-body { display: flex; min-height: calc(100vh - 56px); }

/* 侧边栏 */
.sidebar {
  width: 200px; background: #fff; border-right: 1px solid #e8e8e8; padding: 16px 0;
}
.sidebar a {
  display: block; padding: 10px 24px; color: #555; text-decoration: none; font-size: 14px;
  border-left: 3px solid transparent; transition: all 0.2s;
}
.sidebar a:hover, .sidebar a.active {
  background: #e8f0fe; color: #1a73e8; border-left-color: #1a73e8;
}

/* 内容区 */
.main-content { flex: 1; padding: 24px; }
.page-title { font-size: 20px; margin-bottom: 20px; }

/* 按钮 */
.btn {
  padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer;
  font-size: 13px; transition: background 0.2s;
}
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover { background: #1557b0; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 表格 */
.table-wrap { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: #fafafa; font-weight: 500; text-align: left; padding: 12px 16px; font-size: 13px; color: #666; border-bottom: 1px solid #eee; }
td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
tr:hover td { background: #fafbfc; }

/* 模态框 */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.modal {
  background: #fff; border-radius: 8px; padding: 24px; width: 600px; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.modal.modal-flex {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.modal-header h3 { margin: 0; }
.modal-body {
  padding: 20px 24px; overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 16px 24px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}
.modal h3 { margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #555; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* 服务器列表 */
.server-item {
  background: #f8f9fa; border: 1px solid #eee; border-radius: 6px; padding: 16px; margin-bottom: 12px; position: relative;
}
.server-item .remove-server {
  position: absolute; top: 8px; right: 8px; background: none; border: none;
  color: #e74c3c; cursor: pointer; font-size: 18px;
}
.server-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.server-fields .full-width { grid-column: 1 / -1; }

/* 状态标签 */
.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px;
}
.status-active { background: #e8f5e9; color: #2e7d32; }
.status-expired { background: #fce4ec; color: #c62828; }
.status-pending { background: #fff3e0; color: #e65100; }

/* 仪表盘 */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-card {
  background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.dash-card .number { font-size: 32px; font-weight: 600; color: #1a73e8; }
.dash-card .label { font-size: 13px; color: #888; margin-top: 4px; }

/* toast */
.toast {
  position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 6px;
  color: #fff; font-size: 14px; z-index: 2000; animation: slideIn 0.3s ease;
}
.toast-success { background: #27ae60; }
.toast-error { background: #e74c3c; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
